SlideShare a Scribd company logo
1 of 47
Chapter 5:-
Message Authentication and
Hash Functions
Sarthak Patel, (www
.sarthakpatel.in)
Outline
● Authentication Requirement,
● Functions, MessageAuthentication Code, Hash Functions,
● SecurityOfHash FunctionsAnd Macs
● MD5 Message DigestAlgorithm,
● Secure HashAlgorithm
● Ripemd-160
● Hmac
Sarthak Patel (www.sarthakpatel.in)
2
Authentication Requirements
1. Disclosure: Release of message contents to any person or process not
possessingthe appropriate cryptographickey
.
2. Traffic analysis: Discovery of the pattern of traffic between parties.
In a connection-oriented application, the frequency and duration of
connections could be determined. In either a connection-oriented or
connectionless environment, the number and length of messages
between partiescould be determined.
3. Masquerade: Insertion of messages into the network from a
fraudulent source. This includes the creation of messages by an
opponent that are supposed to come from an authorized entity. Also
included are fraudulent acknowledgments of message receipt or
nonreceipt bysomeone other than the messagerecipient.
Sarthak Patel (www.sarthakpatel.in)
3
Contd…
4. Content modification: Changes to the contents of a message,
includinginsertion,deletion,transposition,and modification.
5. Sequence modification: Any modification to a sequence of
messages between parties, including insertion, deletion, and
reordering.
6. Timing modification: Delay or replay of messages. In a
connection-oriented application, an entire session or sequence
of messages could be a replay of some previous valid session, or
individual messages in the sequence could be delayed or
replayed. In a connectionless application, an individual message
(e.g., datagram) could be delayedor replayed.
Sarthak Patel (www.sarthakpatel.in)
4
Contd…
7. Source repudiation: Denial of transmission of message by
source.
8. Destination repudiation: Denialof receipt of message by
destination.
Sarthak Patel (www.sarthakpatel.in)
5
Message Authentication Function
● message authentication isconcerned with:
● protectingthe integrityof amessage
● validatingidentityoforiginator
● non-repudiation of origin (dispute resolution)
● three alternative functionsused:
● message encryption
● message authentication code (MAC)
● hashfunction
Sarthak Patel (www.sarthakpatel.in)
6
Message Encryption
● messageencryption byitself 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
● So, content cannot of been altered
● Provides both:sender authentication and message authenticity.
Sarthak Patel (www.sarthakpatel.in)
7
Message Encryption
● ifpublic-keyencryption isused:
● encryption provides no confidence of sender
● since anyone potentiallyknows public-key
● however if
● sender signs message using his private-key
● then encryptswith recipientspublic key
● haveboth secrecy and authentication
● but at cost of two public-key uses on message
Sarthak Patel (www.sarthakpatel.in)
8
Sarthak Patel (www.sarthakpatel.in)
Message Authentication Code (MAC)
● asmall fixed-sized block ofdata:
● dependson both messageand asecret key
● like encryption though need not be reversible
● appended to message as asignature
● receiver performs same computation on message and checks it
matchesthe MAC
● providesassurance that messageis unaltered and comes from
sender
Sarthak Patel (www.sarthakpatel.in)
10
Message Authentication Code
This technique assumes that two communicating parties, sayA and B,
share a common secret key K. WhenA has a message to send to B,
it calculates the MAC as a function of the message and the key:
MAC = C(K, M), where
M= input message
C= MAC function
K= shared secret key
MAC= message authentication code
Sarthak Patel (www.sarthakpatel.in)
11
Message Authentication Codes
● MAC providesauthentication
● Message can be encrypted for secrecy
● generallyuse separate keysfor each
● can compute MACeither before or after encryption
● isgenerallyregarded asbetter done before
● whyuse aMAC?
● sometimesonlyauthentication isneeded
● sometimes need authentication to persist longer than the
encryption
Sarthak Patel (www.sarthakpatel.in)
12
Mac Encryption
● The receiver is assured that the message is from the alleged
sender.Becauseno one else knowsthe secret key,no one else
could prepare amessage with aproper MAC.
Sarthak Patel (www.sarthakpatel.in)
13
MAC Properties
● aMAC isacryptographic checksum
MAC = CK(M)
● C isafunction
● condensesavariable-lengthmessage M
● usingasecret keyK
● to afixed-sized authenticator
● many-to-one function
● potentiallymanymessageshave same MAC
● but findingthese needs to be very difficult
Sarthak Patel (www.sarthakpatel.in)
14
Requirements for MACs
● MAC needsto satisfy the following:
1. knowingamessage and MAC, isinfeasible to find another
message with same MAC
2. MACsshould be uniformlydistributed
3. MACshoulddepend equally on all bits of the message
Sarthak Patel (www.sarthakpatel.in)
15
Hash Functions
● Ahash function islike aMAC
● condensesarbitrarymessage to fixed size
h = H(M)
● usuallyassume that the hash function ispublic and not
keyed
-note that aMAC iskeyed
● hash used to detect changesto message
● can use in various wayswith message
● most often to create adigital signature
Sarthak Patel (www.sarthakpatel.in)
16
Hash Functions & Digital
Signatures
● Only the hash code is encrypted, using public-key
encryption andusingthe sender's private key.Aswith (b),
this providesauthentication. It alsoprovidesadigital
signature.
Sarthak Patel (www.sarthakpatel.in)
17
Requirements for Hash Functions
1. can be applied to anysize message M
2. produces afixed-length output h
3. iseasyto compute h=H(M) for anymessage M
4. given h isinfeasible to find x s.t. H(x)=h
5. given x isinfeasible to find y s.t. H(y)=H(x)
6. isinfeasible to find anyx,y s.t. H(y)=H(x)
Sarthak Patel (www.sarthakpatel.in)
18
Simple Hash Functions
● are several proposals for simple functions
● based on XORofmessage blocks
-divide the message into equal size blocks
-perform XORoperation block byblock
-final output is the hash
● not verysecure
● need astronger cryptographic function
Sarthak Patel (www.sarthakpatel.in)
19
Security of Hash Functions and
Macs
● Attacks on hash functionsand MACsinto two categories:
● Brute-force attacks
● Cryptanalysis.
Sarthak Patel (www.sarthakpatel.in)
20
Brute-Force Attacks
Hash Functions:
● In hashfunctions there are three desirable properties
● One-way: For anygiven code h, it is computationally infeasible to
find x such that H(x) = h.
● W
eak collision resistance:For anygiven block x, it is
computationally infeasible to find y≠x with H(y) = H(x).
● Strong collision resistance:It iscomputationallyinfeasible to
find anypair (x, y) suchthat H(x) = H(y).
● Forahashcodeoflength n, the levelofeffort required, aswehaveseen
isproportional to the following:
Sarthak Patel (www.sarthakpatel.in)
21
Contd…
MessageAuthentication Codes
● A brute-force attack on a MAC is a more difficult undertaking
because it requires known message-MAC pairs. Let us see why this
is so. To attack a hash code, we can proceed in the following way.
Given a fixed message x with n-bit hash code h = H(x), a brute-
force method of finding a collision is to pick a random bit string y
and check if H(y) = H(x). The attacker can do this repeatedly off
line. Whether an off-line attack can be used on a MAC algorithm
dependson the relative size of the keyand the MAC.
Sarthak Patel (www.sarthakpatel.in)
22
Contd…
● If an attacker can determine the MAC key, then it is possible to
generate avalid MAC value for anyinput x.
● Suppose the key size is k bits and that the attacker has one known
text-MAC pair. Then the attacker can compute the n-bit MAC on
the known text for all possible keys. At least one key is guaranteed
to produce the correct MAC, namely, the valid key that was
initially used to produce the known text-MAC pair. This phase of
the attack takes alevelof effort proportional to 2k.
Sarthak Patel (www.sarthakpatel.in)
23
Cryptanalysis
● As with encryption algorithms, cryptanalytic attacks on hash
functions and MACalgorithms seek to exploit some property
of the algorithm to perform some attack other than an
exhaustive search. The way to measure the resistance of a
hash or MAC algorithm to cryptanalysis is to compare its
strength to the effort required for a brute-force attack. That
is, an ideal hash or MAC algorithm will require a
cryptanalytic effort greater than or equal to the brute-force
effort.
Sarthak Patel (www.sarthakpatel.in)
24
Cryptanalysis
Hash Functions
● The hash function takes an input message and partitions it into L
fixed-sized blocks of b bits each. If necessary, the final block is
padded to b bits. The final block also includes the value of the total
length of the input to the hash function. The inclusion of the length
makesthe job of the opponent more difficult.
MessageAuthentication Codes
● There is much more variety in the structure of MACs than in hash
functions, so it is difficult to generalize about the cryptanalysis of
MACs. Further, far less work has been done on developing such
attacks.
Sarthak Patel (www.sarthakpatel.in)
25
Message Digests(Hash)
● Amessage digest is afingerprint or the summary of a
message. (Same as LRC and CRC)
● It is used to verify integrity of the data (Toensure that
message hasnot been tampered).
● Ex. LRC- paritychecking
Sarthak Patel (www.sarthakpatel.in)
26
Idea of a Message Digest
● Ex: Calculate the message digest ofnumber 7391743
● Multiply each digit in the number with the next digit
(excluding if it is 0) and disregarding the first digit of the
multiplication operation, it the result is two-digit number.
Sarthak Patel (www.sarthakpatel.in)
27
Calculate MD for 7391743
● Multiply 7 by 3 - 21
● Discard first digit - 1
● Multiply 1 by 9 - 9
● Multiply 9 by 1 - 9
● Multiply 9 by 7 - 63
● Discard first digit - 3
● Multiply 3 by 4 - 12
● Discard first digit - 2
● Multiply 2 by 3 - 6
Sarthak Patel (www.sarthakpatel.in)
28
● Message digest is 6
MD5 (Message Digest 5)
● MD5is amessage digest algorithm developed byRon Rivest.
● MD5algorithm can be used asadigital signature mechanism.
Sarthak Patel (www.sarthakpatel.in)
29
Description of the MD5 Algorithm
● Takesasinput amessage of arbitrary length and produces as
output a128 bit “fingerprint”or “messagedigest”ofthe
input.
● It it is computationally infeasible to produce two messages
havingthe same message digest.
● Intended where alarge file must be“compressed”in asecure
manner before being encrypted with aprivate keyunder a
public-keycryptosystem such as PGP
.
Sarthak Patel (www.sarthakpatel.in)
30
MD5 Algorithm
● Suppose ab-bit message asinput, and that we need to find its
message digest.
Step-1 Padding
Step-2Append length
Step-3 Divide the input into 512-bit blocks.
Step-4 Initialize chainingvariables (4 variables)
Step-5 Processblocks
Sarthak Patel (www.sarthakpatel.in)
31
Step-1
● MD5 isto add paddingbitsto the original message.
● The aim of this step is make length of the original message
equal to avalue,which is 64 bits less than an exact multiple
of512.
● Ex: 1000 bitsofmessage (1000+472+64)
● The paddingconsists ofasingle“1”bit is appended to the
message, and then“0”bits.
Sarthak Patel (www.sarthakpatel.in)
32
Step 2 – append length:
● A64 bit representation of b is appended to the result of the
previousstep.
● The resulting messagehasa length that is an exact multiple of
512 bits
Sarthak Patel (www.sarthakpatel.in)
33
Step-3 Divide the input into 512-bit
blocks
Data to be hashed (Digested) 1536 bits
512 bits 512 bits 512 bits
Sarthak Patel (www.sarthakpatel.in)
34
Step-4 Initialize chaining variables
● Afour-word buffer (A,B,C,D) is used to compute the
message digest.
● Here each ofA,B,C,D, is a32 bit register.
Sarthak Patel (www.sarthakpatel.in)
35
Step-5 Process blocks
1. – Copythe four variables(32*4 = 128)
2. – Divide the 512- bit block into 16 sub-blocks.
512 bits
5.3 – Processeach block withA, B, C, D.
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
bits bits bits bits bits bits bits bits bits bits bits bits bits bits bits bits
Sarthak Patel (www.sarthakpatel.in)
36
5.3 - Process each block with A, B, C, D.
Sarthak Patel (www.sarthakpatel.in)
37
Secure Hash Algorithm (SHA)
● SHA-1 producesahash value of160 bits.
● SHAisdesigned to be computationally infeasible to:
● Obtain the original message
● Find two messageproducing the same MD.
Sarthak Patel (www.sarthakpatel.in)
38
Types(Versions) of SHA
Sarthak Patel (www.sarthakpatel.in)
39
Algorithm
Step-1 Padding
Step-2Append length
Step-3 Divide the input into 512-bit blocks.
Step-4 Initialize chaining variables (5 varibles)
Step-5 Process blocks
Sarthak Patel (www.sarthakpatel.in)
40
5.3- Process each block with A, B, C, D, E.
Sarthak Patel (www.sarthakpatel.in)
41
Comparison of MD5 & SHA-1
Points of
Discussion
MD5 SHA-1
MD length in bits 128 160
Attack try to
find MD
2128 2160
Attack try to find
two messages
producing same
message digest
264 280
Speed Faster Slower
Sarthak Patel (www.sarthakpatel.in)
42
RACE Integrity Primitives Evaluation
Message Digest (RIPEMD-160)
● RIPEMD is a cryptographic hash based upon MD4. It's been
shown to have weaknesses and has been replaced by
RIPEMD-128 and RIPMD-160. These are cryptographic hash
functions designed by Hans Dobbertin, Antoon
Bosselaers, and Bart Preneel.
● RIPEMD-160 produces a hash of the same length as SHA1
but is slightly slower. RIPEMD-128 has been designed as a
drop-in replacement for MD4/MD5 whilst avoiding some of
the weaknesses shown for these two algorithms. It is about
halfthe speed ofMD5.
Sarthak Patel (www.sarthakpatel.in)
43
HMAC(Hash-Based MAC)
● HMAC has been chosen as a security implementation for Internet
Protocol (IP) and Secure Socket Layer(SSL), widely used in
internet.
● The fundamental idea of HMAC is to reuse the existing MD5 or
SHA-1.
Sarthak Patel (www.sarthakpatel.in)
44
Original
message
Existing MD5 or
SHA-1
MD Encrypt
HMA
C
Sarthak Patel (www.sarthakpatel.in)
K
How HMAC works?
● MD- Message Digest/ Hash function
● M– Input message
● ipad-Astring00110110 repeated b/ 8 times
● opqd-Astring01011010 repeated b/ 8 times
Sarthak Patel (www.sarthakpatel.in)
46
How HMAC works?
● Step-1 Make the lengthofKequal to b
● Length K<b (Append 0 – left side)
● Length K=b (Step -2)
● Length K>b (Hash Kreduce itslengthto b)
● Step- 2 XOR Kwith ipad to produce S1
● Step -3Append Mto S1
● Step -4 Message Digest algorithm
● Step -5 XOR Kwith opad to produce S2
● Step -6Append H toS2
● Message DigestAlgorithm
Sarthak Patel (www.sarthakpatel.in)
47

