Padding oracle
How Padding Oracle Attack works in AES CBC mode?
plaintext_n = uncrypt(ciphertext_n) β ciphertext_n-1From cipher to xor
+----+----+ +----+----+
| P1 | P2 | -- encrypt --> | C1 | C2 |
+----+----+ +----+----++---+----+ +-----+-----+
| X | C2 | -- encrypt --> | P'1 | P'2 |
+---+----+ +-----+-----+P'2 = uncrypt(C2) β X
C2 = encrypt(P2 β C1)
P'2 = uncrypt(encrypt(P2 β C4)) β X
# As encrypt is the inverse of uncrypt, uncrypt(encrypt(1)) = 1
P'2 = P2 β C1 β X
P2 = P'2 β C1 β XOracle
Mitigating Padding Oracle Attacks
Resources
Last updated