SlideShare a Scribd company logo
1 of 16
MD5 ALGORITHM
DESIGN AND ITS
WORKING
BY
S.Rajapriya, MS(IT).,
Assistant Professor of IT
V.V.Vanniaperumal College for Women
Message Authentication
Code (MAC)
 MAC algorithm is a symmetric key cryptographic technique to
provide message authentication. For establishing MAC process,
the sender and receiver share a symmetric key K.
 Essentially, a MAC is an encrypted checksum generated on the
underlying message that is sent along with a message to ensure
message authentication.
MD5 Design
 MD5 (Message Digest Method 5) is a cryptographic hash algorithm
used to generate a 128-bit digest from a string of any length.
 It represents the digests as 32 digit hexadecimal numbers.
 Ronald Rivest designed this algorithm in 1991 to provide the means
for digital signature verification.
 The digest size is always 128 bits, and thanks to hashing function
guidelines, a minor change in the input string generate a drastically
different digest.
 This is essential to prevent similar hash generation as much as
possible, also known as a hash collision.
Working of the MD5
Algorithm
MD5 algorithm follows the following steps :
Step 1. Append Padding Bits: In the first step, we add padding
bits in the original message in such a way that the total length of
the message is 64 bits less than the exact multiple of 512.
 Suppose we are given a message of 1000 bits. Now we have to
add padding bits to the original message. Here we will add 472
padding bits to the original message.
 After adding the padding bits the size of the original
message/output of the first step will be 1472 i.e. 64 bits less than
an exact multiple of 512 (i.e. 512*3 = 1536).
 Length(original message + padding bits) = 512 * i – 64 where i =
1,2,3 . . .
Step 2.Append Length Bits:
 In this step, we add the length bit in the output of the first step in
such a way that the total number of the bits is the perfect multiple
of 512. Simply, here we add the 64-bit as a length bit in the output
of the first step.
 i.e. output of first step = 512 * n – 64
 length bits = 64. After adding both we will get 512 * n i.e. the exact
multiple of 512.
Step 3. Initialize MD buffer:
 Here, we use the 4 buffers i.e. J, K, L, and M. The size of each
buffer is 32 bits.
- J = 0x67425301
- K = 0xEDFCBA45
- L = 0x98CBADFE
- M = 0x13DCE476
Step 4.Process Each 512-bit Block:
 This is the most important step of the MD5 algorithm. Here, a
total of 64 operations are performed in 4 rounds.
 In the 1st round, 16 operations will be performed, 2nd round 16
operations will be performed, 3rd round 16 operations will be
performed, and in the 4th round, 16 operations will be performed.
 We apply a different function on each round i.e. for the 1st round
we apply the F function, for the 2nd G function, 3rd for the H
function, and 4th for the I function.
 We perform OR, AND, XOR, and NOT (basically these are
logic gates) for calculating functions. We use 3 buffers for each
function i.e. K, L, M.
- F(K,L,M) = (K AND L) OR (NOT K AND M)
- G(K,L,M) = (K AND L) OR (L AND NOT M)
- H(K,L,M) = K XOR L XOR M
- I(K,L,M) = L XOR (K OR NOT M)
 After applying the function now we perform an operation on
each block. For performing operations we need
• add modulo 232
• M[i] – 32 bit message.
• K[i] – 32-bit constant.
• <<<n – Left shift by n bits.
 Now take input as initialize MD buffer i.e. J, K, L, M. Output of K
will be fed in L, L will be fed into M, and M will be fed into J. After
doing this now we perform some operations to find the output for J.
• In the first step, Outputs of K, L, and M are taken and then the
function F is applied to them. We will add modulo 232 bits for
the output of this with J.
• In the second step, we add the M[i] bit message with the
output of the first step.
• Then add 32 bits constant i.e. K[i] to the output of the second
step.
• At last, we do left shift operation by n (can be any value of n)
and addition modulo by 232.
 After all steps, the result of J will be fed into K. Now same
steps will be used for all functions G, H, and I. After
performing all 64 operations we will get our message digest.
Output:
After all, rounds have been performed, the buffer J, K, L, and M
contains the MD5 output starting with the lower bit J and ending
with Higher bits M.
Application Of MD5
Algorithm
 We use message digest to verify the integrity of files/
authenticates files.
 MD5 was used for data security and encryption.
 It is used to Digest the message of any size and also used for
Password verification.
 For Game Boards and Graphics.
Advantages of MD5
Algorithm
 MD5 is faster and simple to understand.
 MD5 algorithm generates a strong password in 16 bytes format.
