-1
$\begingroup$

Given is the secret message encrypted with AES-256 in CBC mode

5a04ec902686fb05a6b7a338b6e07760 14c4e6965fc2ed2cd358754494aceffa

The first 16 Byte is the initial vector, the second 16 Byte is the ciphertext. The plaintext of the secret message above is (ASCII-encoded) We're blown. Run

How can you change the secret message such that you get Meeting tonight! if you decrypt it?


I'm not sure how to do this correctly but I found some graphic that describes the way CBC is decrypted:

enter image description here

Because the plaintext is ASCII encoded, we should have in total one planetext block because the message We're blown. Run is made up of exactly 16 characters. But all in all, I don't really understand how I can change the secret message to get the message Meeting tonight! ? : /

$\endgroup$
  • 1
    $\begingroup$ Hint: What happens to the decryption result if you XOR some arbitrary value $\Delta$ (16-bytes) into the IV? $\endgroup$ – SEJPM May 31 '18 at 18:25
  • $\begingroup$ @SEJPM If you XOR some arbitrary value with the initial value, it then gets encrypted and takes one block size. For further iterations, the output of this encrypted block is used instead of the initial vector. At least that's how I got it from the graphic :s $\endgroup$ – roblind May 31 '18 at 19:58
  • $\begingroup$ @roblind The plaintext is exactly 16 bytes long. Therefore the block cipher algorithm is performed exactly exactly once if no padding is used. Therefore there are no further iterations. Note that you are actually changing the IV without changing ciphertext. After the sender encrypts. Before the recipient decrypts. How does the decrypted value change when you change specific bits in the IV. $\endgroup$ – Future Security Jun 1 '18 at 4:17
  • $\begingroup$ (new^old)^old = new by properties of xor (^) $\endgroup$ – Henno Brandsma Jun 2 '18 at 6:57
3
$\begingroup$

The diagram you have there is for encryption... decryption is basically upside down:

CBC Mode Decryption

Notice that the ciphertext is decrypted and then XORed to produce the plaintext. You simply need to manipulate the IV to change the output of the first block

$\endgroup$
  • 1
    $\begingroup$ Which is why you should not forget to take the IV into account when performing encrypt- then-MAC, and why authenticated ciphers always include the IV as well. $\endgroup$ – Maarten Bodewes May 31 '18 at 23:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.