1) Message authentication can be achieved through message encryption, message authentication codes (MACs), or hash functions.
2) MACs provide authentication by appending a fixed-size block that depends on the message and a secret key. Receivers can verify messages by recomputing the MAC.
3) Hash functions map variable-length data to fixed-length outputs and are easy to compute but infeasible to reverse or find collisions. Common hash functions include MD5 and SHA-512.
4. Message Encryption
Provides Message Authentication
Symmetric Encryption
Receiver know sender must have created it, since only sender and
receiver now key used
Provides both: sender authentication and message authenticity.
5. Message Encryption
Provides Message Authentication
Public-Key Encryption
Encryption provides no confidence of sender, since anyone
potentially knows public-key.
however if sender signs message using his private-key then encrypts
with recipients public key have both secrecy and authentication
but at cost of two public-key uses on message
6. Message Authentication Code
A small fixed-sized block of data
Depends on both message and a secret key like encryption though need not be reversible.
Appended to message as a signature
Receiver performs same computation on message and checks with the MAC
Provides assurance that message is unaltered and comes from sender
7. Message Authentication Code
MAC provides Authentication
Message can be encrypted for secrecy
Generally use separate keys for each
Can compute MAC either before or after encryption, Generally regarded as better done before
why use a MAC?
sometimes only authentication is needed
Note that a MAC is not a Digital Signature
8. Message Authentication Code
MAC Properties
A MAC is a cryptographic checksum
MAC = CK(M)
C is a function
M is a variable-length message
K is a secret key
Many-to-One function
potentially many messages have same MAC but finding these
needs to be very difficult
9. Message Authentication Code
Requirements for MAC
MAC needs to satisfy the following:
Knowing a message and MAC, is infeasible to find another
message with same MAC
MAC should depend equally on all bits of the message
13. Message Authentication Code
Using Symmetric Ciphers for MACs
can use any cipher block chaining mode and use final block as a MAC
Data Authentication Algorithm (DAA) is a widely used MAC based on DES-CBC
using IV=0 and zero-pad of final block
encrypt message using DES in CBC mode
and send just the final block as the MAC
or the leftmost M bits (16≤M≤64) of final block
17. Hash Function
• Can be applied to any size message M
• Produces a fixed-length output h
• Easy to compute h=H(M) for any message M
• Given h is infeasible to find x s.t. H(x)=h
• Given x is infeasible to find y s.t. H(y)=H(x)
• infeasible to find any x,y s.t. H(y)=H(x)
Requirements for Hash Functions
18. Hash Function
MD5 Algorithm
The input message is broken up into chunks of 512-bit blocks (sixteen 32 bit
words).
The message is padded so that its length is divisible by 512
Grouped into four Round (each round process four 32 bit words)
19. Hash Function
MD5 Algorithm
32 bit
denote the XOR, AND, OR and NOT operations
Mi denotes a 32-bit block of the message input
Ki denotes a 32-bit constant
denotes a left bit rotation by s places
denotes addition modulo 232
21. SECURE HASH ALGORITHM
Step 1: Append padding bits
Step 2: Append Length
Step 3: Initialize HASH buffer
Step 4: Process message in 1024 bit Blocks
Step 5: Output
22. SECURE HASH ALGORITHM
Step 1: Append padding bits
The message is padded so that length ≡ 896 (mod 1024)
padding is always added
consist of single 1-bit followed by necessary number of 0-bits
23. SECURE HASH ALGORITHM
Step 2:Append Length
a block of 128 bits is appended
treated as unsigned 128-bit integer
contains the length of original message
24. SECURE HASH ALGORITHM
Step 3:Initialize hash buffer
hold intermediate values and final result
size: 512 bit
25. SECURE HASH ALGORITHM
Step 4:Process message in 1024-bit block
Consists 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
28. SECURE HASH ALGORITHM
Ch(e,f,g) = If e then f else g
Maj(a, b, c) = TRUE if majority
of a, b, c is TRUE
Wt = 64 bit word
Kt = 64 bit additive constant
29. HMAC
• Stands for Hash-based Message Authentication Code
• It used to verify data integrity and authenticity of a
message
• It uses current cryptographic hash functions with a secret
key (SHA or MD5)
The name of the function changes depending on what
hash function you use
MD5 would result to HMAC-MD5
SHA# would result to HMAC-SHA#
30. HMAC
• Stands for Hash-based Message Authentication Code
• It used to verify data integrity and authenticity of a
message
• It uses current cryptographic hash functions with a secret
key (SHA or MD5)
The name of the function changes depending on what
hash function you use
MD5 would result to HMAC-MD5
SHA# would result to HMAC-SHA#