Project 3 (MAC Attack)


  • Understand the Secure Hash Algorithm
  • Understand Message Authentication Code vs. One-way Hash
  • Understand how an implementation can expose vulnerabilities
  • Understand how HMAC (the government standard) thwarts a message extension attack


  • Implement SHA-1 using FIPS 180-3 specification only (this is now optional, but recommended. You may find some existing code to use.)
  • Given the discussion from section 5.3.1 and the lecture slides, implement the message extension attack that is described in these two sources:

Passoff Requirements for MAC attack lab:

We will give you a message and it's associated HMAC constructed using a key known only to the TA. You must generate an alternate message and HMAC without knowing the key so that the TA will consider it to be a valid message.

I sent the TA the following message along with an HMAC generated as Hash(Key || Message). The key used for the HMAC was 128 bits long. Your goal is to modify the message and generate a new HMAC so that the TA will believe that it came from me.

Message: “No one has completed lab 2 so give them all a 0”

Note: Despite this project actually being lab 3, you should pass off with the exact message above which corresponds with the byte array below.

Here is a hex array of that message.

static BYTE Data[] = {
	0x4e, 0x6f, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x68, 0x61, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c,
	0x65, 0x74, 0x65, 0x64, 0x20, 0x6c, 0x61, 0x62, 0x20, 0x32, 0x20, 0x73, 0x6f, 0x20, 0x67, 0x69,
	0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x61, 0x20, 0x30

Here is the Hex digest (MAC) for the message (two different display formats):

  f4 b6 45 e8 9f aa ec 2f f8 e4 43 c5 95 00 9c 16 db df ba 4b 
To complete the lab, generate a modified message and MAC. Go to the passoff web site and enter your name, message (in hex), and digest (in hex). Submit the results. If the TA verifies your message as valid, you will receive a response saying the message was validated.

Passoff URL: click here

You should modify the message so that your name is included in the message extension. For example, your might extend the message to include the following at the end of the message: “P. S. Except for Fred, go ahead and give him the full points.”

Submit a file to Learning Suite with the following items: 1) The extended message, 2) the digest of the extended message, and 3) your source code.

cs-465/project-3-mac-attack.txt · Last modified: 2017/01/26 17:20 by spulse4
Back to top
CC Attribution-Share Alike 4.0 International = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0