Pre-processing Sha256 Python Implementation
I am working my way through the SHA256 implementation on wikipedia but have came up stuck. I have just tried to write the code for the message pre-processing and my length for the
Solution 1:
There are two problems:
1) The 488 magic number in your code should be 448.
2) You're only using 16 "bits" (characters) in append_length_of_message().
HIH!
Solution 2:
If you are considering hex
as a variable, then
hex = format(len(input_string),'x')
should be updated to
hex = format(len(input_string),'b')
to get the correct result.
By doing this the result will become with respect to SHA.
Post a Comment for "Pre-processing Sha256 Python Implementation"