Module 7 : Factorization

Lecture 4 : Quadratic-Sieve Factoring

 

SHA hash functions

The SHA hash functions are five cryptographic hash functions designed by the National Security Agency (NSA) and published by the NIST as a U.S. Federal Information Processing Standard . SHA stands for Secure Hash Algorithm.

The five algorithms are denoted SHA-1 , SHA-224 , SHA-256 , SHA-384 , and SHA-512 . The latter four variants are sometimes collectively referred to as SHA-2 . SHA-1 produces a message digest that is 160 bits long; the number in the other four algorithms' names denote the bit length of the digest they produce.

SHA-1 is employed in several widely used security applications and protocols, including TLS and SSL , PGP , SSH , S/MIME , and IPsec . It was considered to be the successor to MD5 , an earlier, widely-used hash function.

SHA-1 algorithm

Initialize variables:
h0 := 0x67452301
h1 := 0xEFCDAB89
h2 := 0x98BADCFE
h3 := 0x10325476
h4 := 0xC3D2E1F0  

Pre-processing:

append the bit '1' to the message
append k bits '0', where k is the minimum number >= 0 such that the resulting message
................length (in bits ) is congruent to 448 (mod 512)
append length of message (before pre-processing), in bits , as 64-bit big-endian integer

Process the message in successive 512-bit chunks:
break message into 512-bit chunks
for each chunk
............break chunk into sixteen 32-bit big-endian words w[i], 0 ≤ i ≤ 15  
Extend the sixteen 32-bit words into eighty 32-bit words:

for
i from 16 to 79
...........w[i] := (w[i-3] xor w[i-8] xor w[i-14] xor w[i-16]) leftrotate 1  

Initialize hash value for this chunk:

a := h0
b := h1
c := h2
d := h3
e := h4