Hashes%20and%20Message%20Digests

# Hashes%20and%20Message%20Digests - CSC405 Hashes and...

This preview shows pages 1–4. Sign up to view the full content.

CSC405 – Hashes and Message Digest Lecture Notes Hash – a one-way function that takes an input message and produces an output message digest. One way means it is not practical to figure out the input given only the output. If it is computationally infeasible to find a message that has a given message digest, the hash is considered to be cryptographically secure. Hashing functions are used to map long messages (of arbitrary size) to fixed-size message digests ( MD ). MD5 digests are 128 bits SHA-1 digests are 160 bits SHA – secure hashing algorithm Any respectable hashing algorithm will have collision resistance. That is to say, it should be computationally infeasible to find two different inputs that hash to the same result. Good hashing functions will also confuse the form of the message that is hashed. That is, the output will appear random. Two hashes should appear uncorrelated no matter how similar the input messages are. Since messages can be arbitrarily long and a message digest is a fixed length, say 128 bits, obviously there are two messages that digest to the same 128 bit number. Mathematically, for a 1000 bit message hashed to 128 bits, there are on average 2 872 messages that map to a given 128 bit message digest. One would need to try 2 128 messages before finding one that matched a particular message digest. This is the same as saying that

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
if you tried approximately 2^64 messages you would find two with the same hash. So, generalizing, if the message digest has m bits, then it would take only 2^m/2 messages chosen at random before one could find two messages with the same digest value. How hard is it to find two specific messages that have the same hash? This is called the birthday problem. If there are 365 possible birthdays, how many people in a group of size X will have the same birthday? How big would X need to be for the probability to be greater than .5? Consider just Able and Ben. Able could have any one of 365 birthdays (let’s ignore the leap day of February 29 th ) and Ben could have any of 365 birthdays as well. Thus there are: 365 * 365 = 133,225 different possibilities. In how many of these scenarios do Able and Ben have the same birthday? There are 365 such cases, namely they both have January 1 as birthdays or January 2 and so on until December 31. The probability that in a group of two that both people will have the same birthday is then Once Cain joins the group we have 365 * 365 * 365 = 365 3 = 48,627,125 possible birthday scenarios. Out of the over 48 million possibilities, there are: 365 * 364 * 363 = 48,228,180
cases where all three people have different birthdays. The remaining: 48,627,125 - 48,228,180 = 398,945 cases are one where at least two of Able, Ben, and Cain have the same birthday. The solution to the birthday problem in the case of 3 people is then: Note this probability, although small, is roughly 3 times as large as that for the case of 2 people. Again we see a large growth when the size of the group is small. Let’s look at one more case, a group size

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 10/13/2008 for the course CSC 405 taught by Professor Carter during the Spring '08 term at N.C. State.

### Page1 / 21

Hashes%20and%20Message%20Digests - CSC405 Hashes and...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online