More Related Content

Similar to Authentication and Hash Functions

Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit ivArthyR3
 
Message authentication
Message authenticationMessage authentication
Message authenticationCAS
 
Efficient authentication for mobile and pervasive computing
Efficient authentication for mobile and pervasive computingEfficient authentication for mobile and pervasive computing
Efficient authentication for mobile and pervasive computingIGEEKS TECHNOLOGIES
 
Cryptography-Hash-Functions.pptx
Cryptography-Hash-Functions.pptxCryptography-Hash-Functions.pptx
Cryptography-Hash-Functions.pptxAngeloChangcoco
 
IRJET - Hash Functions and its Security for Snags
IRJET -  	  Hash Functions and its Security for SnagsIRJET -  	  Hash Functions and its Security for Snags
IRJET - Hash Functions and its Security for SnagsIRJET Journal
 
Message Authentication Requirement-MAC
Message Authentication Requirement-MACMessage Authentication Requirement-MAC
Message Authentication Requirement-MACSou Jana
 
Message auth. code Based on Hash Functions.pptx
Message auth. code Based on Hash Functions.pptxMessage auth. code Based on Hash Functions.pptx
Message auth. code Based on Hash Functions.pptxaribariaz507
 
Efficient authentication for mobile and pervasive computing
Efficient authentication for mobile and pervasive computingEfficient authentication for mobile and pervasive computing
Efficient authentication for mobile and pervasive computingIGEEKS TECHNOLOGIES
 
An Efficient privacy preserving for Mobile and Pervasive Computing
An Efficient privacy preserving for Mobile and Pervasive ComputingAn Efficient privacy preserving for Mobile and Pervasive Computing
An Efficient privacy preserving for Mobile and Pervasive Computinginventionjournals
 
Efficient authentication for mobile and pervasive computing
Efficient authentication for mobile and pervasive computing Efficient authentication for mobile and pervasive computing
Efficient authentication for mobile and pervasive computing Shakas Technologies
 
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORKUNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORKjeevasreemurali
 
unit - III.pptx
unit - III.pptxunit - III.pptx
unit - III.pptxsandyBS
 

Similar to Authentication and Hash Functions (20)

Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit iv
 
Message authentication
Message authenticationMessage authentication
Message authentication
 
Efficient authentication for mobile and pervasive computing
Efficient authentication for mobile and pervasive computingEfficient authentication for mobile and pervasive computing
Efficient authentication for mobile and pervasive computing
 
Cryptography-Hash-Functions.pptx
Cryptography-Hash-Functions.pptxCryptography-Hash-Functions.pptx
Cryptography-Hash-Functions.pptx
 
Cryptography and netwrk securityunit 4
Cryptography and netwrk securityunit 4Cryptography and netwrk securityunit 4
Cryptography and netwrk securityunit 4
 
Module 2.pdf
Module 2.pdfModule 2.pdf
Module 2.pdf
 
Module 2.Cryptography and Cryptanalysis
Module 2.Cryptography and CryptanalysisModule 2.Cryptography and Cryptanalysis
Module 2.Cryptography and Cryptanalysis
 
Cns
CnsCns
Cns
 
IRJET - Hash Functions and its Security for Snags
IRJET -  	  Hash Functions and its Security for SnagsIRJET -  	  Hash Functions and its Security for Snags
IRJET - Hash Functions and its Security for Snags
 
Message Authentication Requirement-MAC
Message Authentication Requirement-MACMessage Authentication Requirement-MAC
Message Authentication Requirement-MAC
 
Ch11
Ch11Ch11
Ch11
 
Message auth. code Based on Hash Functions.pptx
Message auth. code Based on Hash Functions.pptxMessage auth. code Based on Hash Functions.pptx
Message auth. code Based on Hash Functions.pptx
 
Efficient authentication for mobile and pervasive computing
Efficient authentication for mobile and pervasive computingEfficient authentication for mobile and pervasive computing
Efficient authentication for mobile and pervasive computing
 
An Efficient privacy preserving for Mobile and Pervasive Computing
An Efficient privacy preserving for Mobile and Pervasive ComputingAn Efficient privacy preserving for Mobile and Pervasive Computing
An Efficient privacy preserving for Mobile and Pervasive Computing
 
CRYPTOGRAPHY & NETWORK SECURITY- Cryptographic Hash Functions
CRYPTOGRAPHY & NETWORK SECURITY- Cryptographic Hash FunctionsCRYPTOGRAPHY & NETWORK SECURITY- Cryptographic Hash Functions
CRYPTOGRAPHY & NETWORK SECURITY- Cryptographic Hash Functions
 
Efficient authentication for mobile and pervasive computing
Efficient authentication for mobile and pervasive computing Efficient authentication for mobile and pervasive computing
Efficient authentication for mobile and pervasive computing
 
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORKUNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
 
Mj2521372142
Mj2521372142Mj2521372142
Mj2521372142
 
unit - III.pptx
unit - III.pptxunit - III.pptx
unit - III.pptx
 

More from JohnLagman3

8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentationJohnLagman3
 
7.-Bootstrap-5-report powerpoint presentation
7.-Bootstrap-5-report powerpoint presentation7.-Bootstrap-5-report powerpoint presentation
7.-Bootstrap-5-report powerpoint presentationJohnLagman3
 
1._Introduction_to_HTML5 powerpoint presentation
1._Introduction_to_HTML5 powerpoint presentation1._Introduction_to_HTML5 powerpoint presentation
1._Introduction_to_HTML5 powerpoint presentationJohnLagman3
 
bufferoverflow-151214121251 presentation
bufferoverflow-151214121251 presentationbufferoverflow-151214121251 presentation
bufferoverflow-151214121251 presentationJohnLagman3
 
Variables in MIT App Inventor powerpoint
Variables in MIT App Inventor powerpointVariables in MIT App Inventor powerpoint
Variables in MIT App Inventor powerpointJohnLagman3
 
Web-Development Powerpoint Presentation.
Web-Development Powerpoint Presentation.Web-Development Powerpoint Presentation.
Web-Development Powerpoint Presentation.JohnLagman3
 