All developers like web developers etc use the MD5 algorithm
to secure the password of users.
 To integrate the MD5 algorithm, relatively low memory is
necessary.
 It is very easy and faster to generate a digest message of the
original message
Disadvantages of MD5
Algorithm
 MD5 generates the same hash function for different inputs.
 MD5 provides poor security over SHA1.
 MD5 has been considered an insecure algorithm. So now we
are using SHA256 instead of MD5
 MD5 is neither a symmetric nor asymmetric algorithm
MD5 Algorithm Design and Working Explained

More Related Content

What's hot

Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniquesDr.Florence Dayana
 
2. Stream Ciphers
2. Stream Ciphers2. Stream Ciphers
2. Stream CiphersSam Bowne
 
CMACs and MACS based on block ciphers, Digital signature
CMACs and MACS based on block ciphers, Digital signatureCMACs and MACS based on block ciphers, Digital signature
CMACs and MACS based on block ciphers, Digital signatureAdarsh Patel
 
Data Encryption Standard (DES)
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)Haris Ahmed
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash functionChirag Patel
 
SHA 1 Algorithm.ppt
SHA 1 Algorithm.pptSHA 1 Algorithm.ppt
SHA 1 Algorithm.pptRajapriya82
 
6. cryptography
6. cryptography6. cryptography
6. cryptography7wounders
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.pptUday Meena
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithmsRashmi Burugupalli
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation harshit chavda
 
block ciphers
block ciphersblock ciphers
block ciphersAsad Ali
 
PUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONraf_slide
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to CryptographySeema Goel
 
Digital Signature Standard
Digital Signature StandardDigital Signature Standard
Digital Signature StandardSou Jana
 
Message Authentication
Message AuthenticationMessage Authentication
Message Authenticationchauhankapil
 

What's hot (20)

Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
2. Stream Ciphers
2. Stream Ciphers2. Stream Ciphers
2. Stream Ciphers
 
CMACs and MACS based on block ciphers, Digital signature
CMACs and MACS based on block ciphers, Digital signatureCMACs and MACS based on block ciphers, Digital signature
CMACs and MACS based on block ciphers, Digital signature
 
Modes of Operation
Modes of Operation Modes of Operation
Modes of Operation
 
Data Encryption Standard (DES)
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash function
 
SHA 1 Algorithm.ppt
SHA 1 Algorithm.pptSHA 1 Algorithm.ppt
SHA 1 Algorithm.ppt
 
6. cryptography
6. cryptography6. cryptography
6. cryptography
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithms
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation
 
block ciphers
block ciphersblock ciphers
block ciphers
 
Hash function
Hash function Hash function
Hash function
 
Hash Function
Hash FunctionHash Function
Hash Function
 
PUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTION
 
S/MIME
S/MIMES/MIME
S/MIME
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Rc4
Rc4Rc4
Rc4
 
Digital Signature Standard
Digital Signature StandardDigital Signature Standard
Digital Signature Standard
 
Message Authentication
Message AuthenticationMessage Authentication
Message Authentication
 

Similar to MD5 Algorithm Design and Working Explained

A Comparative Analysis between SHA and MD5 algorithms
A Comparative Analysis between SHA and MD5 algorithms A Comparative Analysis between SHA and MD5 algorithms
A Comparative Analysis between SHA and MD5 algorithms Er Piyush Gupta IN ⊞⌘
 
Data streaming algorithms
Data streaming algorithmsData streaming algorithms
Data streaming algorithmsHridyesh Bisht
 
Basic explanation to md5 implementation in C
Basic explanation to md5 implementation in CBasic explanation to md5 implementation in C
Basic explanation to md5 implementation in CSourav Punoriyar
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithmsYoung Alista
 
Hash& mac algorithms
Hash& mac algorithmsHash& mac algorithms
Hash& mac algorithmsHarry Potter
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithmsJames Wong
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithmsTony Nguyen
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithmsFraboni Ec
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithmsDavid Hoen
 
Cryptography Key Management.pptx
Cryptography Key Management.pptxCryptography Key Management.pptx
Cryptography Key Management.pptxSurendraBasnet6
 
An Enhanced Message Digest Hash Algorithm for Information Security
An Enhanced Message Digest Hash Algorithm for Information SecurityAn Enhanced Message Digest Hash Algorithm for Information Security
An Enhanced Message Digest Hash Algorithm for Information Securitypaperpublications3
 
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...IJEACS
 
