Cns Unit III
Cns Unit III
Cns Unit III
Hash functions are extremely useful and appear in almost all information security
applications.
A hash function is a mathematical function that converts a numerical input value into
another compressed numerical value. The input to the hash function is of arbitrary length
but output is always of fixed length.
Values returned by a hash function are called message digest or simply hash values or
hash code
Features of Hash Functions:
2. Message encryption: The cipher text of the entire message serves as its
authenticator
3. Message authentication code (MAC): A function of the message and a secret key
that produces a fixed-length value that serves as the authenticator.
1. Hash function:
2. Message encryption:
SYMMETRIC ENCRYPTION:
PUBLIC-KEY ENCRYPTION:
The above fig (b) represents confidentiality using public key encryption
The above fig (c) represents authentication and signature using public key encryption
The above fig (d) represents confidentiality, authentication and signature using public
key encryption.
3. Message Authentication Code:
Where
M= input message
C = MAC function
K= shared secret key
MAC = message authentication code.
The message plus MAC are transmitted to the intended recipient. The recipient
performs the same calculation on the received message, using the same secret key,
to generate a new MAC. The received MAC is compared to the calculated MAC
(Figure 12.4a). If we assume that only the receiver and the sender know the identity
of the secret key, and if the received MAC matches the calculated MAC, then
1. The receiver is assured that the message has not been altered.
2. The receiver is assured that the message is from the alleged sender
3. If the message includes a sequence number (such as is used with HDLC, X.25,
and TCP), then the receiver can be assured of the proper sequence.
SECURE HASH ALGORITHMS:
SHA is the acronym for Secure Hash Algorithm, used for hashing data and certificate
files.
SHA-512:
SHA-512 Overview
SHA-512 Compression
Function
heartof the algorithm
processing message in 1024-bit blocks
consists of 80 rounds
updating a 512-bit buffer
using a 64-bit value Wt derived from the
current message block
and a round constant based on cube root of
first 80 prime numbers
Message Authentication Code (MAC):
A Message Authentication Code (MAC) is an algorithm that requires the use of a secret key.
A MAC takes a variable-length message and a secret key as input and produces an
authentication code.
A recipient in possession of the secret key can generate an authentication code to verify the
integrity of the message
One means of forming a MAC is to combine a cryptographic hash function in some fashion
with a secret key
The National Institute of Standards and Technology (NIST) has published Federal
Information Processing Standard FIPS 186, known as the Digital Signature Standard
(DSS). The DSS makes use of the Secure Hash Algorithm (SHA) and presents a
new digital signature technique, the Digital Signature Algorithm (DSA).
The DSS uses an algorithm that is designed to provide only the digital signature
function. Unlike RSA, it cannot be used for encryption or key exchange.
Nevertheless, it is a public-key technique
Figure 13.3 contrasts the DSS approach for generating digital signatures to that used
with RSA.
In the RSA approach, the message to be signed is input to a hash function that
produces a secure hash code of fixed length. This hash code is then encrypted using
the sender’s private key to form the signature. Both the message and the signature
are then transmitted. The recipient takes the message and produces a hash code.
The recipient also decrypts the signature using the sender’s public key. If the
calculated hash code matches the decrypted signature, the signature is accepted as
valid. Because only the sender knows the private key, only the sender could have
produced a valid signature.
The DSS approach also makes use of a hash function. The hash code is provided
as input to a signature function along with a random number generated for this
particular signature. The signature function also depends on the sender’s private key
and a set of parameters known to a group of communicating principals. We can
consider this set to constitute a global public key .1 The result is a signature
consisting of two components, labelled s and r .
At the receiving end, the hash code of the incoming message is generated. This plus the
signature is input to a verification function. The verification function also depends on the
global public key as well as the sender’s public key , which is paired with the sender’s private
key. The output of the verification function is a value that is equal to the signature
component if the signature is valid. The signature function is such that only the sender, with
knowledge of the private key, could have produced the valid signature.
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner