SHA (Secure Hash Algorithm)
• SHA-1 is a cryptographic algorithm that takes
an input and produces a 160-bit (20-byte) hash
value. This hash value is known as a message
digest.
• Data and certificates are hashed using SHA, a
modified version of MD5.
• it can be used to verify the integrity of data. If
the hash values match, this suggests that the
input data has not been altered.
[Link] (M):
The original input message that needs
to be hashed.
[Link] Padding:
The initial step where the message is
padded to ensure its length is
congruent to 448 modulo 512.
This step prepares the message for
processing in 512-bit blocks.
[Link] Word Computation:
After padding, the message is divided into blocks
of 512 bits, and each block is further divided
into 16 words of 32 bits. These words are then
expanded into 80 32-bit words, which are used
in the subsequent rounds.
[Link] Initialize (A, B, C, D, and E):
Initialization of five working variables (A, B, C, D,
and E) with specific constant values. These
variables are used to compute the hash value
iteratively.
5. Round Constants (KtK_tKt):
SHA-1 uses four constant values, each
applied in a specific range of rounds:
K1K_1K1 for rounds 0-19
K2K_2K2 for rounds 20-39
K3K_3K3 for rounds 40-59
K4K_4K4 for rounds 60-79
6. Rounds (0-79):
The main computation loop of SHA-1, divided into four
stages (each corresponding to one of the constants
K1K_1K1 to K4K_4K4). In each round, a combination of
logical functions and operations is performed on the
working variables (A, B, C, D, and E) using the words
generated in the previous step.
7. Final Round Addition:
After all 80 rounds, the resulting values of A, B, C, D,
and E are added to the original hash values to produce
the final hash.
[Link] (Multiplexing):
Combines the results from the final round addition to
form the final message digest.