Summary
Highlights
The video introduces the Secure Hash Algorithm (SHA) as a cryptographic algorithm used for security in network security. It explains that SHA produces a 160-bit hash value, also known as a message digest, distinguishing it from MD5, which generates a 128-bit hash value. The creator emphasizes that SHA is a modified version of the MD5 algorithm, with about 90% similarity in its processing.
The video outlines the five working steps of SHA. The first three steps are common with MD5. Step 1 is 'Padding,' where extra bits are added to the original message to meet specific length requirements. For example, if the original message is 1000 bits, padding is calculated to make it divisible by 512, aiming for the total length to be less than 64. Step 2 is 'Appending,' which involves adding the length of the original message bits to the padded message, using a formula like 512*n - 64.
Step 3 involves dividing the input message into 512-bit blocks. Unlike MD5 which uses four variables (A, B, C, D) for its 128-bit output, SHA uses five variables (A, B, C, D, E) for its 160-bit output. These variables are referred to as chaining variables in Step 4. Step 5 involves copying corresponding variables, for example, A=A, B=B, and so on.
The process then moves to 'Round Word Computation.' Each 512-bit block is further divided into 16 sub-blocks, with each sub-block containing 32 bits. There are four main rounds of computation (0-19, 20-39, 40-59, 60-79), each composed of 20 steps, making a total of 80 steps. Each round involves different logical functions and operations on the five variables. After these 80 rounds, the resulting values from A, B, C, D, E are added to the original hash value in a 'Final Round Addition.' Finally, multiprocessing (MPX) combines the results from the final round addition to form the ultimate message digest. This message digest is then fed back for round initialization, completing the process for the next block.