25.02.2013 Views

TCP/IP Tutorial and Technical Overview - IBM Redbooks

TCP/IP Tutorial and Technical Overview - IBM Redbooks

TCP/IP Tutorial and Technical Overview - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

A hash function that takes a key as a second input parameter <strong>and</strong> its output<br />

depends on both the message <strong>and</strong> the key is called a message authentication<br />

code (MAC), as shown in Figure 22-5.<br />

cleartext<br />

clea<br />

cle<br />

Message<br />

Figure 22-5 Generating a message authentication code (MAC)<br />

Put simply, if you encrypt a hash, it becomes a MAC. If you add a secret key to a<br />

message, <strong>and</strong> then hash the concatenation, the result is a MAC. Both symmetric<br />

<strong>and</strong> asymmetric algorithms can be used to generate MACs.<br />

Hash functions are primarily used to assure integrity <strong>and</strong> authentication:<br />

► The sender calculates the hash of the message <strong>and</strong> appends it to the<br />

message.<br />

► The recipient calculates the hash of the received message <strong>and</strong> then<br />

compares the result with the transmitted hash.<br />

► If the hashes match, the message was not tampered with.<br />

► If the encryption key (symmetric or asymmetric) is only known by a trusted<br />

sender, a successful MAC decryption indicates that the claimed <strong>and</strong> actual<br />

senders are identical.<br />

786 <strong>TCP</strong>/<strong>IP</strong> <strong>Tutorial</strong> <strong>and</strong> <strong>Technical</strong> <strong>Overview</strong><br />

Key<br />

Hash<br />

function<br />

cleartext<br />

clea<br />

cle<br />

Message authentication<br />

code (MAC)

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

Saved successfully!

Ooh no, something went wrong!