A Comparative Study between RSA and MD5 algorithms
A Comparative Study between RSA and MD5 algorithms A Comparative Study between RSA and MD5 algorithms
A Comparative Study between RSA and MD5 algorithms Er Piyush Gupta IN ⊞⌘
 

Similar to MD5 Algorithm Design and Working Explained (20)

A Comparative Analysis between SHA and MD5 algorithms
A Comparative Analysis between SHA and MD5 algorithms A Comparative Analysis between SHA and MD5 algorithms
A Comparative Analysis between SHA and MD5 algorithms
 
MD5
MD5MD5
MD5
 
Cryptographic hash function md5
Cryptographic hash function md5Cryptographic hash function md5
Cryptographic hash function md5
 
Unit-3.pdf
Unit-3.pdfUnit-3.pdf
Unit-3.pdf
 
Data streaming algorithms
Data streaming algorithmsData streaming algorithms
Data streaming algorithms
 
MD5.pptx.pdf
MD5.pptx.pdfMD5.pptx.pdf
MD5.pptx.pdf
 
D44091720
D44091720D44091720
D44091720
 
Basic explanation to md5 implementation in C
Basic explanation to md5 implementation in CBasic explanation to md5 implementation in C
Basic explanation to md5 implementation in C
 
Message Authentication
Message AuthenticationMessage Authentication
Message Authentication
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Hash& mac algorithms
Hash& mac algorithmsHash& mac algorithms
Hash& mac algorithms
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Cryptography Key Management.pptx
Cryptography Key Management.pptxCryptography Key Management.pptx
Cryptography Key Management.pptx
 
An Enhanced Message Digest Hash Algorithm for Information Security
An Enhanced Message Digest Hash Algorithm for Information SecurityAn Enhanced Message Digest Hash Algorithm for Information Security
An Enhanced Message Digest Hash Algorithm for Information Security
 
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
 
A Comparative Study between RSA and MD5 algorithms
A Comparative Study between RSA and MD5 algorithms A Comparative Study between RSA and MD5 algorithms
A Comparative Study between RSA and MD5 algorithms
 

More from Rajapriya82

Applications of IoTs in Home,City,Health
Applications of IoTs in Home,City,HealthApplications of IoTs in Home,City,Health
Applications of IoTs in Home,City,HealthRajapriya82
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptxRajapriya82
 
File System Implementation.pptx
File System Implementation.pptxFile System Implementation.pptx
File System Implementation.pptxRajapriya82
 
Consensus Algorithms.pptx
Consensus Algorithms.pptxConsensus Algorithms.pptx
Consensus Algorithms.pptxRajapriya82
 
Security services and mechanisms
Security services and mechanismsSecurity services and mechanisms
Security services and mechanismsRajapriya82
 
Wireless transmission
Wireless transmissionWireless transmission
Wireless transmissionRajapriya82
 
Guided Transmission Media
Guided  Transmission MediaGuided  Transmission Media
Guided Transmission MediaRajapriya82
 
Input of graphical data
Input of graphical dataInput of graphical data
Input of graphical dataRajapriya82
 

More from Rajapriya82 (12)

Applications of IoTs in Home,City,Health
Applications of IoTs in Home,City,HealthApplications of IoTs in Home,City,Health
Applications of IoTs in Home,City,Health
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
 
File System Implementation.pptx
File System Implementation.pptxFile System Implementation.pptx
File System Implementation.pptx
 
Consensus Algorithms.pptx
Consensus Algorithms.pptxConsensus Algorithms.pptx
Consensus Algorithms.pptx
 
Security services and mechanisms
Security services and mechanismsSecurity services and mechanisms
Security services and mechanisms
 
Wireless transmission
Wireless transmissionWireless transmission
Wireless transmission
 
Guided Transmission Media
Guided  Transmission MediaGuided  Transmission Media
Guided Transmission Media
 
Input of graphical data
Input of graphical dataInput of graphical data
Input of graphical data
 
Clipping
ClippingClipping
Clipping
 
Heaptree
HeaptreeHeaptree
Heaptree
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock
DeadlockDeadlock
Deadlock
 

Recently uploaded

Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

