Hashing Algorithms

1. MD5 (Message-Digest algorithm 5): is a widely used cryptographic function with a 128-bit hash value. MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of files.An MD5 hash is typically expressed as a 32-digit hexadecimal number. 1.1 ALGORITHM:-MD5 processes a variable-length message into a fixed-length output of 128 bits. 1.2 STEPS: 1.The input message is broken up into chunks of 512-bit blocks (sixteen 32-bit little endian integers),the message is padded so that its length is divisible by 512. 2.The padding works as follows: first a single bit, 1, is appended to the end of the message. 3.This is followed by as many zeros as are required to bring the length of the message up to 64 bits fewer than a multiple of 512. 4.The remaining bits are filled up with a 64-bit integer representing the length of the original message, in bits. 5.The MD5 algorithm uses 4 state variables, each of which is a 32 bit integer (an unsigned long on most systems). These variables are sliced and diced and are (eventually) the message digest. The variables are initialized as follows: A = 0x67452301 B = 0xEFCDAB89 C = 0x98BADCFE D = 0x10325476. 6. Now on to the actual meat of the algorithm: the main part of the algorithm uses four functions to thoroughly goober the above state variables. Those functions are as follows: 7. These functions, using the state variables and the message as input, are used to transform the state variables from their initial state into what will become the message digest. For each 512 bits of the message, the rounds performed (this is only pseudo-code, don't try to compile it) After this step, the message digest is stored in the state variables (A, B, C, and D). To get it into the hexadecimal form you are used to seeing, output the hex values of each the state variables, least significant byte first. For example, if after the digest: A = 0x01234567; B = 0x89ABCDEF;