Final Hash Function
Final Hash Function
HASH FUNCTION
• A hash function H accepts a variable-length block of data M as
input and produces a fixed-size hash value h = H(M).
provides the structure or redundancy required to achieve authentication. Encryption is applied to the
b) Only the hash code is encrypted, using symmetric encryption. This reduces the processing burden for
c) It is possible to use a hash function but no encryption for message authentication. The technique
assumes that the two communicating parties share a common secret value S. A computes the hash
value over the concatenation of M and S and appends the resulting hash value to M.
Because B possesses S, it can recomputed the hash value to verify. Because the secret value itself is not
sent, an opponent cannot modify an intercepted message and cannot generate a false message.
d) Confidentiality can be added to the approach of method (c) by encrypting the entire message plus the
hash code.
Reasons for not interest to encryption of message
a)Encryption software is relatively slow.
b)Encryption hardware costs are not negligible.
c)Encryption hardware is optimized toward large data sizes.
d)Encryption algorithms may be covered by patents, and there is a cost
associated with licensing their use.
MESSAGE AUTHENTICATION:
The message authentication is achieved using a message authentication code (MAC), also
known as a keyed hash function.
• Typically, MACs are used between two parties that share a secret key to authenticate
information exchanged between those parties.
• A MAC function takes as input a secret key and a data block and produces a hash value,
referred to as the MAC, which is associated with the protected message.
• If the integrity of the message needs to be checked, the MAC function can be applied to
the message and the result compared with the associated MAC value.
• An attacker who alters the message will be unable to alter the associated MAC value
without knowledge of the secret key.
• Note that the verifying party also knows who the sending party is because no one else
knows the secret key.
• In practice, specific MAC algorithms are designed that are generally more efficient than an
encryption algorithm.
Digital Signatures :
• In the case of the digital signature, the hash value of a message is encrypted with a
user’s private key.
• Anyone who knows the user’s public key can verify the integrity of the message that is
associated with the digital signature.
• In this case, an attacker who wishes to alter the message would need to know the user’s
private key.
1. The hash code is encrypted, using public-key encryption with the
sender’s private key. It also provides a digital signature, because only
the sender could have produced the encrypted hash code. In fact, this is
the essence of the digital signature technique.
• The actual password is not retrievable by a hacker who gains access to the
password file.
• In simple terms, when a user enters a password, the hash of that password
is compared to the stored hash value for verification.
• Hash functions can be used for intrusion detection and virus detection.
TWO SIMPLE HASH FUNCTIONS
• It Simply prepare the desired alternate message and then append an n-bit block
that forces the new message plus block to yield the desired hash code.
• Although a simple XOR or rotated XOR (RXOR) is insufficient if only the hash code is
encrypted, you may still feel that such a simple function could be useful when the
message together with the hash code is encrypted .
Attacks
1) Brute-force attacks
2) Cryptanalysis.
3) Collision resistant attacks
4) Pre image and second preimage attacks
5) Collision resistant attacks
SECURE HASH ALGORITHM(SHA)
• The SHA-1 is a cryptographic computer security algorithm.
• It was created by the US National Security Agency in 1995,
• Some of the protocols that use SHA-1 include:
• Transport Layer Security (TLS)
• Secure Sockets Layer (SSL)
• Pretty Good Privacy (PGP)
• Secure Shell (SSH)
• Secure/Multipurpose Internet Mail Extensions (S/MIME)
• Internet Protocol Security (IPSec)
DESIGN LOGIC SHA512
• The plain text block size=1024 bits
• No of rounds or steps=80
• In each round it generates QWORD from plain text =64bits
• The input is processed in 1024-bit blocks.
• The algorithm takes as input a message with a maximum length of less than 2128 bits
• It produces as output a 512-bit message digest.
• Each round it uses constant =k
• It uses 8 (i.e. 512/64) buffers to store intermediate results and to store hash code h
• Each buffer size= 64 bits
• Applied procedures like out put of Block1->block2->.........block8->hash_code
• Spet1: Append padding bits means pad the bits 100.. So that length of plain
text is 128 less than multiple and 1024 bits
• Step 2: Append length means 128 bits representation of original plain text
such that length=multiples of1024 bits