Hash function
A Hashfunction (H) accepts a variable-length
block of data M as input and produces a fixed-
size hash value h = H(M).
Security Requirements of the Hash Functions:
• Variable input size
• Fixed output size
• Efficiency,
• Collision resistant
• Pseudo-randomness
3.
Hash function
• A“good” hash function has the property
that the results of applying the function
to a large set of inputs will produce
outputs that are evenly distributed and
apparently random.
• In general terms, the principal object of a
hash function is data integrity.
4.
Cryptographic hash function
ACryptographic hash function is an algorithm for
which it is computationally infeasible to find either
• (a) a data object that maps to a pre-specified hash result (the one-
way property)
• (b) two data objects that map to the same hash result (the
collision-free property).
Because of these characteristics, hash functions are
often used to determine whether or not data has
changed.
5.
Applications of Cryptographichash
function
Message authentication
Digital Signature
One-way password file
Intrusion detection
Virus detection
Pseudorandom number generation
6.
Applications of Cryptographichash
function
Message Authentication
• A mechanism or service used to verify the
integrity of a message.
• It assures that data received are exactly as sent
(i.e., contain no modification, insertion, deletion,
or replay).
• When a hash function is used to provide message
authentication, the hash function value is often
referred to as a message digest.
7.
Applications of Cryptographichash
function
One-way password file
• In which a hash of a password is stored
by an operating system rather than the
password itself.
• When a user enters a password, the
hash of that password is compared to
the stored hash value for verification.
8.
Applications of Cryptographichash
function
Intrusion detection and virus
detection
• Store H(F) for each file on a system and secure
the hash values.
• One can later determine if a file has been
modified by recomputing H(F).
• An intruder would need to change F without
changing H(F).
9.
Popular Hash Functions
•Message Digest (MD)
– MD5 was most popular and widely used hash
function for quite some years.
– The MD family comprises of hash functions MD2,
MD4, MD5 and MD6.
– It is a 128-bit hash function.
– In 2004, collisions were found in MD5 and hence it
is no longer recommended for use.
10.
Popular Hash Functions
•Secure Hash Algorithm (SHA):
– It is the most widely used hash function.
– SHA was developed by NIST and published in
1993.
– It has several versions such as SHA-1, SHA-256,
SHA-512,…..etc.
Digital Signature
• DigitalSignature is a type of electronic signature that
encrypts documents with digital codes that are
particularly difficult to duplicate
• In case of digital signature, the message is encrypted
with the private key and decrypted with the public
key.
• Technically, digital signature is performed by a
signing algorithm and it is verified by a
verification algorithm.
At Sender Side
1.Message digest is generated using a set of Hash
functions.
2. A message digest is encrypted using senders
private key.
3. The resulting encrypted message is known as
digital signature.
4. Digital signature is attached with data or message
and send to receiver.
20.
At Receiver Side
Receiveruses senders public key to decrypt senders digital
signature to obtain message digest send by receiver.
Receiver uses same message digest algorithm, which is
used by sender
Now, receiver will compare these two message digest
If message digest are equal then signature is valid else not.
21.
Advantages
Authentication:
• Identification ofperson sign.
Integrity of data:
• Every change is detected.
Non Repudiation:
• Author has encrypted sign on message.
Speed:
• Contracts are easily written, completed, and signed by all concerned
parties in a little amount of time no matter how far the parties are
geographically.