Rku PPT-5
Rku PPT-5
Authentication
Requirement
Functions
Message Authentication code
Hash Functions
Security of Hash Functions and Macs
MD5 Message Digest Algorithm
Secure Hash Algorithm
Message Authentication
The process of identifying an individual, usually based on a username and password.
In security systems, authentication is distinct from authorization , which is the process of
giving individuals access to system objects based on their identity.
Authentication merely ensures that the individual is who he or she claims to be, but says
nothing about the access rights of the individual.
Message Authentication is a mechanism to verify the integrity of message
6. Timing modification
7. Source repudiation Requires Digital
8. Destination repudiation Signature
Authentication Functions
Two level of Functionality with Digital signature and Message Authentication
o Produce an Authenticator
o Authenticator is a value to be used to authenticate a message
o Authentication Protocol at Receiver
Types of Functions
To produce authenticator three Classes are used
• Message Encryption
• Cipher text act as an authenticator
• Hash Function
• It maps a message of any length into fixed length hash value which will be used as
authenticator
Message Encryption
The cipher text of entire message is to be used to authenticate a message
Source Destination
CT
M E D M
E(K,M)
K K
Public Key Encryption
Provide Confidentiality not Authentication
Source Destination
CT
M E D M
E(PUb,M)
PUb PRb
Public Key Encryption
With Authentication and Confidentiality
C C C
M E E T D D M
T T
E(PRa,M) E(PUb,E(PRa,M))
E(PRa,M)
MAC = C ( K , M )
In cryptography, a message authentication code (MAC), sometimes known as a tag, is a
short piece of information used to authenticate a message—in other words, to confirm
that the message came from the stated sender (its authenticity) and has not been
changed.
The MAC value protects both a message's data integrity as well as its authenticity, by
allowing verifiers (who also possess the secret key) to detect any changes to the message
content. Essentially, a MAC is an encrypted checksum generated on the underlying
message that is sent along with a message to ensure message authentication.
Let us now try to understand the entire process in detail −
The sender uses some publicly known MAC algorithm, inputs the message and the secret
key K and produces a MAC value.
Similar to hash, MAC function also compresses an arbitrary long input into a fixed length
output. The major difference between hash and MAC is that MAC uses secret key during
the compression.
The sender forwards the message along with the MAC. Here, we assume that the message
is sent in the clear, as we are concerned of providing message origin authentication, not
confidentiality. If confidentiality is required then the message needs encryption.
On receipt of the message and the MAC, the receiver feeds the received message and the
shared secret key K into the MAC algorithm and re-computes the MAC value.
The receiver now checks equality of freshly computed MAC with the MAC received from
the sender. If they match, then the receiver accepts the message and assures himself that
the message has been sent by the intended sender.
If the computed MAC does not match the MAC sent by the sender, the receiver cannot
determine whether it is the message that has been altered or it is the origin that has been
falsified. As a bottom-line, a receiver safely assumes that the message is not the genuine.
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).
A “good” hash function has the property that
the results of applying a change to any bit or
bits in M results, with high probability, in a
change to the hash code.
A hash function is any function that can be
used to map data of arbitrary size to fixed-size
values.
The values returned by a hash function are
called hash values, hash codes, digests, or
simply hashes.
A hash function takes as input a key, which is associated with a record and used to identify it to
the data storage and retrieval application. The keys may be fixed length, like an integer, or variable
length, like a name.
A cryptographic hash function (CHF) is a hash function that is suitable for use in cryptography.
It is a mathematical algorithm that maps data of arbitrary size (often called the "message") to a bit
string of a fixed size (the "hash value", "hash", or "message digest") and is a one-way function, that
is, a function which is practically infeasible to invert.
Ideally, the only way to find a message that produces a given hash is to attempt a brute-force
search of possible inputs to see if they produce a match
h = H(M)
M is a variable-length message, h is a fixed-length hash value, H is a hash function
The hash value is appended at the source
The receiver authenticates the message by recomposing the hash value
Because the hash function itself is not considered to be secret, some means is required to
protect the hash value
The ideal cryptographic hash function has the following main properties:
• it is deterministic, meaning that the same message always results in the same hash
• it is quick to compute the hash value for any given message
• it is infeasible to generate a message that yields a given hash value
• it is infeasible to find two different messages with the same hash value
• a small change to a message should change the hash value so extensively that the new
hash value appears uncorrelated with the old hash value (avalanche effect)
Input-Output behaviour of hash functions
Message Message
digest
Alice was beginning to get very tired of
sitting by her sister on the bank, and have H DFDC349A
nothing to do.
H E D
E(K, H(M))
S ll H
H(M || S)
It is possible to use a hash function but no encryption for message
authentication.
A and B 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 recompute the hash value to verify the message.
An opponent cannot modify an intercepted message.
Message authentication method - 4
Source A Destination B
ll H
E D M S
M ll
Compare
ll H K K
S
H(M || S)
E (K, [ M || H(M || S)])
Where,
= ith bit of the hash code 1 ≤ i ≤ n
m = number of n-bit blocks in the input
= ith bit in jth block
Security of Hash functions
Brute-force attacks
• Strength of hash function against brute force attacks is 2n/2
Cryptanalysis
• It forces on the internal structure of F
• Base on attempts to find efficient techniques for producing collisions for single
execution of
Message Digests(Hash)
● A message digest is a fingerprint or the summary of a message. (Same as LRC and CRC)
● It is used to verify integrity of the data (To ensure that message has not been tampered).
● Multiply each digit in the number with the next digit (excluding if it is 0) and disregarding the first
● Multiply 7 by 3 - 2
● Discard first digit - 1
● Multiply 1 by 9 - 1
● Multiply 9 by 1 - 9
● Multiply 9 by 7 - 9
● Discard first digit - 6
3
● Multiply 3 by 4 -
3
● Discard first digit -
1
● Multiply 2 by 3 -
2
● Message digest is
2
6
6
MD5 (Message Digest 5)
● MD5 is a message digest algorithm developed by Ron Rivest.
● MD5 algorithm can be used as a digital signature mechanism.
● The MD5 hashing algorithm is a one-way cryptographic function that accepts a message of
any length as input and returns as output a fixed-length digest value to be used for
authenticating the original message.
Description of the MD5 Algorithm
● Takes as input a message of arbitrary length and produces as output a 128 bit “fingerprint” or “message
● Intended where a large file must be “compressed” in a secure manner before being encrypted with a
Step-1 Padding
● The aim of this step is make length of the original message equal to a value, which is 64 bits less than
● The padding consists of a single “1” bit is appended to the message, and then “0” bits.
Step 2 – append length:
● A 64 bit representation of b is appended to the result of the previous step.
● The resulting message has a length that is an exact multiple of 512 bits
Step-3 Divide the input into 512-bit blocks
512
bits
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
bits 5.3 – Process each block with A, B, C,
bits bits bits bits bits bits bits bits bits bits bits bits bits bits bits
D.
5.3 - Process each block with A, B, C, D.
SHA - Secure Hash Algorithm
SHA - 1 SHA - 224 SHA - 256 SHA - 384 SHA - 512
Message
Digest Size 160 224 256 384 512
Message Size < 264 < 264 < 264 < 2128 < 2128
Block Size 512 512 512 1024 1024
Word Size 32 32 32 64 64
Number of
Steps 80 64 64 80 80
SHA - 512
The algorithm takes input as a message with a maximum length of less than 2128 bits and
produces output as a 512-bit message digest.
The input is processed in 1024-bit blocks.
Message Digest Generation using SHA - 512
F F F
+ + +
Message
schedule
a b c d e f g e 64
W0 K0
Round 0
a b c d e f g e 64
W79 K79
Round 79
+ + + + + + + +
Hi
SHA - 512 Processing of a Single 1024-Bit Block
Each round takes as input the 512-bit buffer value, abcdefgh, and updates the contents of
the buffer.
At input to the first round, the buffer has the value of the intermediate hash value, Hi-1.
Each round t makes use of a 64-bit value Wt, derived from the current 1024-bit block
being processed.
The output of the eightieth round is added to the input to the first round (Hi-1) to produce
Hi.
Step – 5 Output
After all Nth block of 1024-bit have been processed, the output from the Nth stage is the
512-bit message digest.
SHA - 512 Round Function
SHA - 512 Round Function – Cont…
a b c d e f g h
Ch +
Ʃ Maj
+ Ʃ +
+ +
+ Wt
+ Kt
a b c d e f g h
(∑ )
512
𝑇 1=h+ Ch ( 𝑒 , 𝑓 , 𝑔 ) + 𝑒 + 𝑊 𝑡+ 𝐾𝑡
1
(∑ )
512
𝑇 2= 𝑎 + Maj ( 𝑎 , 𝑏 ,𝑐 )
0
SHA - 512 Round Function Elements
Maj(a,b,c) = (a AND b) XOR (b AND c) XOR (a AND c) Majority of arguments are true.
Conditional function = (e AND f) XOR (NOT e and g)
∑(a) = ROTR(a,28) XOR ROTR(a,34) XOR ROTR(a,39)
∑(e) = ROTR(e,14) XOR ROTR(e,18) XOR ROTR(e,41)
+ = addition modulo 264
Kt = a 64-bit additive constant.
Wt = a 64-bit word derived from plaintext.
ROTR = Circular right shift rotataion