-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Section on CBC padding attack does not mention IV #352
Comments
This is sorta intentional: a CBC padding attack occurs at the end of the ctext and you don't always control the IV. Your explanation hints at this somewhat, e.g.:
On page 70, the full expression is: D(Ci)[b] = 01 \xor r[b] as stated. In context (see p65 for a drawing) f you take R||Ci as the constructed ctext, you'll see that the IV is supplied (might be part of the ctext, might be fixed, whatever) -- but doesn't impact the target block. Does the expression make sense with the drawing? |
GitHub seriously needs LaTeX support. 🙄 |
Oh.
Thanks for the explanation; I think I get your point. What I’d like to do now is, with your explanation as starting point, restate my original observation and see if the text could still be improved.
So, the formula I complained about seems to me now, in a narrow sense, correct. When I complained that “[it] only [achieves us] the immediate output of D, not the plaintext”, well, the formula does certainly not promise otherwise. After all, it says Still I think it would be great if the text would explain... how to get from This explanation on how to get Does this at least make sense? “Help the reader” would be my main point. |
Yeah definitely: I didn't mean to sound dismissive of your issue, I do want to fix the text :) I also agree the distinction between D(Ci) and Pi needs to be highlighted and particularly how you get from one to the other. How do you feel about writing prose? |
All is good. :)
Heh, I can look into if if you’d like. Should have time for it some time before the end of the month. |
I followed section 7.9, CBC padding attacks, as a guide to complete challenge #17 of the cryptopals challenges.
Section 7.9 is a great write-up, but to my frustration I couldn’t make the attack work. Turns out the “Decrypting one byte” subsection should really have made a reference to the initialization vector (IV), because it’s needed to compute the actual plaintext byte. Without it, only the immediate output of D is achieved, not the plaintext.
In other words, in the formula on page 70, the expression
01 ⊕ r[b]
should be, as I understand it,01 ⊕ r[b] ⊕ iv[b]
. (Of course for the second block in the ciphertext, the first block should be used as ‘IV’.)Other than that thanks for the excellent chapter.
(FWIW the challenge in cryptopals.com does mention “oracle function returns the ciphertext and IV”, but I quickly forgot about it after having started to follow the book.)
The text was updated successfully, but these errors were encountered: