ByUdhayyaGethan.M311511205309
SECURE HASHING TECHNIQUES
SECURE HASHING
• What ?
• Why ?
• How ?
What is Hashing
• A hash function is any algorithm that maps data of variable length of data to a fixed length.
• The values returned by the hash functions are called as hash codes, hash sums, message digest or simply hashes.
• Hashing mostly takes a string as an input and gives the output or the hashed values as a numerical value mostly as an hexadecimal number.
What is so special about Secure Hashing
• Hash values produced by some hash techniques can be re hashed.
• That means we can get the original data from the hash values.
• But hash values of secure hash techniques cant be re-hashed.
• That’s why it is called as one way hashing.
Message Digest Functions:
• Checksums fingerprint of a message• If message changes, checksum will not match
• Most checksums are good in detecting accidental changes made to a message• They are not designed to prevent an adversary
from intentionally changing a message resulting a message with the same checksum
• Message digests are designed to protect against this possibility
One-Way Hash Functions:
Example• M = “Elvis”• H(M) = (“E” + “L” + “V” + “I” + “S”) mod 26• H(M) = (5 + 12 + 22 + 9 + 19) mod 26• H(M) = 67 mod 26• H(M) = 15
Collision:
Example• x = “Viva”• Y = “Vegas”• H(x) = H(y) = 2
Criteria's for a hash function:• Given M, • it is easy to compute h
• Given any h, • it is hard to find any M such that H(M) = h
• Given M1, it is difficult to find M2 • such that H(M1) = H(M2)
• Functions that satisfy these criteria are called message digest • They produce a fixed-length digest (fingerprint)
Secure Hashing Algorithm (SHA) :
• SHA-0 1993• SHA-1 1995• SHA-2 2002• SHA-224, SHA-256, SHA-384, SHA-512
SHA-1
A message composed of b bits
160-bit message digest
9
Steps for hashing:• Padding• Dividing • Computing• Initialize• Looping
Example for Padding:
Example :• M = 01100010 11001010 1001 (20 bits)
• Padding is done by appending to the input– A single bit, 1– 427 0s– A 64-bit integer representing 20
• Pad(M) = 01100010 11001010 10011000 … 00010100
Example :• Length of M = 500 bits
• Padding is done by appending to the input:– A single bit, 1– 459 0s– A 64-bit integer representing 500
• Length of Pad(M) = 1024 bits
Comparison:
Output size
(bits)
Internal state size
(bits)
Block size
(bits)
Max message size (bits)
Word size
(bits)Rounds Operations Collisions
found
SHA-0 160 160 512 264 − 1 32 80 +, and, or, xor, rot Yes
SHA-1 160 160 512 264 − 1 32 80 +, and, or, xor, rot
None (252 attack)
SHA-2
256/224 256 512 264 − 1 32 64 +, and, or, xor, shr, rot None
512/384 512 1024 2128 − 1 64 80 +, and, or, xor, shr, rot None
Some facts you must know:• Sha-512 is illegal to use in some countries.• Because it is tough even to the government to
crack a 512 bit encryption.• Sha-0 and Sha-1 are very much prone to
collision of data's.• Md5 hashing technique is no longer secure.• Md5 has been compromised.• It has a hash table about the size of 64Gb.
Applications of Secure Hashing:• Online Banking• Online Shopping• E-Learning• Web servers• ………
In short, wherever sensitive data's are handled and wherever you need to log yourself in to access data secure hashing is used there.
Thank you