Reply to comment

Implementation of the Secure Hash Algorithm (SHA) 1

As a bit of fun I implemented the Secure Hash Algorithm (SHA) 1 late last night. It was done using Python3 and accordingly to FIPS 180-1.

Below is shown how to use it:

>>> import sha1
>>> data = sha1.str2bin("All your base are belong to us!")
>>> sha1.digest(data)
'1110101011101101100000101101000101010000110001110110110010000011
 1101011101110100101001110011011101001110011110001100111000000111
 11010001110010001100100010100110'
>>> sha1.hex_digest(data)
'eaed82d150c76c83d774a7374e78ce07d1c8c8a6'

You can download it free from here.

Reply