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
2
votes
0 answers

Error when decrypting first bytes Java AES/CBC/PKCS5PADDING

I was implementing encryption decryption of a file using the AES/CBC/PKCS5PADDING algorithm. And I noticed some peculiarity. With the correct order of initialization of the IV, everything is decrypted correctly. But if the order is wrong (see…
Oxonomy
  • 29
  • 3
2
votes
1 answer

go AES encryption CBC

Problem I have to port a function from C# to GO, which is using AES encryption. obviously i have to get the same result with GO that i get with C# C# code fiddle I prepared a small fiddle with C# using System; using System.Linq; using…
lumo
  • 790
  • 1
  • 8
  • 23
2
votes
1 answer

aes-cmac in javascript not giving the same results as in python

I'm writing code to read/write to NTAG424 DNA NFC tags. I'm doing this completely in javascript, because I want to be able to use it in a react native app. In NTAG 424 DNA and NTAG 424 DNA TagTamper features and hints they show the results you…
Zen Zac
  • 136
  • 1
  • 9
2
votes
1 answer

Decrypt AES/CBC/PKCS5Padding Encryption in Dart

I am already having encryption code in java. Now I want to consume APIs from my server. Even after trying various tutorials and sample codes I am not able to successfully decrypt the hash. I know fixed salt and IV is not recommended at all. But for…
Mayur_Thakur
  • 651
  • 8
  • 15
2
votes
1 answer

AES-256-CBC in .NET Core (C#)

I am searching for C# Code to reproduce the following openssl command. openssl enc -d -aes-256-cbc -in my_encrypted_file.csv.enc -out my_decrypted_file.csv -pass file:key.bin Additional information: The encrypted file in present as byte[] The…
MikeJ82
  • 153
  • 1
  • 12
2
votes
1 answer

AES-128-CBC decpription return wrong value

I tried to create an AES-128-CBC decryption over javascript Here I did so far:
2
votes
2 answers

Concatenate IV and Data in Base64 string using Crypto++?

I needed to encrypt a string to AES/CBC. In order to be able to uncrypt it later I have to store the IV in the final result which must be a base64 string. I manage to do that using this answer and the Crypto++ samples : std::string…
grunk
  • 14,718
  • 15
  • 67
  • 108
2
votes
1 answer

What is the correct behavior of C_Decrypt in pkcs#11?

I am using C_Decrypt with the CKM_AES_CBC_PAD mechanism. I know that my ciphertext which is 272 bytes long should actually decrypt to 256 bytes, which means a full block of padding was added. I know that according to the standard when invoking…
Amit
  • 173
  • 1
  • 1
  • 9
2
votes
1 answer

Getting different values when encrypting in NodeJS versus OpenSSL C++

I am working on client-server communications and am stuck on making sure that both sides come up with the same encrypted token value. Cannot figure out why they are different. The keys and initialization vectors along with the message itself are all…
KS7X
  • 332
  • 2
  • 15
2
votes
1 answer

Encrypt with C# & decrypt with OpenSSL

I encrypt the file by using .NET. Next, I try to decrypt it by using OpenSSL, and I have an issue: bad decrypt 4294956672:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:529: I have simplified the example: I…
Sir Hally
  • 2,318
  • 3
  • 31
  • 48
2
votes
0 answers

Triple DES Node.js Key/IV length issue

I need to replicate .NET code in Node.js. My hard requirement is that Triple DES encryption needs to performed with 16 byte Key & 16 byte IV. However, I searched all over but couldn't find that combination with any Node.js package. The following…
Junaidi
  • 21
  • 3
2
votes
2 answers

How to decrypt aes-256-cbc in Java

I have encrypted the string in php. Decrypted successfully from php and node.js. In addition, it must be decrypted by java. Help me an example of decrypting from java? PHP Encrypt code /* encrypt */ $encryption_method = 'aes-256-cbc'; $secretHash =…
Th Yoon
  • 99
  • 1
  • 3
  • 9
2
votes
0 answers

Decryption of every 1024th block fails

i am trying to implement a reader in golang to decrypt data (provided by a reader) and validate the data (hmac + sha256) at the same time. Decrypting the complete data as one block and validating it afterwards works. The data can be rather big, so i…
2
votes
1 answer

TripleDes CBC Nodejs implementation throuble

i need to replicate in Nodejs the results of the 3DS CBC encrypt in http://tripledes.online-domain-tools.com/. This is my code: const crypto = require('crypto'); const cipher = crypto.createCipher('des-ede3-cbc', key); password =…
2
votes
1 answer

How to identify and remove CBC ciphers in the CipherSuite?

I have apache http server with below ciphers in the cipherSuite. After a scan I found some of the ciphers(CBC) are weak and need to be removed. But I am unable to identify which of them are actually CBC. Can you please help? FYI - Versions…
Fred
  • 43
  • 1
  • 3
  • 7
1 2
3
16 17