21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Chapter 6 CHAPTER 6<br />

Hashes and Message Authentication<br />

In Chapter 5, we discussed primitives for symmetric encryption. Some of those primitives<br />

were capable of providing two of the most important security goals: secrecy<br />

and message integrity. There are occasions where secrecy may not be important in<br />

the slightest, but you’d still like to ensure that messages are not modified as they go<br />

over the Internet. In such cases, you can use a symmetric primitive such as CWC<br />

mode, which allows you to authenticate data without encrypting any of it. Alternatively,<br />

you can consider using a standalone message authentication code (MAC).<br />

This chapter focuses on MACs, and it also covers two types of one-way hash functions:<br />

cryptographic hash functions and “universal” hash functions. Cryptographic<br />

hash functions are used in public key cryptography and are a popular component to<br />

use in a MAC (you can also use block ciphers), but universal hash functions turn out<br />

to be a much better foundation for a secure MAC.<br />

Many of the recipes in this chapter are too low-level for general-purpose<br />

use. We recommend that you first try to find what you need in<br />

Chapter 9; the recipes there are more generally applicable. If you do<br />

use these recipes, please be careful, read all our warnings, and consider<br />

using the higher-level constructs we suggest.<br />

6.1 Understanding the Basics of Hashes and<br />

MACs<br />

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

You would like to understand the basic concepts behind hash functions as used in<br />

cryptography and message authentication codes (MACs).<br />

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

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.<br />

249

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

Saved successfully!

Ooh no, something went wrong!