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

PHP AES 128 bit CBC Encryption gives a size warning

i am using the AES ALgo with 128 bit with CBC cipher mode encryption, below is the code: $cc = 'my secret text'; $key = '3aa22e01c04c7059778c54d122b0273689fba00f4a166a66d15f7ba6a8ba8743'; $iv = '1234567890123456'; $length = strlen($cc); $cipher =…
Padyster
  • 993
  • 3
  • 11
  • 21
0
votes
1 answer

AES key has a LF character in it

I am trying to decrypt a video file using openssl. But 16 byte aes key has a line feed (LF) character in it. x yÏï:YÛI?þbl Because of the LF, when I copy the key to the terminal, it sends only "x" not the whole key. How can I type this key on…
Necip Onur Uzun
  • 1,115
  • 3
  • 13
  • 16
0
votes
1 answer

How to use CBC and HMac? Mcrypt PHP

How do you use CBC and HMAC? I couldn't find enough information on the internet. How do you get the IV? How would you know what it is when you need to decrypt later? (Wouldn't putting it in the database defeat the purpose?) What is HMAC, and is it…
Anon
  • 45
  • 1
  • 6
0
votes
1 answer

Is it possible to use CBC mode of 3DES decryption method to decrypt an encrypted message of 14 characters?

I read about the CBC mode of encryption in wikipedia where it said that in 3DES method a message is divided into 16 digit blocks each and then they are encrypted or decrypted. Every block which is encrypted is XORed with the next plaintext and then…
Manas
  • 84
  • 2
  • 7
0
votes
3 answers

Objective C AES CBC Encryption with Zero Padding

I am trying to encrypt a string with AES 128 encryption, using CBC mode, with Zero Padding. Sadly, i do not know how to do this, as many attempts have gone unsuccessful. I have code in C# and was wondering whether anyone can help me getting my…
Simon
  • 67
  • 1
  • 5
-1
votes
1 answer

Bouncy Castle and CryptoJS vs Pycryptodome and Cryptography - who's right and how to decrypt the data in Python?

Let me explain. I have some data encrypted by Bouncy Caste library (AES 128 CBC). I am able to decompress the data using Crypto.js: var CryptoJS = require('crypto-js') const ivHexString = '4d055a9e07e7db37297dd20cc73c4cc4' const keyHexString =…
Marek Marczak
  • 532
  • 8
  • 14
-1
votes
1 answer

Java code not able to decrypt the encrypted string of node js

const forge = require('node-forge'); const json = { number: '9246753466', lob:'Prepaid', firstName:'Mr. XYZ', leadId:'yLWJjN2YtYWVlM2', address: { addressLine1:…
Sourav Mukherjee
  • 299
  • 7
  • 13
-1
votes
1 answer

Best way to AES Encrypt large files (Approx. 5GB)

My Requirement: I have a Azure Storage Account with 2 containers named Normal and Encrypted. Now a zip file will be uploaded into "Normal" container which I need to encrypt and place it into "Encrypted" Container. File can be anywhere between 3GB to…
-1
votes
1 answer

Speed up AES_CBC mode (using AES_ECB mode)

I want to implement AES_CBC mode encryption, using ECB encoder from Crypto package. But my code run quite slow (about 1s for 1MB data, while it is just 0.02s when encrypt with AES_CBC mode from Crypto package). Below is my code, any recommend for…
-1
votes
1 answer

Question about AES / CBC / PKCS5Padding Decryption in the Java Programming Language

I am developing a code in Java, in which when a user enters the key, the Initialization Vector and the ciphertext, the program returns the deciphered text, according to the AES / CBC / PKCS5Padding Mode. This code is NOT working, and I would like…
John
  • 49
  • 7
-1
votes
1 answer

Datapower encrypted text Decrypted value of CBC algorithm consists of input and unwanted characters in java

Am trying to Decrypt an encrypted text from data power in Java using below code. Am using symmetric key mechanism. Thee below code is able to Decrypt the data but gives me a data with unwanted characters f ollowed by plain text. I tried to substring…
gautham
  • 87
  • 2
  • 12
-1
votes
1 answer

How can I convert this java code to javascript

My code should get an encrypted plaintext from the server and decrypts it in react-native with javascript. I have decryption function in java but how can I convert it to javascript? I tried cryptojs with no success. Because the cipher IV made but a…
Morteza
  • 103
  • 1
  • 8
-1
votes
1 answer

javacardx AES encryption not equal to javax AES decryption

I'm developing a smartcard that communicates via middleware to a server. The server needs to authenticate itself to the smartcard. Part of this authentication process is a challenge that is encrypted with a sessionkey. The server needs to decrypt…
Ruben Vervaeke
  • 51
  • 2
  • 11
-1
votes
1 answer

Triple DES with CBC mode : java.security.InvalidAlgorithmParameterException: Wrong IV length: must be 8 bytes long

I am trying to implement a 3DES encryption/decryption with CBC mode in java. The initialisation vector is 0000000000000000 Encrypted string is DD446C051A83BFD98144C348935C61D81398CF29CCFE1CCD Key for decryption is DCBA4F836E45BAB04FAB2937454075D9 I…
Preetam
  • 49
  • 2
  • 8
-1
votes
1 answer

How does AES-128 CBC encryption with IV work in objective-C?

I am trying to encrypt a string with 'AES-128 CBC with IV'. Here is the input parameter and expected output: Key: 000102030405060708090A0B0C0D0E0F IV: 00102030405060708090A0B0C0D0E0F0 Input…
mobile app Beginner
  • 1,651
  • 3
  • 26
  • 40
1 2 3
16
17