21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

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.

Figure 6-5. The authenticate-then-encrypt paradigm<br />

See Also<br />

Recipes 5.4, 5.6, 5.9<br />

6.19 Making Your Own MAC<br />

<strong>Problem</strong><br />

You do not want to use an off-the-shelf MAC; you would prefer just to use a hash<br />

function.<br />

Solution<br />

Don’t do it.<br />

Discussion<br />

Output<br />

Figure 6-6. The authenticate-and-encrypt paradigm<br />

Many things can go wrong, and there’s really no reason not to use one of the excellent<br />

existing solutions. Nonetheless, some people believe they can do message<br />

300 | Chapter 6: Hashes and Message Authentication<br />

M<br />

M Tag<br />

Encryption<br />

C<br />

M<br />

Encryption<br />

MAC<br />

Output<br />

MAC<br />

C Tag<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.

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

Saved successfully!

Ooh no, something went wrong!