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
• 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
• Hash values produced by some hash techniques can
be re hashed.
• That means we can get the original data from the
• But hash values of secure hash techniques cant be rehashed.
• 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
One-Way Hash Functions:
• 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
• 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
• They produce a fixed-length digest (fingerprint)
• 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 …
• 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
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:
In short, wherever sensitive data's are
handled and wherever you need to log yourself
in to access data secure hashing is used there.