Content
➢ Message Authentication Requirements
➢ Message Authentication Functions
➢ Message Authentication Code
➢ Digital Signature
➢ Digital Signature Standard
9/30/2022 1
Prerequisite and Recap
• Prerequisite
– Encryption and Decryption
– Network Security
– Hash Function
• Recap
– Message Authentication codes
– Digital Signature
9/30/2022 2
Objective of Unit -3
• Study about Message Authentication Codes , Authentication
requirements
• To understand authentication functions, message
authentication code
• To understand how hash functions work , security of hash
functions,
• Working of Secure hash algorithm (SHA)
• Learn about Digital Signatures: Digital Signatures, Elgamal
Digital Signature Techniques,
• Working of Digital signature standards (DSS), and proof of
digital signature algorithm
9/30/2022 3
Message Authentication CO3
• message authentication is concerned with:
– protecting the integrity of a message
– validating identity of originator
– non-repudiation of origin (dispute resolution)
• will consider the security requirements then three
alternative functions used:
– message encryption
– message authentication code (MAC)
– hash function
9/30/2022 4
Message Authentication Requirements
• Disclosure
➢ Sequence modification
– Release of message contents to
any person or process not ⚫ Any modification to a
possessing the appropriate sequence of messages
cryptographic key between parties, including
insertion, deletion, and
• Traffic analysis reordering
– Discovery of the pattern of ➢ Timing modification
traffic between parties
⚫ Delay or replay of messages
• Masquerade
➢ Source repudiation
– Insertion of messages into the
network from a fraudulent ⚫ Denial of transmission of
source message by source
• Content modification ➢ Destination repudiation
– Changes to the contents of a ⚫ Denial of receipt of message
message, including insertion, by destination
deletion, transposition, and
modification
Message Security Requirements
• Disclosure- Message Encryption
• traffic analysis- Message Encryption
• Masquerade- Message Authentication
• content modification- Message Authentication
• sequence modification- Message Authentication
• timing modification- Message Authentication
• source repudiation- Digital Signatures
• destination repudiation- Digital Signatures + Message
Authentication
Message Authentication Requirements CO3
• Message authentication is a procedure to verify
that received messages come from the alleged
source an d have not been altered. Message
authentication may also verify sequencing and
timeliness. A digital signature is an authentication
technique that also includes measures to counter
repudiation by the source.
9/30/2022 8
Message Authentication Function CO3
MESSAGE AUTHENTICATION FUNCTIONS:
▪ Any message authentication or digital signature
mechanism has two levels of functionality.
▫ At the lower level, there must be some sort of
function that produces an authenticator: a
value to be used to authenticate a message.
▫ This lower-level function is then used as a
primitive in a higher-level authentication
protocol that enables a receiver to verify the
authenticity of a message.
9/30/2022 9
Message Authentication Function CO3
The types of functions that may be used to
produce an authenticator may be grouped into
three classes.
▪ Hash function:
A fun ction t h at maps a message of any len gth into a
fixed-length hash value, which serves as the
au th enticator
▪ Message encryption:
The ciphertext of the entire message serves as its
au th enticator
▪ Message authentication code (MAC):
A fun ction o f the message a n d a secretkey th at produces
a fixed- length value t h at serves as the auth enticator
9/30/2022 10
Message Authentication Functions
⚫ Hash function
⚫ A function that maps a message of any length into a fixed-length
hash value which serves as the authenticator
⚫ Message encryption
⚫ The ciphertext of the entire message serves as its authenticator
⚫ Message authentication code (MAC)
⚫ A function of the message and a secret key that produces a fixed-
length value that serves as the authenticator
Symmetric Message Encryption
➢ encryption can also provides authentication
➢ if symmetric encryption is used then:
⚫ receiver know sender must have created it
▪ since only sender and receiver know key used
⚫ know content has not been altered if successfully recovered the correct
plaintext
▪ Because attacker does know the key
▪ Problem: how to recognize correct plain text
• if message has suitable structure, redundancy or a checksum to
detect any changes
Public-Key Message Encryption
• if public-key encryption is used:
– encryption provides no confidence of sender
• since anyone potentially knows public-key
– however if
• sender signs message using their private-key
• then encrypts with recipients public key
• have both secrecy and authentication
– again need to recognize corrupted messages
– but at cost of two public-key uses on message
Message Authentication CO3
Message Encryption
• message encryption by itself also provides a measure of
authentication.
• if symmetric encryption is used then:
– receiver know sender must have created it
– since only sender and receiver now key used
– know content cannot of been altered
– if message has suitable structure, redundancy or a
checksum to detect any changes
9/30/2022 14
Message Authentication CO3
Message Authentication Code
9/30/2022 15
Message Authentication Code (MAC)
• generated by an algorithm that creates a small
fixed-sized block
– depending on both message and some key
– like encryption though need not be reversible
• appended to message as a signature
• receiver performs same computation on
message and checks it matches the MAC
• provides assurance that message is unaltered
and comes from sender
Message Authentication CO3
Message and message digest
Notations:
m: message
Note H(m): message digest of m by using hash function H()
The message digest needs to be kept secret, or
unalterable by others.
9/30/2022 17
Message Authentication CO3
Hash Function
A hash function accepts a variable-size message M as
input and reduces a fixedsize output, referred to as a
hash code H(M).
A hash code does not use a key but is a function only of
the input message. The hash code is also referred to as
a message digest or hash value. The hash code is a
function of all the bits of the message and provides an
error-detection.
Note
A change to any bit or bits in the message
results in a change to the hash code.
9/30/2022 18
Message Authentication CO3
Requirements for a Hash Function
1. H can be applied to a block of data of any size.
2. H produces a fixed-length output.
3. H(x) is relatively easy to compute for any given x,
making both hardware and software implementations
practical.
4. For any given value h, it is computationally infeasible
to find x such that H(x) = h. This is sometimes referred to
in the literature as the one-way property.
5. It is computationally infeasible to find any pair (x, y)
such that H(x) = H(y). This is sometimes referred to as
strong collision resistance.
9/30/2022 19
Message Authentication CO3
Simple Hash Functions
A hash function is generally having some set of functions
that compresses the input. It means generally the output
produced is unique for any of the input. This function
takes the input in a random manner and produces the
hash value output of fixed length, commonly 160 bits.
h = H(M)
where M is the variable length message
H is the hash function
h is the fixed length hash value
9/30/2022 20
Message Authentication CO3
MESSAGE AUTHENTICATION CODE
A hash function is generally having some set of functions
that compresses the input. It means generally the output
produced is unique for any of the input. This function
takes the input in a random manner and produces the
hash value output of fixed length, commonly 160 bits.
h = H(M)
where M is the variable length message
H is the hash function
h is the fixed length hash value
9/30/2022 21
Message Authentication CO3
Requirements of MAC
Message authentication is concerned with some
requirements which are as follows. The requirements
mention the data is not altered or modified. The sender
and receiver are authenticated. Truthfulness of the
message is not denied in any circumstance.
➢Protecting the integrity of the message
➢Validating the identity of the originator
➢Non-repudiation of origin
9/30/2022 22
Message Authentication Algorithm CO3
1. Architecture of MD5
➢MD5 message digest algorithm is the 5th version of
the Message Digest Algorithm developed by Ron Rivest
to produce 128 bit message digest.
➢MD5 produces the message digest through five steps
i.e. padding, append length, divide input into 512 bit
blocks, initialize chaining variables a process blocks and
4 rounds, uses different constant it in each iteration.
9/30/2022 23
Message Authentication Algorithm CO3
How do the MD5 Algorithm works?
Step1: Append Padding Bits
Step 2: Append Length
Step 3: Initialize MD buffer
Step 4: Processing message in 16-word block
Step 5: Output
9/30/2022 24
Message Authentication Algorithm CO3
Architecture of MD5
9/30/2022 25
Message Authentication Algorithm CO3
2. Secure Hash Algorithms
➢ Secure Hash Algorithm (SHA) was developed
by NIST along with NSA.
➢ In 1993, SHA was published Information
Processing Standard.
➢ It has following versions-
SHA-0
SHA-1
SHA-2
SHA-3
9/30/2022 26
Message Authentication Algorithm CO3
SHA-1
➢ It works for any input message that is less than 264
bits.
➢ The output of SHA is a message digest of 160 bits in
length.
➢ This is designed to be computationally infeasible to:
a) Obtain the original message , given its message digest.
b) Find two messages producing the same message
digest.
9/30/2022 27
Message Authentication Algorithm CO3
Properties of SHA
A cryptographic hash function must have some
properties to withstand for cryptanalytic attacks and to
be useful for authentication. It is applied to a block of
variable size.
9/30/2022 28
Message Authentication Algorithm CO3
How SHA-1 works?
➢ Step 1: Padding of Bits
➢ Step 2: Append Length
➢ Step 3: Divide the input into 512-bit blocks
9/30/2022 29
Message Authentication Algorithm CO3
How SHA-1 works?
➢ Step 4: Initialize chaining variables
Chaining Variables Hex values
A 01 23 45 67
B 89 AB CD EF
C FE DC BA 98
D 76 54 32 10
E C3 D2 E1 F0
➢ Step 5: Process Blocks- Now the actual algorithm
begins….
9/30/2022 30
Message Authentication Algorithm CO3
How SHA-1 works?
➢ Step 5.1 : Copy chaining variables A-E into variables a-e.
➢ Step 5.2 : Divide current 512-bit block into 16 sub-
blocks of 32-bits.
➢ Step 5.3 : SHA has 4 rounds, each consisting of 20 steps.
Each round takes 3 inputs-
Round Value of t between
➢ 512-bit block, 1 1 and 19
➢ The register abcde 2 20 and 39
3 40 and 59
➢ A constant K[t] (where t= 0 to 79)
4 60 and 79
9/30/2022 31
Message Authentication Algorithm CO3
How SHA-1 works?
➢ Step 5.4 : SHA has a total of 80 iterations (4 rounds X
20-iterations). Each iteration consists of following
operations:-
abcde = ( e +Process P +S5(a) + W[t] + K[t] ), a, S30(b) , c , d
Where, abcde = The register made up of 5 variables a, b, c, d, e.
Process P= The logic operation.
St = circular-left shift of 32-bit sub-block by t bits.
W[t] = A 32-bit derived from the current 32-bit sub-block
K[t]= One of the five additive constants.
9/30/2022 32
Message Authentication Algorithm CO3
Comparison between MD5 and SHA-1
Point of discussion MD5 SHA-1
Message digest length in 128 160
bits
Attack to try and find the Requires 2128 operations to Requires 2160 operations
original message given a break in. to break in, therefore
message digest more secure.
Attack to try and find two Requires 264 operations to Requires 280 operations to
messages producing break in. break in.
same message digest
Speed Faster Slower
Successful attempts so far There have been No such claims so far.
reported attempts to
some extent.
9/30/2022 33
Message Authentication Algorithm CO3
Parameters for various versions of SHA
Parameter SHA-1 SHA-256 SHA-384 SHA-512
Message digest 160 256 384 512
size(in bits)
Message size(in bits) <264 264 2128 2128
Block size (in bits) 512 512 1024 1024
Word size (in bits) 32 32 64 64
Steps in algorithm 80 64 80 80
9/30/2022 34
Digital Signature CO3
• Prerequisite
– Encryption and Decryption
– Message Digest
– Hash Function
• Recap
– Digital Signatures
– DSS
Objective of Topic :- Study about Digital Signature and DSS
9/30/2022 35
Digital Signature CO3
In digital signature process the sender uses a signing
algorithm to sign the message. The message and the
signature are sent to the receiver. The receiver receives the
message and the signature and applies the verifying
algorithm to the combination. If the result is true, the
message is accepted; otherwise, it is rejected.
Digital signature process
9/30/2022 36
Digital Signature CO3
Adding key to the digital signature process
Note
A digital signature needs a public-key system.
The signer signs with her private key; the verifier
verifies with the signer’s public key.
9/30/2022 37
Digital Signature CO3
Signing the digest
Note
A cryptosystem uses the private and public keys of the receiver:
a digital signature uses
the private and public keys of the sender.
9/30/2022 38
Digital Signature Services CO3
Message Authentication
A secure digital signature scheme, like a secure
conventional signature can provide message
authentication.
Note
A digital signature provides message authentication.
9/30/2022 39
Digital Signature Services CO3
Message Integrity
The integrity of the message is preserved even if we sign
the whole message because we cannot get the same
signature if the message is changed.
Note
A digital signature provides message integrity.
9/30/2022 40
Digital Signature Services CO3
non-repudiation
Note
Nonrepudiation can be provided using a trusted party.
9/30/2022 41
Digital Signature Services CO3
Confidentiality
Adding confidentiality to a digital signature scheme
Note
A digital signature does not provide privacy.
If there is a need for privacy, another layer of
encryption/decryption must be applied.
9/30/2022 42
Digital Signature Schemes CO3
ElGamal Digital Signature Scheme
General idea behind the ElGamal digital signature scheme
9/30/2022 43
Digital Signature Services CO3
Key Generation in ElGamal Digital Signature
The key generation procedure here is exactly the same as
the one used in the cryptosystem.
Note
In ElGamal digital signature scheme, (e1, e2, p) is
Alice’s public key; d is her private key.
9/30/2022 44
Digital Signature Schemes CO3
Verifying and Signing
ElGamal digital signature scheme
9/30/2022 45
Digital Signature Schemes CO3
Digital Signature Standard (DSS)
General idea behind DSS scheme
9/30/2022 46
Digital Signature Schemes CO3
Key Generation in DSS
1) Alice chooses primes p and q.
2) Alice uses <Zp*, × > and <Zq*, ×>.
3) Alice creates e1 to be the qth root of 1 modulo p.
4) Alice chooses d and calculates e2 = e1d.
5) Alice’s public key is (e1, e2, p, q); her private key is (d).
9/30/2022 47
Digital Signature Schemes CO3
Verifying and Signing
DSS scheme
9/30/2022 48
References
1. William Stallings, “Cryptography and Network Security:
Principals and Practice”, Pearson Education.
2. Behrouz A. Frouzan: Cryptography and Network
Security, Tata McGraw Hill
9/30/2022 49
Youtube & NPTEL Video Links and other Links
Youtube/other Video Links
1. [Link]
M&list=PL71FE85723FD414D7&index=26
NPTEL Video link
1. [Link]
9/30/2022 50
Daily Quiz
What you meant by MAC?
What you meant by hash
function?
9/30/2022 51
Daily Quiz
What are the requirements of the
hash function?
What requirements should a
digital signature scheme should
satisfy?
9/30/2022 52
MCQ s
1. A _________ is used to verify the integrity and
authenticity of a message.
(a) Decryption algorithm
(b) Message digest
(c) MAC
(d) Both (b) and (c)
9/30/2022 53
MCQ s
2. Which of the following is the latest version of the
SHA algorithm?
(a) SHA-512
(b) SHA-256
(c) SHA-128
(d) SHA-1
9/30/2022 54
MCQ s
3. The purpose of hash function is to ensure
_________.
(a) Message integrity
(b) Message authentication
(c) Both (a) and (b)
(d) None of these
9/30/2022 55
MCQ s
4. Choose the odd one out.
(a) RC5
(b) Blowfish
(c) ECC
(d) MAC
9/30/2022 56
MCQ s
5. When two different messages yield the same
message digest, it is called _________.
(a) Attack
(b) Collision
(c) Hash
(d) None of these
9/30/2022 57
MCQ s
6. Which of these is a kind of attack possible on digital
signatures?
(a) Ciphertext-only attack
(b) Known-message attack
(c) Key-only attack
(d) Both (b) and (c)
9/30/2022 58
MCQ s
7. An attacker needs to perform _________ operations
in order to determine collision in SHA-1.
(a) 264
(b) 280
(c) 2256
(d) 272
9/30/2022 59
MCQ s
8. Which of these is not a variation of a digital
signature?
(a) Timestamped signature
(b) Blind signature
(c) Encrypted digital signature
(d) Undeniable digital signature
9/30/2022 60
MCQ s
9. Which of these statements is not correct about DSS?
(a) It was published by the National Institute of Standards
and Technology.
(b) It uses three functions to create a digital signature.
(c) An elaborated version of DSS was named as FIPS 186-2.
(d) It uses Secure Hash Algorithm (SHA).
9/30/2022 61
MCQ s
10. Which of these is a kind of attack possible on digital
signatures?
(a) Ciphertext-only attack
(b) Known-message attack
(c) Key-only attack
(d) Both (b) and (c)
9/30/2022 62
MCQ s
11. Which of the following is a property of a digital
signature?
(a) It must be able to verify the author.
(b) It must be able to verify the date and time of the
signature.
(c) It must be able to authenticate the contents of the
message at the time of the signature.
(d) All of these
9/30/2022 63
MCQ s
12. RSA _________ be used for digital signatures.
(a) can
(b) cannot
(c) must
(d) must not
9/30/2022 64
MCQ s
13. The sender encrypts the message with his or her
private key to achieve _________.
(a) Authentication
(b) Confidentiality
(c) Both (a) and (b)
9/30/2022 65
MCQ s
14. Which of the following pair of keys is used to create
and verify the digital signature, respectively?
(a) Signer's private key and verifier's public key
(b) Verifier's public key and verifier's private key
(c) Signer's private key and signer's public key
(d) Signer's public key and signer's private key
9/30/2022 66
MCQ s
15. Which of the following services is not provided by
digital signatures directly?
(a) Message authenticity
(b) Message confidentiality
(c) Message integrity
(d) Nonrepudiation
9/30/2022 67
MCQ s
16. Which of the following is /are offered by the Hash
functions?
a. Authentication
b. Non repudiation
c. Data Integrity
d. All of the above
9/30/2022 68
MCQ s
17. Which of the following is not possible through hash
value?
a. Password Check
b. Data Integrity check
c. Digital Signatures
d. Data retrieval in its original form
9/30/2022 69
MCQ s
18. Which of the following is not a property of Hash
Function?
a) Pre-Image Resistance
b) Compression
c) Fixed Length Output
d) None of the above
9/30/2022 70
MCQ s
19. Which of the following is not a property of Hash
Function?
a) Pre-Image Resistance
b) Compression
c) Fixed Length Output
d) None of the above
9/30/2022 71
MCQ s
20. Which of the following names can we use for
denoting the output of the hash function?
a) Hash value
b) Hash Code
c) Message Digest
d) All of the above
9/30/2022 72
Old Question Papers
• AKTU Previous year question paper
[Link]
9/30/2022 73
Expected Questions for University Exam
1. Differentiate MAC and Hash function?
2. Describe MD5 algorithm in detail. Compare its
performance with SHA-1.
3. Write and explain the Digital Signature Algorithm.
4. Explain the classification of authentication function in
detail.
9/30/2022 74
Summary
➢Message Authentication Code
➢Authentication requirements
➢Message Digest
➢Hash Function
➢Digital signature
➢DSS
9/30/2022 75
9/30/2022 76