History of Android powerpoint presentation
History of Android powerpoint presentationHistory of Android powerpoint presentation
History of Android powerpoint presentationJohnLagman3
 
Mobile Application Development powerpoint
Mobile Application Development powerpointMobile Application Development powerpoint
Mobile Application Development powerpointJohnLagman3
 
Presentation of Hyper Text Markup Language
Presentation of Hyper Text Markup LanguagePresentation of Hyper Text Markup Language
Presentation of Hyper Text Markup LanguageJohnLagman3
 
html-150424090224-conversion-gate0.2.pdf
html-150424090224-conversion-gate0.2.pdfhtml-150424090224-conversion-gate0.2.pdf
html-150424090224-conversion-gate0.2.pdfJohnLagman3
 
Hypertext Mark Up Language Introduction.
Hypertext Mark Up Language Introduction.Hypertext Mark Up Language Introduction.
Hypertext Mark Up Language Introduction.JohnLagman3
 
Multiple_Linear_Regression Presentation.
Multiple_Linear_Regression Presentation.Multiple_Linear_Regression Presentation.
Multiple_Linear_Regression Presentation.JohnLagman3
 
Lesson 4 - Introduction to Filmora.pptx
Lesson 4 - Introduction to Filmora.pptxLesson 4 - Introduction to Filmora.pptx
Lesson 4 - Introduction to Filmora.pptxJohnLagman3
 
1.-Introduction-report.pdf
1.-Introduction-report.pdf1.-Introduction-report.pdf
1.-Introduction-report.pdfJohnLagman3
 
Lesson 1 Animation.pdf
Lesson 1 Animation.pdfLesson 1 Animation.pdf
Lesson 1 Animation.pdfJohnLagman3
 
Confidentiality Privacy and Security.ppt
Confidentiality Privacy and Security.pptConfidentiality Privacy and Security.ppt
Confidentiality Privacy and Security.pptJohnLagman3
 
physicalsecurity-150317020111-conversion-gate01.pdf
physicalsecurity-150317020111-conversion-gate01.pdfphysicalsecurity-150317020111-conversion-gate01.pdf
physicalsecurity-150317020111-conversion-gate01.pdfJohnLagman3
 
Introduction to BIOMETRICS Security.pptx
Introduction to BIOMETRICS Security.pptxIntroduction to BIOMETRICS Security.pptx
Introduction to BIOMETRICS Security.pptxJohnLagman3
 
1.-Introduction-report.pptx
1.-Introduction-report.pptx1.-Introduction-report.pptx
1.-Introduction-report.pptxJohnLagman3
 

More from JohnLagman3 (20)

8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
 
7.-Bootstrap-5-report powerpoint presentation
7.-Bootstrap-5-report powerpoint presentation7.-Bootstrap-5-report powerpoint presentation
7.-Bootstrap-5-report powerpoint presentation
 
1._Introduction_to_HTML5 powerpoint presentation
1._Introduction_to_HTML5 powerpoint presentation1._Introduction_to_HTML5 powerpoint presentation
1._Introduction_to_HTML5 powerpoint presentation
 
bufferoverflow-151214121251 presentation
bufferoverflow-151214121251 presentationbufferoverflow-151214121251 presentation
bufferoverflow-151214121251 presentation
 
Variables in MIT App Inventor powerpoint
Variables in MIT App Inventor powerpointVariables in MIT App Inventor powerpoint
Variables in MIT App Inventor powerpoint
 
Web-Development Powerpoint Presentation.
Web-Development Powerpoint Presentation.Web-Development Powerpoint Presentation.
Web-Development Powerpoint Presentation.
 
History of Android powerpoint presentation
History of Android powerpoint presentationHistory of Android powerpoint presentation
History of Android powerpoint presentation
 
Mobile Application Development powerpoint
Mobile Application Development powerpointMobile Application Development powerpoint
Mobile Application Development powerpoint
 
Presentation of Hyper Text Markup Language
Presentation of Hyper Text Markup LanguagePresentation of Hyper Text Markup Language
Presentation of Hyper Text Markup Language
 
html-150424090224-conversion-gate0.2.pdf
html-150424090224-conversion-gate0.2.pdfhtml-150424090224-conversion-gate0.2.pdf
html-150424090224-conversion-gate0.2.pdf
 
Hypertext Mark Up Language Introduction.
Hypertext Mark Up Language Introduction.Hypertext Mark Up Language Introduction.
Hypertext Mark Up Language Introduction.
 
Multiple_Linear_Regression Presentation.
Multiple_Linear_Regression Presentation.Multiple_Linear_Regression Presentation.
Multiple_Linear_Regression Presentation.
 
Lesson 4 - Introduction to Filmora.pptx
Lesson 4 - Introduction to Filmora.pptxLesson 4 - Introduction to Filmora.pptx
Lesson 4 - Introduction to Filmora.pptx
 
1.-Introduction-report.pdf
1.-Introduction-report.pdf1.-Introduction-report.pdf
1.-Introduction-report.pdf
 
Lesson 1 Animation.pdf
Lesson 1 Animation.pdfLesson 1 Animation.pdf
Lesson 1 Animation.pdf
 
Lesson 1.pdf
Lesson 1.pdfLesson 1.pdf
Lesson 1.pdf
 
Confidentiality Privacy and Security.ppt
Confidentiality Privacy and Security.pptConfidentiality Privacy and Security.ppt
Confidentiality Privacy and Security.ppt
 
