Questions tagged as ['cbc']

Cipher block chaining (CBC) is a method for encrypting large amounts of data with a block cipher that can only encrypt fixed length plaintexts. When used with an unpredictable initialization vector (IV), it is secure against chosen plaintext attacks (CPA-secure).
Score: 3
eitan avatar
how 0/n split prevent BEAST attack against TLS?
il flag

I read that to mitigrate BEAST attack openSSL tried to inject empty TLS record before each real TLS record. and by doing that there is no opportunity to execute an attack but i dont understand way? what the diffrence between normal TLS? the attacker can still xor the block he want to guess with the last block to disable the iv affect.

Score: 0
Sir Muffington avatar
How to get the rest of 10 bytes (from total 32 bytes plaintext) of plaintext from a 48 byte ciphertext using AES-128 when knowing 22B of plaintext?
cw flag

I have a challenge in which I need to decrypt 32(?) bytes of plaintext, which by encryption resulted in 48 (this for sure) bytes of data.

It's a black box challenge, but managed to figure out the above and below.

According to this https://security.stackexchange.com/questions/207633/decrypting-aes-128-cbc-leads-to-first-block-being-correct-the-rest-corrupt?rq=1 my IV is wrong, even though I extract ...

Score: 0
shaiko avatar
Key expansion in AES CTR mode
ls flag

While working with AES 256 in CBC mode, I learned that it requires Key Expansion - forward (for encryption) and reverse (for decryption). Does AES CTR mode also requires such a step ? Or can the 256 bit key be used as is ?

Score: 0
h q avatar
AES encryption in Perl with custom Key and IV
kr flag
h q

I have the following AES encryption code in JavaScript, but I can't seem to get comparable result in Perl. (Please let me know if this is the correct forum.)

'use strict';
const CryptoJS = require('crypto-js');

