Skip to main content
Converted imgur image links from HTTP to HTTPS to avoid mixed content warnings…
Source Link
e-sushi
  • 18.1k
  • 12
  • 85
  • 235
added example, without saying what I actually changed
Source Link
Maarten Bodewes
  • 94.5k
  • 13
  • 165
  • 319

So if you consider ASCII encoding you have two plain text blocks: "SEND ME THE DATA" and " ENCRYPTED" + padding (which we will ignore). Note the space before "ENCRYPTED".

Now if you change the IV you will indeed only change the first block. What you should however do is to change the first block of the ciphertext. That is used as vector (not the initialization vector, but the next vector) for the CBC decryption of the next block.

enter image description here

As you can see, each bit or byte that you change will be directly reflected in the plaintext. So if you want to flip a single bit in the plaintext you simply flip the bit at the same position in the previous ciphertext block.

So in the end you may want to end up with something like:

IV: 8f6f27b5dbfa2ba8367262bda7154d95
CT: 798f04f8b06cc27c1591a4088531a64a9b76a9be87a3e944c6e7000f24f5b9f9

So if you consider ASCII encoding you have two plain text blocks: "SEND ME THE DATA" and " ENCRYPTED" + padding (which we will ignore). Note the space before "ENCRYPTED".

Now if you change the IV you will indeed only change the first block. What you should however do is to change the first block of the ciphertext. That is used as vector (not the initialization vector, but the next vector) for the CBC decryption of the next block.

enter image description here

As you can see, each bit or byte that you change will be directly reflected in the plaintext. So if you want to flip a single bit in the plaintext you simply flip the bit at the same position in the previous ciphertext block.

So if you consider ASCII encoding you have two plain text blocks: "SEND ME THE DATA" and " ENCRYPTED" + padding (which we will ignore). Note the space before "ENCRYPTED".

Now if you change the IV you will indeed only change the first block. What you should however do is to change the first block of the ciphertext. That is used as vector (not the initialization vector, but the next vector) for the CBC decryption of the next block.

enter image description here

As you can see, each bit or byte that you change will be directly reflected in the plaintext. So if you want to flip a single bit in the plaintext you simply flip the bit at the same position in the previous ciphertext block.

So in the end you may want to end up with something like:

IV: 8f6f27b5dbfa2ba8367262bda7154d95
CT: 798f04f8b06cc27c1591a4088531a64a9b76a9be87a3e944c6e7000f24f5b9f9
Source Link
Maarten Bodewes
  • 94.5k
  • 13
  • 165
  • 319

So if you consider ASCII encoding you have two plain text blocks: "SEND ME THE DATA" and " ENCRYPTED" + padding (which we will ignore). Note the space before "ENCRYPTED".

Now if you change the IV you will indeed only change the first block. What you should however do is to change the first block of the ciphertext. That is used as vector (not the initialization vector, but the next vector) for the CBC decryption of the next block.

enter image description here

As you can see, each bit or byte that you change will be directly reflected in the plaintext. So if you want to flip a single bit in the plaintext you simply flip the bit at the same position in the previous ciphertext block.