physicalsecurity-150317020111-conversion-gate01.pdf
physicalsecurity-150317020111-conversion-gate01.pdfphysicalsecurity-150317020111-conversion-gate01.pdf
physicalsecurity-150317020111-conversion-gate01.pdf
 
Introduction to BIOMETRICS Security.pptx
Introduction to BIOMETRICS Security.pptxIntroduction to BIOMETRICS Security.pptx
Introduction to BIOMETRICS Security.pptx
 
1.-Introduction-report.pptx
1.-Introduction-report.pptx1.-Introduction-report.pptx
1.-Introduction-report.pptx
 

Recently uploaded

Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsstephieert
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Roomgirls4nights
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 

Recently uploaded (20)

Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 

Authentication and Hash Functions

  • 1. Chapter 5:- Message Authentication and Hash Functions Sarthak Patel, (www .sarthakpatel.in)
  • 2. Outline ● Authentication Requirement, ● Functions, MessageAuthentication Code, Hash Functions, ● SecurityOfHash FunctionsAnd Macs ● MD5 Message DigestAlgorithm, ● Secure HashAlgorithm ● Ripemd-160 ● Hmac Sarthak Patel (www.sarthakpatel.in) 2
  • 3. Authentication Requirements 1. Disclosure: Release of message contents to any person or process not possessingthe appropriate cryptographickey . 2. Traffic analysis: Discovery of the pattern of traffic between parties. In a connection-oriented application, the frequency and duration of connections could be determined. In either a connection-oriented or connectionless environment, the number and length of messages between partiescould be determined. 3. Masquerade: Insertion of messages into the network from a fraudulent source. This includes the creation of messages by an opponent that are supposed to come from an authorized entity. Also included are fraudulent acknowledgments of message receipt or nonreceipt bysomeone other than the messagerecipient. Sarthak Patel (www.sarthakpatel.in) 3
  • 4. Contd… 4. Content modification: Changes to the contents of a message, includinginsertion,deletion,transposition,and modification. 5. Sequence modification: Any modification to a sequence of messages between parties, including insertion, deletion, and reordering. 6. Timing modification: Delay or replay of messages. In a connection-oriented application, an entire session or sequence of messages could be a replay of some previous valid session, or individual messages in the sequence could be delayed or replayed. In a connectionless application, an individual message (e.g., datagram) could be delayedor replayed. Sarthak Patel (www.sarthakpatel.in) 4
  • 5. Contd… 7. Source repudiation: Denial of transmission of message by source. 8. Destination repudiation: Denialof receipt of message by destination. Sarthak Patel (www.sarthakpatel.in) 5
  • 6. Message Authentication Function ● message authentication isconcerned with: ● protectingthe integrityof amessage ● validatingidentityoforiginator ● non-repudiation of origin (dispute resolution) ● three alternative functionsused: ● message encryption ● message authentication code (MAC) ● hashfunction Sarthak Patel (www.sarthakpatel.in) 6
  • 7. Message Encryption ● messageencryption byitself 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 ● So, content cannot of been altered ● Provides both:sender authentication and message authenticity. Sarthak Patel (www.sarthakpatel.in) 7
  • 8. Message Encryption ● ifpublic-keyencryption isused: ● encryption provides no confidence of sender ● since anyone potentiallyknows public-key ● however if ● sender signs message using his private-key ● then encryptswith recipientspublic key ● haveboth secrecy and authentication ● but at cost of two public-key uses on message Sarthak Patel (www.sarthakpatel.in) 8
  • 10. Message Authentication Code (MAC) ● asmall fixed-sized block ofdata: ● dependson both messageand asecret key ● like encryption though need not be reversible ● appended to message as asignature ● receiver performs same computation on message and checks it matchesthe MAC ● providesassurance that messageis unaltered and comes from sender Sarthak Patel (www.sarthakpatel.in) 10
  • 11. Message Authentication Code This technique assumes that two communicating parties, sayA and B, share a common secret key K. WhenA has a message to send to B, it calculates the MAC as a function of the message and the key: MAC = C(K, M), where M= input message C= MAC function K= shared secret key MAC= message authentication code Sarthak Patel (www.sarthakpatel.in) 11
  • 12. Message Authentication Codes ● MAC providesauthentication ● Message can be encrypted for secrecy ● generallyuse separate keysfor each ● can compute MACeither before or after encryption ● isgenerallyregarded asbetter done before ● whyuse aMAC? ● sometimesonlyauthentication isneeded ● sometimes need authentication to persist longer than the encryption Sarthak Patel (www.sarthakpatel.in) 12
  • 13. Mac Encryption ● The receiver is assured that the message is from the alleged sender.Becauseno one else knowsthe secret key,no one else could prepare amessage with aproper MAC. Sarthak Patel (www.sarthakpatel.in) 13
  • 14. MAC Properties ● aMAC isacryptographic checksum MAC = CK(M) ● C isafunction ● condensesavariable-lengthmessage M ● usingasecret keyK ● to afixed-sized authenticator ● many-to-one function ● potentiallymanymessageshave same MAC ● but findingthese needs to be very difficult Sarthak Patel (www.sarthakpatel.in) 14
  • 15. Requirements for MACs ● MAC needsto satisfy the following: 1. knowingamessage and MAC, isinfeasible to find another message with same MAC 2. MACsshould be uniformlydistributed 3. MACshoulddepend equally on all bits of the message Sarthak Patel (www.sarthakpatel.in) 15
  • 16. Hash Functions ● Ahash function islike aMAC ● condensesarbitrarymessage to fixed size h = H(M) ● usuallyassume that the hash function ispublic and not keyed -note that aMAC iskeyed ● hash used to detect changesto message ● can use in various wayswith message ● most often to create adigital signature Sarthak Patel (www.sarthakpatel.in) 16
  • 17. Hash Functions & Digital Signatures ● Only the hash code is encrypted, using public-key encryption andusingthe sender's private key.Aswith (b), this providesauthentication. It alsoprovidesadigital signature. Sarthak Patel (www.sarthakpatel.in) 17
  • 18. Requirements for Hash Functions 1. can be applied to anysize message M 2. produces afixed-length output h 3. iseasyto compute h=H(M) for anymessage M 4. given h isinfeasible to find x s.t. H(x)=h 5. given x isinfeasible to find y s.t. H(y)=H(x) 6. isinfeasible to find anyx,y s.t. H(y)=H(x) Sarthak Patel (www.sarthakpatel.in) 18
  • 19. Simple Hash Functions ● are several proposals for simple functions ● based on XORofmessage blocks -divide the message into equal size blocks -perform XORoperation block byblock -final output is the hash ● not verysecure ● need astronger cryptographic function Sarthak Patel (www.sarthakpatel.in) 19
  • 20. Security of Hash Functions and Macs ● Attacks on hash functionsand MACsinto two categories: ● Brute-force attacks ● Cryptanalysis. Sarthak Patel (www.sarthakpatel.in) 20
  • 21. Brute-Force Attacks Hash Functions: ● In hashfunctions there are three desirable properties ● One-way: For anygiven code h, it is computationally infeasible to find x such that H(x) = h. ● W eak collision resistance:For anygiven block x, it is computationally infeasible to find y≠x with H(y) = H(x). ● Strong collision resistance:It iscomputationallyinfeasible to find anypair (x, y) suchthat H(x) = H(y). ● Forahashcodeoflength n, the levelofeffort required, aswehaveseen isproportional to the following: Sarthak Patel (www.sarthakpatel.in) 21
  • 22. Contd… MessageAuthentication Codes ● A brute-force attack on a MAC is a more difficult undertaking because it requires known message-MAC pairs. Let us see why this is so. To attack a hash code, we can proceed in the following way. Given a fixed message x with n-bit hash code h = H(x), a brute- force method of finding a collision is to pick a random bit string y and check if H(y) = H(x). The attacker can do this repeatedly off line. Whether an off-line attack can be used on a MAC algorithm dependson the relative size of the keyand the MAC. Sarthak Patel (www.sarthakpatel.in) 22
  • 23. Contd… ● If an attacker can determine the MAC key, then it is possible to generate avalid MAC value for anyinput x. ● Suppose the key size is k bits and that the attacker has one known text-MAC pair. Then the attacker can compute the n-bit MAC on the known text for all possible keys. At least one key is guaranteed to produce the correct MAC, namely, the valid key that was initially used to produce the known text-MAC pair. This phase of the attack takes alevelof effort proportional to 2k. Sarthak Patel (www.sarthakpatel.in) 23
  • 24. Cryptanalysis ● As with encryption algorithms, cryptanalytic attacks on hash functions and MACalgorithms seek to exploit some property of the algorithm to perform some attack other than an exhaustive search. The way to measure the resistance of a hash or MAC algorithm to cryptanalysis is to compare its strength to the effort required for a brute-force attack. That is, an ideal hash or MAC algorithm will require a cryptanalytic effort greater than or equal to the brute-force effort. Sarthak Patel (www.sarthakpatel.in) 24
  • 25. Cryptanalysis Hash Functions ● The hash function takes an input message and partitions it into L fixed-sized blocks of b bits each. If necessary, the final block is padded to b bits. The final block also includes the value of the total length of the input to the hash function. The inclusion of the length makesthe job of the opponent more difficult. MessageAuthentication Codes ● There is much more variety in the structure of MACs than in hash functions, so it is difficult to generalize about the cryptanalysis of MACs. Further, far less work has been done on developing such attacks. Sarthak Patel (www.sarthakpatel.in) 25
  • 26. Message Digests(Hash) ● Amessage digest is afingerprint or the summary of a message. (Same as LRC and CRC) ● It is used to verify integrity of the data (Toensure that message hasnot been tampered). ● Ex. LRC- paritychecking Sarthak Patel (www.sarthakpatel.in) 26
  • 27. Idea of a Message Digest ● Ex: Calculate the message digest ofnumber 7391743 ● Multiply each digit in the number with the next digit (excluding if it is 0) and disregarding the first digit of the multiplication operation, it the result is two-digit number. Sarthak Patel (www.sarthakpatel.in) 27
  • 28. Calculate MD for 7391743 ● Multiply 7 by 3 - 21 ● Discard first digit - 1 ● Multiply 1 by 9 - 9 ● Multiply 9 by 1 - 9 ● Multiply 9 by 7 - 63 ● Discard first digit - 3 ● Multiply 3 by 4 - 12 ● Discard first digit - 2 ● Multiply 2 by 3 - 6 Sarthak Patel (www.sarthakpatel.in) 28 ● Message digest is 6
  • 29. MD5 (Message Digest 5) ● MD5is amessage digest algorithm developed byRon Rivest. ● MD5algorithm can be used asadigital signature mechanism. Sarthak Patel (www.sarthakpatel.in) 29
  • 30. Description of the MD5 Algorithm ● Takesasinput amessage of arbitrary length and produces as output a128 bit “fingerprint”or “messagedigest”ofthe input. ● It it is computationally infeasible to produce two messages havingthe same message digest. ● Intended where alarge file must be“compressed”in asecure manner before being encrypted with aprivate keyunder a public-keycryptosystem such as PGP . Sarthak Patel (www.sarthakpatel.in) 30
  • 31. MD5 Algorithm ● Suppose ab-bit message asinput, and that we need to find its message digest. Step-1 Padding Step-2Append length Step-3 Divide the input into 512-bit blocks. Step-4 Initialize chainingvariables (4 variables) Step-5 Processblocks Sarthak Patel (www.sarthakpatel.in) 31
  • 32. Step-1 ● MD5 isto add paddingbitsto the original message. ● The aim of this step is make length of the original message equal to avalue,which is 64 bits less than an exact multiple of512. ● Ex: 1000 bitsofmessage (1000+472+64) ● The paddingconsists ofasingle“1”bit is appended to the message, and then“0”bits. Sarthak Patel (www.sarthakpatel.in) 32
  • 33. Step 2 – append length: ● A64 bit representation of b is appended to the result of the previousstep. ● The resulting messagehasa length that is an exact multiple of 512 bits Sarthak Patel (www.sarthakpatel.in) 33
  • 34. Step-3 Divide the input into 512-bit blocks Data to be hashed (Digested) 1536 bits 512 bits 512 bits 512 bits Sarthak Patel (www.sarthakpatel.in) 34
  • 35. Step-4 Initialize chaining variables ● Afour-word buffer (A,B,C,D) is used to compute the message digest. ● Here each ofA,B,C,D, is a32 bit register. Sarthak Patel (www.sarthakpatel.in) 35
  • 36. Step-5 Process blocks 1. – Copythe four variables(32*4 = 128) 2. – Divide the 512- bit block into 16 sub-blocks. 512 bits 5.3 – Processeach block withA, B, C, D. 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 bits bits bits bits bits bits bits bits bits bits bits bits bits bits bits bits Sarthak Patel (www.sarthakpatel.in) 36
  • 37. 5.3 - Process each block with A, B, C, D. Sarthak Patel (www.sarthakpatel.in) 37
  • 38. Secure Hash Algorithm (SHA) ● SHA-1 producesahash value of160 bits. ● SHAisdesigned to be computationally infeasible to: ● Obtain the original message ● Find two messageproducing the same MD. Sarthak Patel (www.sarthakpatel.in) 38
  • 39. Types(Versions) of SHA Sarthak Patel (www.sarthakpatel.in) 39
  • 40. Algorithm Step-1 Padding Step-2Append length Step-3 Divide the input into 512-bit blocks. Step-4 Initialize chaining variables (5 varibles) Step-5 Process blocks Sarthak Patel (www.sarthakpatel.in) 40
  • 41. 5.3- Process each block with A, B, C, D, E. Sarthak Patel (www.sarthakpatel.in) 41
  • 42. Comparison of MD5 & SHA-1 Points of Discussion MD5 SHA-1 MD length in bits 128 160 Attack try to find MD 2128 2160 Attack try to find two messages producing same message digest 264 280 Speed Faster Slower Sarthak Patel (www.sarthakpatel.in) 42
  • 43. RACE Integrity Primitives Evaluation Message Digest (RIPEMD-160) ● RIPEMD is a cryptographic hash based upon MD4. It's been shown to have weaknesses and has been replaced by RIPEMD-128 and RIPMD-160. These are cryptographic hash functions designed by Hans Dobbertin, Antoon Bosselaers, and Bart Preneel. ● RIPEMD-160 produces a hash of the same length as SHA1 but is slightly slower. RIPEMD-128 has been designed as a drop-in replacement for MD4/MD5 whilst avoiding some of the weaknesses shown for these two algorithms. It is about halfthe speed ofMD5. Sarthak Patel (www.sarthakpatel.in) 43
  • 44. HMAC(Hash-Based MAC) ● HMAC has been chosen as a security implementation for Internet Protocol (IP) and Secure Socket Layer(SSL), widely used in internet. ● The fundamental idea of HMAC is to reuse the existing MD5 or SHA-1. Sarthak Patel (www.sarthakpatel.in) 44
  • 45. Original message Existing MD5 or SHA-1 MD Encrypt HMA C Sarthak Patel (www.sarthakpatel.in) K
  • 46. How HMAC works? ● MD- Message Digest/ Hash function ● M– Input message ● ipad-Astring00110110 repeated b/ 8 times ● opqd-Astring01011010 repeated b/ 8 times Sarthak Patel (www.sarthakpatel.in) 46
  • 47. How HMAC works? ● Step-1 Make the lengthofKequal to b ● Length K<b (Append 0 – left side) ● Length K=b (Step -2) ● Length K>b (Hash Kreduce itslengthto b) ● Step- 2 XOR Kwith ipad to produce S1 ● Step -3Append Mto S1 ● Step -4 Message Digest algorithm ● Step -5 XOR Kwith opad to produce S2 ● Step -6Append H toS2 ● Message DigestAlgorithm Sarthak Patel (www.sarthakpatel.in) 47