tailieunhanh - Lecture notes on Computer and network security: Lecture 15 - Avinash Kak

Lecture 15, hashing for message authentication. The goals of this chapter are: What is a hash function? Different ways to use hashing for message authentication, the one-way and collision-resistance properties of secure hash functions, the birthday paradox and the birthday attack, structure of cryptographically secure hash functions,. | Lecture 15: Hashing for Message Authentication Lecture Notes on “Computer and Network Security” by Avi Kak (kak@) April 12, 2016 9:04pm c 2016 Avinash Kak, Purdue University Goals: • What is a hash function? • Different ways to use hashing for message authentication • The one-way and collision-resistance properties of secure hash functions • The birthday paradox and the birthday attack • Structure of cryptographically secure hash functions • SHA Series of Hash Functions • Compact Python and Perl implementations for SHA-1 using BitVector • Message Authentication Codes CONTENTS Section Title Page What is a Hash Function? 3 Different Ways to Use Hashing for Message Authentication 6 When is a Hash Function Secure? 11 Simple Hash Functions 13 What Does Probability Theory Have to Say About a Randomly Produced Message Having a Particular Hash Value 17 What is the Probability That There Exist At Least Two Messages With the Same Hashcode? 21 The Birthday Attack 29 Structure of Cryptographically Secure Hash Functions 33 The SHA Family of Hash Functions 36 The SHA-512 Secure Hash Algorithm 39 Compact Python and Perl Implementations for SHA-1 Using BitVector 48 Hash Functions for Computing Message Authentication Codes 58 Hash Functions for Efficient Storage of Associative Arrays 64 Homework Problems 71 Computer and Network Security by Avi Kak Lecture 15 : WHAT IS A HASH FUNCTION? • In the context of message authentication, a hash function takes a variable sized input message and produces a fixed-sized output. The output is usually referred to as the hashcode or the hash value or the message digest. [Hash functions are also extremely important for creating efficient storage structures for associative arrays in the memory of a computer. (As to what is meant by an “associative array”, think of a telephone directory that consists of pairs.)