Homepage About Projects

SHA-1 Alghorithm

Input: null

Output: null


How does it work?

Pre-process:

1. Split Input String into an array of individual characters and convert to ASCII code

[null]

[null]


2. Convert ASCII codes into binary code.

[null]


3. Pad zeros to the front of each code until the codes are 8 bits long.

[null]


4. Join binary codes together and append a '1'

'null'


5. Pad the binary message with zeros until length = 512 mod 448.

'null'


6. Get the Length of the 8-bit ASCII code array from step 3 and convert it to binary.

'null'

'null'


7. Pad with zeros until its 64 characters long

'null'


8. Append to previous binary message from step 5.

'null'



SHA-1 Algorithm:

1. Break the message into an array of 512 character chunks

[null]


2. Break each chunk into a subarray of 16 x 32 'words'

[null]


3. Loop through each chunk and extend it to 80 newly generated 'words' using the subarray

[null]


4. Initialize some variables.

H0 = 0x67452301
H1 = 0xEFCDAB89
H2 = 0x98BADCFE
H3 = 0x10325476
H4 = 0xC3D2E1F0
[a, b, c, d, e] = [H0, H1, H2, H3, H4]


5. For each chunk: bitwise operation and variable reassignment.

H0 = 0x67452301
H1 = 0xEFCDAB89
H2 = 0x98BADCFE
H3 = 0x10325476
H4 = 0xC3D2E1F0

H0 = null
H1 = null
H2 = null
H3 = null
H4 = null

6. Combine main hash values of hashed variables and return.

[null, null, null, null, null]

'null'




Back to top