MD5 Algorithm Design and Working Explained

  • 1. MD5 ALGORITHM DESIGN AND ITS WORKING BY S.Rajapriya, MS(IT)., Assistant Professor of IT V.V.Vanniaperumal College for Women
  • 2. Message Authentication Code (MAC)  MAC algorithm is a symmetric key cryptographic technique to provide message authentication. For establishing MAC process, the sender and receiver share a symmetric key K.  Essentially, a MAC is an encrypted checksum generated on the underlying message that is sent along with a message to ensure message authentication.
  • 3. MD5 Design  MD5 (Message Digest Method 5) is a cryptographic hash algorithm used to generate a 128-bit digest from a string of any length.  It represents the digests as 32 digit hexadecimal numbers.  Ronald Rivest designed this algorithm in 1991 to provide the means for digital signature verification.  The digest size is always 128 bits, and thanks to hashing function guidelines, a minor change in the input string generate a drastically different digest.  This is essential to prevent similar hash generation as much as possible, also known as a hash collision.
  • 4. Working of the MD5 Algorithm MD5 algorithm follows the following steps : Step 1. Append Padding Bits: In the first step, we add padding bits in the original message in such a way that the total length of the message is 64 bits less than the exact multiple of 512.
  • 5.  Suppose we are given a message of 1000 bits. Now we have to add padding bits to the original message. Here we will add 472 padding bits to the original message.  After adding the padding bits the size of the original message/output of the first step will be 1472 i.e. 64 bits less than an exact multiple of 512 (i.e. 512*3 = 1536).  Length(original message + padding bits) = 512 * i – 64 where i = 1,2,3 . . .
  • 6. Step 2.Append Length Bits:  In this step, we add the length bit in the output of the first step in such a way that the total number of the bits is the perfect multiple of 512. Simply, here we add the 64-bit as a length bit in the output of the first step.  i.e. output of first step = 512 * n – 64  length bits = 64. After adding both we will get 512 * n i.e. the exact multiple of 512.
  • 7. Step 3. Initialize MD buffer:  Here, we use the 4 buffers i.e. J, K, L, and M. The size of each buffer is 32 bits. - J = 0x67425301 - K = 0xEDFCBA45 - L = 0x98CBADFE - M = 0x13DCE476
  • 8. Step 4.Process Each 512-bit Block:  This is the most important step of the MD5 algorithm. Here, a total of 64 operations are performed in 4 rounds.  In the 1st round, 16 operations will be performed, 2nd round 16 operations will be performed, 3rd round 16 operations will be performed, and in the 4th round, 16 operations will be performed.  We apply a different function on each round i.e. for the 1st round we apply the F function, for the 2nd G function, 3rd for the H function, and 4th for the I function.
  • 9.  We perform OR, AND, XOR, and NOT (basically these are logic gates) for calculating functions. We use 3 buffers for each function i.e. K, L, M. - F(K,L,M) = (K AND L) OR (NOT K AND M) - G(K,L,M) = (K AND L) OR (L AND NOT M) - H(K,L,M) = K XOR L XOR M - I(K,L,M) = L XOR (K OR NOT M)
  • 10.  After applying the function now we perform an operation on each block. For performing operations we need • add modulo 232 • M[i] – 32 bit message. • K[i] – 32-bit constant. • <<<n – Left shift by n bits.
  • 11.  Now take input as initialize MD buffer i.e. J, K, L, M. Output of K will be fed in L, L will be fed into M, and M will be fed into J. After doing this now we perform some operations to find the output for J. • In the first step, Outputs of K, L, and M are taken and then the function F is applied to them. We will add modulo 232 bits for the output of this with J. • In the second step, we add the M[i] bit message with the output of the first step. • Then add 32 bits constant i.e. K[i] to the output of the second step. • At last, we do left shift operation by n (can be any value of n) and addition modulo by 232.
  • 12.  After all steps, the result of J will be fed into K. Now same steps will be used for all functions G, H, and I. After performing all 64 operations we will get our message digest. Output: After all, rounds have been performed, the buffer J, K, L, and M contains the MD5 output starting with the lower bit J and ending with Higher bits M.
  • 13. Application Of MD5 Algorithm  We use message digest to verify the integrity of files/ authenticates files.  MD5 was used for data security and encryption.  It is used to Digest the message of any size and also used for Password verification.  For Game Boards and Graphics.
  • 14. Advantages of MD5 Algorithm  MD5 is faster and simple to understand.  MD5 algorithm generates a strong password in 16 bytes format. All developers like web developers etc use the MD5 algorithm to secure the password of users.  To integrate the MD5 algorithm, relatively low memory is necessary.  It is very easy and faster to generate a digest message of the original message
  • 15. Disadvantages of MD5 Algorithm  MD5 generates the same hash function for different inputs.  MD5 provides poor security over SHA1.  MD5 has been considered an insecure algorithm. So now we are using SHA256 instead of MD5  MD5 is neither a symmetric nor asymmetric algorithm