26.10.2012 Views

Internet Security - Dang Thanh Binh's Page

Internet Security - Dang Thanh Binh's Page

Internet Security - Dang Thanh Binh's Page

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

HASH FUNCTION, MESSAGE DIGEST AND HMAC 155<br />

Register output<br />

t A B C D E<br />

77 8243ecda 6240e72c 67bb0c15 21095e62 c76126c5<br />

78 a8342af0 8243ecda 189039cb 67bb0c15 21095e62<br />

79 e1426096 a8342af0 a090fb36 189039cb 67bb0c15<br />

After all 512-bit blocks have been processed, the output represented by the five words,<br />

H0, H1, H2, H3 and H4 is the 160-bit message digest as shown below:<br />

H0: 48878397<br />

H1: 9801d679<br />

H2: 394bd834<br />

H3: 28c28e41<br />

H4: 2b8dee05<br />

The 160-bit message digest is then the data concatenation of {Hi}:<br />

H0||H1||H2||H3||H4 = 488783979801d679394bd83428c28e412b8dee05<br />

As discussed previously, the digitised document or message of any length can create a<br />

160-bit message digest which is produced using the SHA-1 algorithm.<br />

Any change to a digitised message in transit results in a different message digest. In<br />

fact, changing a single bit of the data modifies at least half of the resulting digest bits.<br />

Furthermore, it is computationally impossible to find two meaningful messages that have<br />

the same 160-bit digest. On the other hand, given a 160-bit message digest, it is also<br />

impossible to find a meaningful message with that digest.<br />

4.5 Hashed Message Authentication Codes (HMAC)<br />

The keyed-hashing Message Authentication Code (HMAC) is a key-dependent one-way<br />

hash function which provides both data integrity and data origin authentication for files<br />

sent between two users. HMACs have the same properties as the one-way hash functions<br />

discussed earlier in this chapter, but they also include a secret key. HMACs can be<br />

used to authenticate data or files between two users (data authentication). They can also<br />

be used by a single user to determine whether or not his files have been altered (data<br />

integrity).<br />

To evaluate HMAC over the message or file, the following expression is required<br />

to compute:<br />

HMAC = H [(K ⊕ opad)||H [(K ⊕ ipad)||M]]<br />

where ipad = inner padding<br />

= 0 x 36 (repeated b times)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!