Lecture#08: Cryptographic Hash Functions-SHA-I
Lecture#08: Cryptographic Hash Functions-SHA-I
Lecture#08
Cryptographic Hash Functions- SHA-I
Course: Cryptography & Network Security (CE-408)
Course Teacher: Ms. Rukaiya
Contact Info:
Email: rukaiya@ssuet.edu.pk
1
Hash Function
• The hash value represents
concisely the longer message
may called the message digest
• A message digest is as a ``digital
fingerprint'' of the original
document
2
Chewing Function
3
Hashing V.S. Encryption
Hello, world. k NhbXBsZSBzZW50ZW5jZS
A sample sentence to E B0byBzaG93IEVuY3J5cHR
show encryption. pb24KsZSBzZ
Hello, world. k
NhbXBsZSBzZW50ZW5jZS
A sample sentence to D
B0byBzaG93IEVuY3J5cHR
show encryption. pb24KsZSBzZ
Store Hashing Password Verification an input password against the stored hash
Iam#4VKU Iam#4VKU
Password
store
h h
Hash Matching
Exactly?
Password Yes No
store Deny
Grant
Secure Hash Algorithm
• SHA originally designed by NIST & NSA in 1993
• was revised in 1995 as SHA-1
• US standard for use with DSA signature scheme
standard is FIPS 180-1 1995, also Internet
RFC3174
nb. the algorithm is SHA, the standard is SHS
• based on design of MD5 with key differences
• produces 160-bit hash values
• recent 2005 results on security of SHA-1 have
raised concerns on its use in future applications
How SHA Works?
• Digest Length=160 bit
• No. Of Rounds=4
ATest
Note: spaces are counted as characters
A - T e s t
448 – 48 =400
• Add ‘1’ at the end of message leading with 399 zeros
01000001 00100000 01010100 01100101 01110011 01110100 10000000
00000000 00000000 ………..
K1 = 5A 82 79 99
K 2 = 6E D9 EB A1
K 3 = 8F 1B BC DC
K 4 = CA 62 CI D6
SHA-I
Step #05: Break the message into chunks
W[0] = 01000001001000000101010001100101
W[1] = 01110011011101001000000000000000
W[2] =
……
W[15] = ---------------
4 rounds * 20 steps