Module-IV Message Authentication & Integrity
Module-IV Message Authentication & Integrity
Module-IV Message Authentication & Integrity
by M.K.Chavan
1
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
Attack on Hash Function
The Road to new Secure Hash Standard
2
Hash Function
A message digest is as a
``digital fingerprint'' of the
original document
3
Hashing V.S. Encryption
Hello, world. k NhbXBsZSBzZW50ZW5jZS
A sample sentence to E B0byBzaG93IEVuY3J5cHR
show encryption. pb24KsZSBzZ
Hello, world. k
NhbXBsZSBzZW50ZW5jZS
A sample sentence to D
B0byBzaG93IEVuY3J5cHR
show encryption. pb24KsZSBzZ
5
Hash Function Applications
Used Alone
Fingerprint -- file integrity verification
Password storage (one-way encryption)
6
Integrity
7
Password Verification
Store Hashing Password Verification an input password against the stored hash
Iam#4VKU Iam#4VKU
Password
store
h h
Hash Matching
Exactly?
Password
Yes No
store Deny
Grant
8
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
Attack on Hash Function
The Road to new Secure Hash Standard
9
Hash Function Usages (I)
10
Hash Function Usages (II)
11
Hash Function Usages (III)
12
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
Attack on Hash Function
The Road to new Secure Hash Standard
13
Hash Function Properties
Arbitrary-length message to fixed-length digest
14
Properties : Fixed length
Fixed length L
This is a clear text that
can easily read without
52f21cf7c7034a20
using the key. The h
17a21e17e061a863
sentence is longer than
the text above.
15
Preimage resistant
This measures how difficult to devise a message which hashes to the
known digest
Roughly speaking, the hash function must be one-way.
Can’t find any two different messages with the same message digest
Collision resistance implies second preimage resistance
Collisions, if we could find them, would give signatories a way to repudiate their signatures
17
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
Attack on Hash Function
The Road to new Secure Hash Standard
18
Two Group of Compression Functions
The compression function is made from scratch
Message Digest
19
Merkle-Damgard Scheme
21
MD5, SHA-1, and RIPEMD-160
22
MD2, MD4 and MD5
Family of one-way hash functions by Ronald Rivest
All produces 128 bits hash value
MD2: 1989
Optimized for 8 bit computer
Collision found in 1995
MD4: 1990
Full round collision attack found in 1995
MD5: 1992
Specified as Internet standard in RFC 1321
Practical Collision MD5 has been broken since 2004
CA attack published in 2007
23
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
MD5
SHA
Attack on Hash Function
The Road to new Secure Hash Standard
24
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
MD5
SHA
Attack on Hash Function
The Road to new Secure Hash Standard
25
Secure Hash Algorithm
➢ SHA originally designed by NIST & NSA in 1993
➢ revised in 1995 as SHA-1
➢ US standard for use with DSA signature scheme
⚫ standard is FIPS 180-1 1995, also Internet RFC3174
➢ based on design of MD4 with key differences
➢ produces 160-bit hash values
➢ recent 2005 results on security of SHA-1 have raised concerns
on its use in future applications
26
Revised SHA
➢ NIST issued revision FIPS 180-2 in 2002
➢ adds 3 additional versions of SHA
⚫ SHA-256, SHA-384, SHA-512
➢ designed for compatibility with increased security
provided by the AES cipher
➢ structure & detail is similar to SHA-1
➢ hence analysis should be similar
➢ but security levels are rather higher
27
SHA Versions
28
Sample Processing
29
SHA-512 Overview
30
Padding and length field in SHA-512
What is the number of padding bits if the length of the original message
is 2590 bits?
We can calculate the number of padding bits as follows:
31
SHA-512 Round Function
32
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
MD5
SHA
33
Hash Function Cryptanalysis
➢ cryptanalytic attacks exploit some property of algorithm
so faster than exhaustive search
➢ hash functions use iterative structure
⚫ process message in blocks (incl length)
➢ attacks focus on collisions in function f
34
Attacks on Hash Functions
➢ brute-force attacks and cryptanalysis
➢ cryptanalytic attacks exploit some property of algorithm so
faster than brute-force
➢ a preimage or second preimage attack
⚫ find y such that H(y)equals a given hash value
➢ collision resistance
⚫ find two messages x & y with same hash so H(x) = H(y)
"md5 and sha1 are both clearly broken (in terms of collision-resistance”
Ron Rivest
http://mail.python.org/pipermail/python-dev/2005-December/058850.html
35
Topics
Overview of Cryptography Hash Function
Usages
Properties
Hashing Function Structure
MD5
SHA
Attack on Hash Function
The Road to new Secure Hash Standard
36
The need of new Hash standard
➢ MD5 should be considered cryptographically broken and
unsuitable for further use, US CERT 2010
➢ In 2004, a collision for the full SHA-0 algorithm was
announced
38
Timeline Competition
Nov 2007: Announce public competition
Oct 2008: 64 Entries
Dec 2008: 51 Entries as 1st Round
Jul 2009: 14 Entries as 2nd Round
Dec 2010: 5 Entries as 3rd Round
Jan 2011: Final packages submission and enter public
comments
2012: SHA-3 winner announcement (Still in progress)
39
Five SHA-3 Finalists
BLAKE
Grøstl
JH
Keccak
Skien
http://csrc.nist.gov/groups/ST/hash/sha-3/Round3/submissions_rnd3.html
40
Secure Hash Algorithm-512 (SHA-512)
M.K.Chavan
54
Figure: Structure of each round in SHA-512
SHA-512 Round Function
Majority Function
Conditional Function
Rotate Functions
W0 = 6162638000000000 W5 = 0000000000000000
W1 = 0000000000000000 W6 = 0000000000000000
W2 = 0000000000000000 W7 = 0000000000000000
W3 = 0000000000000000 W8 = 0000000000000000
W4 = 0000000000000000 W9 = 0000000000000000
W10 = 0000000000000000 W13 = 0000000000000000
W11 = 0000000000000000 W14 = 0000000000000000
W12 = 0000000000000000 W15 = 0000000000000018
November 30, 2022 58
Example using SHA-512
The following table shows the initial values of these variables and their values after
each of the first two rounds.
a 6a09e667f3bcc908 f6afceb8bcfcddf5 1320f8c9fb872cc0
b bb67ae8584caa73b 6a09e667f3bcc908 f6afceb8bcfcddf5
c 3c6ef372fe94f82b bb67ae8584caa73b 6a09e667f3bcc908
d a54ff53a5f1d36f1 3c6ef372fe94f82b bb67ae8584caa73b
e 510e527fade682d1 58cb02347ab51f91 c3d4ebfd48650ffa
f 9b05688c2b3e6c1f 510e527fade682d1 58cb02347ab51f91
g 1f83d9abfb41bd6b 9b05688c2b3e6c1f 510e527fade682d1
h 5be0cd19137e2179 1f83d9abfb41bd6b 9b05688c2b3e6c1f
The process continues through 80 rounds. The output of the final round is
59
Example using SHA-512
60
SHA-512 Applications
61
SHA-512 Cryptanalysis
Published in Year Attack method Rounds
New Collision Attacks Against
2008 Deterministic 24/80
Up To 24-step SHA-2
Preimages for step-reduced Meet-in-the- 42/80
2009
SHA-2 middle 46/80
Advanced meet-in-the-middle Meet-in-the-
2010 42/80
preimage attacks middle
Bicliques for Preimages: Attacks 50/80
on 2011 Biclique
57/80
Skein-512 and the SHA-2 family
Branching Heuristics in
Heuristic
Differential Collision Search with 2014 38/80
differential
Applications to SHA-512
62
Summary
Hash functions are keyless
Applications for digital signatures and in message authentication codes
The three security requirements for hash functions are
one-wayness and collision resistance
MD5 and SHA-0 is insecure
Serious security weaknesses have been found in SHA-1
should be phased out
SHA-2 appears to be secure
May use SHA-512 and use the first 256 bytes
SHA-3 (Secure Hash Algorithm 3) is the latest member of
the Secure Hash Algorithm family of standards, released
by NIST on August 5, 2015
63
Authentication
Applications
64
Outline
• Security Concerns
• Kerberos
• X.509 Authentication Service
• Recommended reading and Web Sites
65
KERBEROS
70
Overview of Kerberos
71
Request for Service in
Another Realm
72
Difference Between
Version 4 and 5
• Encryption system dependence (V.4 DES)
• Internet protocol dependence
• Message byte ordering
• Ticket lifetime
• Authentication forwarding
• Interrealm authentication
73
Kerberos Encryption Techniques
74
PCBC Mode
75
Kerberos - in practice
• Currently have two Kerberos versions:
• 4 : restricted to a single realm
• 5 : allows inter-realm authentication, in beta test
• Kerberos v5 is an Internet standard
• specified in RFC1510, and used by many utilities
• To use Kerberos:
• need to have a KDC on your network
• need to have Kerberised applications running on all
participating systems
• major problem - US export restrictions
• Kerberos cannot be directly distributed outside the
US in source format (& binary versions must obscure
crypto routine entry points and have no encryption)
• else crypto libraries must be reimplemented locally
76
X.509 Authentication
Service
• Distributed set of servers that
maintains a database about users.
• Each certificate contains the public
key of a user and is signed with the
private key of a CA.
• Is used in S/MIME, IP Security,
SSL/TLS and SET.
• RSA is recommended to use.
77
X.509 Formats
78
Typical Digital Signature
Approach
79
Obtaining a User’s
Certificate
• Characteristics of certificates
generated by CA:
– Any user with access to the public key of
the CA can recover the user public key
that was certified.
– No part other than the CA can modify
the certificate without this being
detected.
80
X.509 CA Hierarchy
81
Revocation of Certificates
• Reasons for revocation:
– The users secret key is assumed to be
compromised.
– The user is no longer certified by this
CA.
– The CA’s certificate is assumed to be
compromised.
82
Authentication Procedures
83
Recommended Reading and
WEB Sites
• www.whatis.com (search for kerberos)
• Bryant, W. Designing an Authentication
System: A Dialogue in Four Scenes.
http://web.mit.edu/kerberos/www/dialogue.html
• Kohl, J.; Neuman, B. “The Evolotion of
the Kerberos Authentication Service”
http://web.mit.edu/kerberos/www/papers.html
• http://www.isi.edu/gost/info/kerberos/
84