m |
m |
||
Line 39: | Line 39: | ||
So total length is '''512''' in this example | So total length is '''512''' in this example | ||
− | 010010000110010101101100011011000110111110………0101000 | + | '''010010000110010101101100011011000110111110………0101000''' |
====Step 3==== | ====Step 3==== |
Revision as of 23:22, 28 November 2022
Hey Today we are talking about code anoymization. Let's Define an equation: $ Y=x^2 $
SHA-1 Walkthrough
Step 1:
Initialize 5 Random strings
H1 = 0x67452301
H2 = 0xEFCDAB89
H3 = 0x98BADCFE
H4 = 0x10325476
H5 = 0xC3D2E1F0
Step 2:
Take the word you want to hash (in binary), and append a 1 to the end of it. Then append as many zeros as it takes to make it divisible by 512, with the length of the message in a 64 bit integer appended at the end of the string.
Example:
The word "Hello" in binary is:
01001000 01100101 01101100 01101100 01101111 (H) (e) (l) (l) (o)
Add 1 to the end:
= 01001000011001010110110001101100011011111
Since "Hello" is less than 448 we add 0’s until the string is 448 bits long:
= 01001000011001010110110001101100011011111000…0 (len = 448 bits)
Lastly take the length of the string before processing (40 bits in this case) append that as a 64 bit integer
= ...0000101000 (length of added bits = 64)
So total length is 512 in this example
010010000110010101101100011011000110111110………0101000