4
Message Digests File digest Constitution of the United States of America (In Convention, September 17, 1787) Preamble We the people of the United States, in order to form a more perfect union, establish justice, insure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessing of liberty to ourselves and our posterity, do ordain and establish the Constitution of the United States of America. Article I. Section 1. All legislative powers herein granted shall be vested in a Congress of the United States, which shall consist of a Senate and a House of Representatives.... bab1c005bad1ac7d58d54d0e5d0e5f3f MD5 ff3881c932e7591e674e2d9d772817746e8 d983f SHA-1

6
Digest = f (Input) Digest cannot be predicted from the input Hard or impossible to find two inputs with the same digest. Changing one bit of input changes ~50% of the output bits. Properties of a good Message Digest

15
We the people citizens of the US United States, in order to form make a more perfect union, establish justice, insure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessing of liberty to ourselves and our posterity children, do ordain and establish the Constitution of the United States of America. 4 choices = 2 4 different SHA-1 codes. Still a long way from 2 160 --- or even from 2 128 Real problem is finding the match --- 2 80 vs 2 128 Documents with Tunable Digests

24
Storing Passwords Instead of storing the password, store the hash of the password. “Cracking” the password requires hashing every password entry to see if it matches the hash. Unix originally used a DES-based hash, now it uses an MD5 hash gigawalt:fURfuu4.4hY0U:129:129:Walter Belgers:/home/gigawalt:/bin/csh root:$1$zlC9.Vfl$9rXSaQqe1HWDaNNOSTJzh.:0:0::0:0:Nitroba &:/root:/bin/tcsh

41
void MD5_Init(MD5_CTX *c); void SHA1_Init(SHA_CTX *c); A context is used for a process that needs to be repeated over many blocks of data Stream cipher Encryption of many blocks Calculation of a message digest Similar to instance variables in object oriented programming.