CSSE/MA479: Cryptography
Homework 8, due on the date listed on the schedule page
- Work on your term project
- (80 pts) SHA-1 Implementation. Implement and test the SHA-1 algorithm.
- Input: a file called sha_input.txt that contains a message all on a
single line. The
message will be composed of ASCII characters and terminated by a
newline. The newline is not considered part of the message to be
hashed. Thus, you may not assume that the message is a specific
length, but you may assume that the length of the input string is a multiple of 8 bits.
- Output: a 160-bit digest, expressed in
hexadecimal (length 40).
- Grading: totally on correctness
and style. You will earn full points for efficiency
unless you can't manage to pull off the 80
iterations in 5 seconds (you'd have to purpose to
write inefficient code to make that happen, I
think).
- Round keys: 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6
- H0-H4: 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0
- Debugging: the tool at
http://people.eku.edu/styere/Encrypt/JS-SHA1.html gives answers
and intermediate output!