Question: You re given a message and a valid secret - prefix MAC tag for it; you don t know the secret prefix. The goal is
Youre given a message and a valid secretprefix MAC tag for it; you dont know the secret prefix. The goal is to forge a tag for a message that contains the byte sequence CA FE FD hex
On the exercise page, youll see three boxes.
The SecretPrefix MAC box shows a message and a tag for it using a random key with the secretprefix MAC.
This box illustrates the SHA padding. It shows the SHA block that actually goes into the compression function with the secret hidden Note that the message bytes are followed by x then a bunch of zeroes, then the length of the message in bits.
The Extendable SHA box lets you compute SHA with a custom initial H and bit count. When you load the page, the Initial H field contains SHAs actual nothingupmysleeve constants, so if you leave that field unchanged and the initial bit count at zero, this box will compute the plain SHA hash of the Hash input field.
The Solution box is where youll construct the message that youre forging a tag for, and enter the forged tag.
This box lets you enter a message, then computes the secretprefix MAC tag of it but it doesnt show you the tag. It compares this tag the true tag to the forged tag that you enter.
Like the first box, this one shows the SHA blocks that go into the compression function with the secret hidden
Here is what youll need to do for the attack:
Copy the tag from the SecretPrefix MAC box, and paste it into the Initial H field. This is the hash youre extending.
Set the Hash Input field in the Extendable SHA box, so that it contains the byte sequence CA FE FD The rest of the bytes can be whatever you want.
These eight bytes are E from the explanation above.
Youll now construct the message whose tag youre forging, in the Message field of the Tag Verifier box. Recall from earlier that the message is the original MAC input, followed by the original hashs padding, followed by E your extension
Try changing the contents of the Message field and watch the effect it has on the SHA blocks shown below.
Then, edit the Message field so that:
The first SHA block shown below the Message field is exactly the same as the SHA block from the SecretPrefix MAC box.
The second SHA block shown below the Message field is exactly the same as the SHA block from the Extendable SHA box, except for the two bytes at the very end.
Back in the Extendable SHA box, try changing the value of the initial bit count, and watch the effect it has on the SHA block shown below. Youll see the bytes at the end changing.
Set the initial bit count so that the SHA block shown below in the Extendable SHA box is exactly the same as the second block in the Tag Verifier box.
Once you get the right value, make sure you understand: why is that the correct value of the initial bit count?
At this point, the hash in the Extendable SHA box is the forged tag.
Copy the hash from the Extendable SHA box and paste it into the Forged tag field of the Tag Verifier box. The Tag Verifier box will turn green if you did everything right.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