const message = 's3cret';
const aesPassword = 'MyPassword';
const salt = CryptoJS.lib.WordArray.random(16);
const iv = CryptoJS.lib.WordArray.random(16);
const key = CryptoJS.PBKDF2(aesPass ...
Score: 0
Shark44 avatar
AES CBC - Find IV (CTF)
bv flag

I am currently trying to solve a training challenge based on AES with CBC. This is the infos I'm given:

KEY = "yn9RB3Lr43xJK2██".encode()
IV  = "████████████████".encode()
msg = "AES with CBC is very unbreakable".encode()

Those spaces are unknown characters, and I also have the output:

c5████████████████████████■...
Score: 2
cmdruid avatar
Is it possible to craft a valid AES-CBC cipher-text that will decrypt (to random) with any possible key?
br flag

I am mainly looking to perform this trick for fun. I have access to an API that uses WebCrypto under the hood for encrypt and decrypt methods. I would like to hijack the decrypt method in order to create a deterministic seed.

I have read other articles, and it seems like this trick should be relatively straight-forward, as AES-CBC does not have any integrity checks (that I know of). My understandi ...

Score: 1
gsmoke1 avatar
CBC not CCA secure
id flag

I always get stuck at those kind of exercises in my Cryptography class. I just don't understand how should I build these scenarios of "sending m1 and m2 and then somehow telling if it was m1 or m2 etc..." attacks. Can someone explain to me in simple terms how can I describe a scenario for this exercise: "Show that the CBC mode is not CCA-secure by describing an attacker A and name its advantage."

Score: 2
MariaDb avatar
Padding Oracle Attack Example
ax flag

I try to understand a oracle Padding Oracle Attack example. I try to solve this question but I didn't figure out the answer.

A 7-byte message is padded per PKCS#5 and encrypted using the CBC mode of operation. The resulting ciphertext is
0x07 06 05 04 03 02 01 01, 0x08 09 0A 0B 0C 0D 0E 0F

Assume an Attacker modified that to
0x07 06 05 04 03 02 00 02, 0x08 09 0A 0B 0C 0D 0E 0F
and observed that the ci ...

Score: 1
MariaDb avatar
Cryptography particular block length valid message
ax flag

I am new at cryptography and start to learn some terms. I just saw an question in the book and didn't got a clue about this question. Could someone can explain me the answer of this question? Because all of the questions seems to be fine for me.

Assuming the block length is 8 bytes (L = 8) Which of the following is/are are valid coded messages?

  1. 0x01 FF 52 18 04 04 04 04
  2. 0x01 FF 04 04 04 04 04 04 ...
Score: 2
VitoCorleone avatar
Padding Oracle Attack - Decrypting First Block with Static IV
sx flag

I'm trying to understand the exploitability of the padding oracle attack, which enables someone to decrypt and encrypt the contents without knowing the encryption key.

Can encrypted data with the first block, be decrypted by the app that relies on a static IV without knowing the IV?

I want to understand the padding oracle attack's exploitability, especially to decrypt the first block of data using st ...

Score: 2
j123b567 avatar
Exploit 3DES-CBC with known checksum of plaintext and repeated IV
ca flag

I came across the following enterprise encryption scheme. I laughed when I first saw it, but I'm not a specialist and I'd like to know how bad it really is.

  • 3DES-CBC
  • k1=k2=k3 for 3DES
  • IV for CBC is repeated every 256 messages. Every communication party has a different set of 256 IVs but they are all predictable and similar in many places. IV has a fixed part unique for each communication party and an 8 ...
Score: 1
U. Windl avatar
Role of IV in Perl's Crypt::Rijndael
cn flag

Sorry in advance if I'm asking a stupid question:

I thought the role of "IV" in encryption is to avoid having identical ciphertext for identical plaintext. So one could use some random IV.

Writing some Perl code I'm confused, however. Consider this test code:

use Crypt::Rijndael;
my $cipher = Crypt::Rijndael->new('x' x 16, Crypt::Rijndael::MODE_CBC());
$cipher->set_iv('IV' x 8);
my $data = 'ol ...
Score: 3
Paul avatar
GCM-SIV vs CBC with fixed IV?
rs flag

I keep hearing CBC with fixed IV mode is bad because it has similar issues to the codebook breakdown of ECB mode. However, people seem quite willing to recommend AES-GCM-SIV for deterministic encryption. Why is GCM-SIV superior to claim CBC with fixed IV?

Score: 0
Edward Akina avatar
How to encrypt with CBC, step by step?
kn flag

I have this message "Hello from another world"

  1. Can you explain how to encrypt it with CBC step by step?

  2. Are the message characters H, E, L, L, O .. converted to binary first, then every 8 bits or 16 bits XORed with IV and passed to the encryption function to be encrypted with a secret key?

Score: -1
Green Ideology avatar
How is DES used with CBC?
sz flag

I'm reading our school's notes for cryptography, and it does a good job explaining CBC and DES in detail, but it fails to provide good information on how they are related.

From what I've researched so far, it appears that CBC is essentially a series of block ciphers, and DES can be used for the block cipher encryption process.

Is that it, or are there some other ways these are related? I'm really lo ...

Score: 6
Amirhossein avatar
Always set the IV to 0 randomized CBC
sn flag

Please explain what goes wrong if we always set the IV to 0 in randomized CBC, and use the system to encrypt two different messages m0 /= m1 with the same key k.

I tried to find answer and read CBC mode IV .

I can't understand what goes wrong if we always set IV = 0

Score: 1
George avatar
AES-CBC collision resistance of hash function
tn flag

I'm very new to cryptography and am having some issues with the following question

A hash function H encrypts an n-block message m = (m1, m2 ... mn) in CBC mode:
- Block size is 128 bits
- Hash result is the last ciphertext
- IV is arbitrary 1 block long
- Encryption key is arbitrary number -> 128, 192 or 256 bits
- IV and Key are public

I need to find out if this function is collision resistant

Score: 1
MSCHA avatar
AES-CBC-MAC forgery attack
cx flag

I have a CBC-MAC scheme using AES as the block cipher (T=H_K1(M)), which gives me a tag and a stream cipher using another key and a nonce, which gives me a cryptotext (C=E_K2(N,M)). So my question is based on a known-plaintext attack to create a valid (ciphertext, nonce, tag)-tuple. I already figured out how I can create a new message to get the same tag with a given pair (M,T):

M1 = M xor T => T = H ...

Score: 1
sunknudsen avatar
Is it normal that cypertext size can be smaller than IV when using AES-256-GCM?
th flag

I noticed that when using AES-256-CBC with a 128-bit IV, the ciphertext is always at least 16 bytes long (size of IV).

I also noticed that when using AES-256-GCM with a 96-bit IV, the ciphertext size can be smaller than the IV.

Normal? Why?

Score: 2
earthling avatar
AES CBC: When to use new IV
cn flag

I am trying to figure out when to use a new IV for an AES-CBC communication and whether my approach is safe.

Here is a quote from Thomas Pornin from a similar question:

So, to sum up: you must choose a new, random IV (with a cryptographically strong generator) whenever you are about to encrypt plaintext data which was obtained after having sent over the wire the previous encrypted block.

I need  ...

Score: 0
Alternative to CBC mode encryption?
in flag

Given that CBC mode encryption is vulnerable to padding oracle attacks, what is the next best alternative ?

a) Include a hash check in the API scheme, validate the hash and then proceed with CBC. If hash check fails then return error indicating same. Eg: Include HMACSHA256(AES256(plaintext)) checksum that is required to be validated as part of message.

b) Implement a custom CBC mode that include a hma ...