Questions tagged [cbc-mode]

CBC Mode is cipher block chaining.

CBC mode was originally specified by NIST in FIPS 81. The standard, issued in 1981, only offers confidentiality. Other modes, such as CCM and GCM, offer authenticated encryption which places an integrity assurance over the encrpyted data.

In CBC mode, an initialization vector must be used in the first block of plaintext. Then each subsequent block of plaintext is XORed with the previous ciphertext block before being encrypted thus making all the blocks dependent on all the previous blocks. This means that in order to find the plaintext of a particular block, you need to know the ciphertext, the key, and the ciphertext for the previous block.

247 questions
3
votes
0 answers

Using CBC DES encryption in java card

I am trying to encrypt data using Cipher class . I want to specify the initial vector so I use the following functions : try { cipherCBC = Cipher.getInstance(Cipher.ALG_DES_CBC_NOPAD, false); cipherCBC.init(k,…
Sara Sara
  • 299
  • 1
  • 6
  • 14
3
votes
1 answer

Bad crypto practice in Git-encrypt?

Comments on https://gist.github.com/shadowhand/873637 state "ECB mode encryption is a relatively simple method of encryption that provides a high level of obfuscation (or a low level of encryption). This method is not very secure and should not be…
Daniel
  • 1,774
  • 2
  • 22
  • 38
3
votes
1 answer

Decrypt MCRYPT_RIJNDAEL_256 with 32-byte initialization vectors with PyCrypto

I have data that was encrypted in PHP as follows: mcrypt_encrypt(MCRYPT_RIJNDAEL_256, SECRET, $data, MCRYPT_MODE_CBC, $iv) I need to decrypt this data in a Python 3 application. I am trying to use PyCrypto but I am open to other libraries. I expect…
gavinmh
  • 257
  • 4
  • 9
3
votes
1 answer

What does cipher.update do in java?

I am implementing DES - CBC. I am confused as to what cipher.init, cipher.update and cipher.dofinal do. I just use init to set the key and dofinal to get the result. I don't use update. Is that correct? Also whats the difference to the result when…
dfs
  • 35
  • 1
  • 4
3
votes
2 answers

Explanation of Self-healing property of CBC (Cipher Block Chaining)

Wikipedia: CBC mode has the self-healing property: if one block of the cipher is altered, the error propagates for at most two blocks. Made up Example: Let the block size be 64 bits. The original plaintext is: 3231343336353837 …
Node.JS
  • 1,042
  • 6
  • 44
  • 114
3
votes
3 answers

c++ to php translation, decryption function

So, I'm trying to translate a piece of C++ code to php. The C++ is from a external source, and my knowledge of both C++ and decryption is lacking, to say the least. The source C++ is: void parser_t::decrypt(buffer_t &replay_data, const unsigned char…
Cerbrus
  • 70,800
  • 18
  • 132
  • 147
3
votes
1 answer

Decryption using AES 256 with key and salt values using Java

I'm trying to make decryption logic and knnow that encrypted string has been made using: Key: 8d6ea4d3e6f8c4f8641516baa5e42b85 transformation: AES/CBC/ISO10126PADDING salt: 1c4dd21d7ba43bdd iterations: 0 Encrypted string:…
user3101544
  • 31
  • 1
  • 1
  • 2
3
votes
1 answer

Increasing the diffusion of the AES-CBC encryption algorithm in pycrypto for python

When encryption is done using the AES-CBC algorithm, the encryption can be thought of as chaining the cipher texts with the previous ones and an IV. However, if its on CBC mode, we give our cipher text forward diffusive properties (i.e. if we change…
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
3
votes
3 answers

What kind of padding does Rails OpenSSL::Cipher use for AES-CBC-256?

What padding scheme does OpenSSL::Cipher use when padding blocks for encryption? The documentation is vague. http://www.ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/Cipher.html#method-i-padding-3D I will need to use the encrypted data with…
Chloe
  • 25,162
  • 40
  • 190
  • 357
3
votes
1 answer

How do I implement CBC mode?

My problem lies around the AES encryption algorithm and implementing an IV into the algorithm. I have the ECB version of AES working and I have thoroughly tested it. I'm trying to make it more secure by adding in an IV. I am looking to understand it…
Repareman
  • 128
  • 1
  • 7
3
votes
2 answers

Padding in AES CBC

I am trying to test CBC with Random IV using (128-bit AES) in C#. In my question to solve, I have 12-byte input message. The condition is that if PlainText is less than block-size (16-bytes) the padding to be used starts with 0x01 and then upto 6…
3
votes
1 answer

Decoding/encoding openssl aes cbc string between Perl and PHP

I'm writing some server code in PHP and I have an offline process written in Perl and they need to communicate via encrypted strings. In PHP I have been using: $encrypted_string = openssl_encrypt($my_string, "aes-128-cbc", "my_password", true,…
Vijay Boyapati
  • 7,632
  • 7
  • 31
  • 48
3
votes
2 answers

PHP implementing Ciphertext Stealing (CTS) with CBC

I have been trying to implement Ciphertext Stealing(CTS) in PHP for CBC. Referring below two links How can I encrypt/decrypt data using AES CBC+CTS (ciphertext stealing) mode in PHP? and http://en.wikipedia.org/wiki/Ciphertext_stealing I am…
Madhur
  • 2,119
  • 1
  • 24
  • 31
3
votes
1 answer

Random access encrypted file

I'm implementing a web based file storage service (C#). The files will be encrypted when stored on the server, but the challenge is how to implement the decryption functionality. The files can be of any size, from a few KB to several GB. The data…
Andreas
  • 705
  • 10
  • 22
2
votes
2 answers

AES CBC algorithm/padding in java/angular

I have written this code in Angular to encrypt a string: import { Injectable } from '@angular/core'; import * as CryptoJS from 'crypto-js'; @Injectable({ providedIn: 'root', }) export class CryptoService { encrypt(message: string, clef:…
1
2
3
16 17