Linked Questions

0
votes
1answer
240 views

Can I use PKCS#5 with CBC? [duplicate]

As far as I know there are two padding mechanisms, which are PKCS 5 and 7. Which one should be used for CBC?
10
votes
3answers
10k views

How to break AES/CBC/PKCS5 when key and IV are reused?

I'm doing a code review for a crypto solution that reuses the same key with a constant IV. I want to demonstrate that this is not the right way to do things by figuring out the key and decrypting all ...
2
votes
1answer
10k views

Can AES use PKCS#5 padding

From What is the difference between PKCS#5 padding and PKCS#7 padding, I understand that PKCS#5 is defined for 8 byte block sizes. Does this rule it out as a padding option for AES since AES has a ...
5
votes
2answers
868 views

During padding oracle attack (CBC), how is first byte of plaintext block is obtained?

Imagine conducting a padding oracle attack against CBC mode with 16-byte length blocks, and PKCS#5 used for padding. You start, as always, revealing the last byte of plaintext. Then you iteratively ...
3
votes
1answer
1k views

AES-CBC Padding: Why always attach 16x 0x10 pad?

Why do we have to always attach a 16x 0x10 pad even though the last block is already at block-length?
0
votes
1answer
862 views

Multiple AES/ECB encryptions of different data with same key all end with same pattern

We have used "AES/ECB/PKCS5Padding" with a 256 bit key. We encrypt different streams of data (blockwise) with the same key. Each encrypted stream ends with same pattern. What is the reason for this?
4
votes
1answer
233 views

AES storing the length within the encrypted data versus storing it outside

I need to strip off padding after decrypting AES(CBC)-encrypted data (I have control over encryption and data transmission), so have looked at adding the length of the original data to the payload ...
1
vote
1answer
437 views

OpenSSL: How to maintain padding from encryption after decryption?

One of my professors mentioned in class that there is a way of using PKCS#7 padding to have the padding persistent after decryption. For example, if I encrypt a 20-byte file using ...
2
votes
2answers
139 views

How do I find out whether a message in CBC has padding?

When a program is decrypting a message encrypted by CBC mode, what does it find out, whether the last bytes of the last block is part of the padding or part of the plaintext? Example: Use CBC mode ...
2
votes
3answers
190 views

AES Cipher Block Chaining 128 bit message

I understand that for AES CBC you need to split the plaintext up into blocks and perform XOR'ing using the previous blocks calculations etc. However, if your message is exactly 128 bits long, do you ...
3
votes
1answer
120 views

Block Ciphers - Standardize plain text

I need to use AES-128 to encrypt a plain text about 720 bits. Is it correct to say that – in this case – the plain text will be divided in 5 blocks of 128, the result will be equal 640 bits, and the ...
0
votes
1answer
92 views

How can padding be disambiguated from data, when encrypting using a block cipher?

How can padding be disambiguated from data, when encrypting using a block cipher? I'm by no means an expert in cryptography, but rather a programmer with a keen interest. Suppose, I've ...
1
vote
1answer
99 views

AES PKCS5 Padding when it's not needed

I'm using AES/ECB with PKCS5 Padding (From what I've read, PKCS7 Padding is actually used internally) and PBKDF2(HMAC-SHA256) to encrypt some passwords in Java. I enter a password, that goes through ...