5 Cryptographic Hashes

5.1 Introduction

A hash function inputs an arbitrary-sized bitstring and outputs a fixed-size bitstring, ideally so that all output values are equally likely. A cryptographic hash (also known as a message digest) has some extra security properties:

  • preimage resistance: It should be computationally infeasible to find a message that has a given pre-specified hash.

  • collision resistance: It should be computationally infeasible to find two messages that have the same hash.

  • second preimage resistance: It should be computationally infeasible to find a second message that has the same hash as a given message.

The term message digest was originally more popular, but hash is more commonly used today. As evidence that the world ...

Get Network Security: Private Communications in a Public World, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.