SlideShare a Scribd company logo
Message
Authentication
with MD5
組員:張安邦、楊志璿
Outline
1. MD5
2. MAC
3. Author recommendations
4. Extension attack
5. Our idea
Note
● All sudo code in Lua
○ .. means concat
○ Because Lua needs more love
MD5
● How MD5 works?
● reference : https://www.slideshare.net/sahilkureel/md5-algorithm
MD5
● message-digest 5
● A hash function
● 128 bit
MD5
1. Pad the message so #msg%56 == 0
a. A 1 bit is first appended, then 0s
MD5
2. Append the B value (4 bytes) to the end. So the the message is now a multiple
of 64 bytes
MD5
3. The a, b, c, d parameters are initalized to the following values
MD5
4. Do some computing
MD5
5. The a, b, c, d variables ended up is the hash value
TL;DR
● Attempts to reduce overhead of MAC based on DES
○ DES is designed for hardware
○ Slow on software
● Use fast software hash functions
○ MD5
MAC - Message Authentication Code
● Given a message, it is difficult to compute the auth code without the secret
key.
● Both sender and resever have key K.
● A message is send to the reseiver along with the MAC
● Receiver computes the MAC himself and check is they are the same
○ Checksum for messages keys
MAC - Message Authentication Code
src: wiki
MAC - Message Authentication Code
K1 and K2 are two indipendent 128-bit values
Paper perposal
Paper perposal
Where p is a 348-bit padding and k is a 128-bit key
Paper perposal
Where k is a 128-bit key
Extension attack
For Hash(m1), we know m1.length() and Hash(m1)
We can calculate Hash(m1 ‖ m2) for any attacker-controlled m2
without needing to know the content of m1
Extension attack
Original Data: count=10&lat=37.351&user_id=1&long=-119.827&waffle=eggo
Original Signature: 6d5f807e23db210bc254a28be2d6759a0f5f5d99
Key length is 14 bytes
Desired New Data: count=10&lat=37.351&user_id=1&long=-
119.827&waffle=eggo&waffle=liege
Extension attack
Desired New Data: count=10&lat=37.351&user_id=1&long=-
119.827&waffle=eggo&waffle=liege
New Data: count=10&lat=37.351&user_id=1&long=-
119.827&waffle=eggox80x00x00x00x00x00x00x00x00x00x00x00x0
0x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00
x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x0
0x00x00x00x00x00x00x00x00x02x28&waffle=liege
New Signature: 0e41270260895979317fff3898ab85668953aaa2
Extension attack
Because MD5 is an iterative function
Authors thoughts
● AES can be used intead of MD5
● More secure with the same procedure
Our thoughts
● Anthough MD5 is old and shouldn’t be used
● Brute forcing a 128bit key still takes forever
○ A single RTX 2080Ti can do 21.6 GH/s
○ 35794002499.47684 times the age of univers to solve
○ Numbers from hashcat
● No too bad for per message auth
Our thoughts
● Attempts to reduce overhead of MAC based on DES
○ DES is not that slow
● Use fast software hash functions
○ Modern x86/ARM have AES instructions
○ Faster hash rate than MD5
○ Use AES when possible

More Related Content

PDF
MD-5 : Algorithm
PPTX
Message Authentication using Message Digests and the MD5 Algorithm
PPTX
Basic explanation to md5 implementation in C
PPTX
Cryptographic hash function md5
PPT
Secure hashing algorithm
PPT
Hash Function & Analysis
PPTX
Hash Techniques in Cryptography
MD-5 : Algorithm
Message Authentication using Message Digests and the MD5 Algorithm
Basic explanation to md5 implementation in C
Cryptographic hash function md5
Secure hashing algorithm
Hash Function & Analysis
Hash Techniques in Cryptography

What's hot (20)

PPT
MD5Algorithm
PPTX
Cryptography Ashik
PDF
Hashing Algorithm: MD5
PPTX
Information and data security cryptographic hash functions
PPT
Hash crypto
PPTX
Hash function
PDF
The MD5 hashing algorithm
PDF
A technical writing on cryptographic hash function md5
PPTX
Secure Hashing Techniques - Introduction
PPTX
Message digest 5
PDF
A Comparative Analysis between SHA and MD5 algorithms
PPTX
Hash Function
PPT
Hash& mac algorithms
PPTX
Cryptographic Hashing Functions
PDF
PPT
Message Authentication Code & HMAC
PPT
01204427-Hash_Crypto (1).ppt
PDF
The SHA Hashing Algorithm
PPT
MD5Algorithm
Cryptography Ashik
Hashing Algorithm: MD5
Information and data security cryptographic hash functions
Hash crypto
Hash function
The MD5 hashing algorithm
A technical writing on cryptographic hash function md5
Secure Hashing Techniques - Introduction
Message digest 5
A Comparative Analysis between SHA and MD5 algorithms
Hash Function
Hash& mac algorithms
Cryptographic Hashing Functions
Message Authentication Code & HMAC
01204427-Hash_Crypto (1).ppt
The SHA Hashing Algorithm
Ad

Similar to Message authentication with md5 (20)

PPT
Message Authentication Requirement-MAC
PPT
Information and data security cryptography and network security
PDF
Computer network system presentation pdf
PPTX
unit4- predicate logic in artificial intelligence
PPTX
MAC-Message Authentication Codes
PPTX
Cryptography and network_security
PPT
Message Authentication
PDF
Message Authentication and Hash Function.pdf
PPT
Network Security Lec5
PPT
Message Authentication: MAC, Hashes
PPT
Message authentication
 
PDF
Cs8792 cns - unit iv
PDF
Cs8792 cns - unit iv
PPT
cryptography and network security by william stallings
PPTX
Meessage authentication and hash functions.pptx
PPT
ch11.ppt
PPTX
Academy PRO: Cryptography 3
PPT
ch11.ppt
PDF
Cns
Message Authentication Requirement-MAC
Information and data security cryptography and network security
Computer network system presentation pdf
unit4- predicate logic in artificial intelligence
MAC-Message Authentication Codes
Cryptography and network_security
Message Authentication
Message Authentication and Hash Function.pdf
Network Security Lec5
Message Authentication: MAC, Hashes
Message authentication
 
Cs8792 cns - unit iv
Cs8792 cns - unit iv
cryptography and network security by william stallings
Meessage authentication and hash functions.pptx
ch11.ppt
Academy PRO: Cryptography 3
ch11.ppt
Cns
Ad

Recently uploaded (20)

PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPTX
international classification of diseases ICD-10 review PPT.pptx
PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PPTX
artificial intelligence overview of it and more
PDF
The Internet -By the Numbers, Sri Lanka Edition
DOCX
Unit-3 cyber security network security of internet system
PDF
Introduction to the IoT system, how the IoT system works
PPTX
Digital Literacy And Online Safety on internet
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PDF
Testing WebRTC applications at scale.pdf
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PptxGenJS_Demo_Chart_20250317130215833.pptx
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
Module 1 - Cyber Law and Ethics 101.pptx
An introduction to the IFRS (ISSB) Stndards.pdf
Unit-1 introduction to cyber security discuss about how to secure a system
Decoding a Decade: 10 Years of Applied CTI Discipline
Design_with_Watersergyerge45hrbgre4top (1).ppt
international classification of diseases ICD-10 review PPT.pptx
Slides PDF The World Game (s) Eco Economic Epochs.pdf
artificial intelligence overview of it and more
The Internet -By the Numbers, Sri Lanka Edition
Unit-3 cyber security network security of internet system
Introduction to the IoT system, how the IoT system works
Digital Literacy And Online Safety on internet
WebRTC in SignalWire - troubleshooting media negotiation
522797556-Unit-2-Temperature-measurement-1-1.pptx
Testing WebRTC applications at scale.pdf
Power Point - Lesson 3_2.pptx grad school presentation
Introuction about ICD -10 and ICD-11 PPT.pptx
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx

Message authentication with md5

  • 2. Outline 1. MD5 2. MAC 3. Author recommendations 4. Extension attack 5. Our idea
  • 3. Note ● All sudo code in Lua ○ .. means concat ○ Because Lua needs more love
  • 4. MD5 ● How MD5 works? ● reference : https://www.slideshare.net/sahilkureel/md5-algorithm
  • 5. MD5 ● message-digest 5 ● A hash function ● 128 bit
  • 6. MD5 1. Pad the message so #msg%56 == 0 a. A 1 bit is first appended, then 0s
  • 7. MD5 2. Append the B value (4 bytes) to the end. So the the message is now a multiple of 64 bytes
  • 8. MD5 3. The a, b, c, d parameters are initalized to the following values
  • 9. MD5 4. Do some computing
  • 10. MD5 5. The a, b, c, d variables ended up is the hash value
  • 11. TL;DR ● Attempts to reduce overhead of MAC based on DES ○ DES is designed for hardware ○ Slow on software ● Use fast software hash functions ○ MD5
  • 12. MAC - Message Authentication Code ● Given a message, it is difficult to compute the auth code without the secret key. ● Both sender and resever have key K. ● A message is send to the reseiver along with the MAC ● Receiver computes the MAC himself and check is they are the same ○ Checksum for messages keys
  • 13. MAC - Message Authentication Code src: wiki
  • 14. MAC - Message Authentication Code
  • 15. K1 and K2 are two indipendent 128-bit values Paper perposal
  • 16. Paper perposal Where p is a 348-bit padding and k is a 128-bit key
  • 17. Paper perposal Where k is a 128-bit key
  • 18. Extension attack For Hash(m1), we know m1.length() and Hash(m1) We can calculate Hash(m1 ‖ m2) for any attacker-controlled m2 without needing to know the content of m1
  • 19. Extension attack Original Data: count=10&lat=37.351&user_id=1&long=-119.827&waffle=eggo Original Signature: 6d5f807e23db210bc254a28be2d6759a0f5f5d99 Key length is 14 bytes Desired New Data: count=10&lat=37.351&user_id=1&long=- 119.827&waffle=eggo&waffle=liege
  • 20. Extension attack Desired New Data: count=10&lat=37.351&user_id=1&long=- 119.827&waffle=eggo&waffle=liege New Data: count=10&lat=37.351&user_id=1&long=- 119.827&waffle=eggox80x00x00x00x00x00x00x00x00x00x00x00x0 0x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00 x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x0 0x00x00x00x00x00x00x00x00x02x28&waffle=liege New Signature: 0e41270260895979317fff3898ab85668953aaa2
  • 21. Extension attack Because MD5 is an iterative function
  • 22. Authors thoughts ● AES can be used intead of MD5 ● More secure with the same procedure
  • 23. Our thoughts ● Anthough MD5 is old and shouldn’t be used ● Brute forcing a 128bit key still takes forever ○ A single RTX 2080Ti can do 21.6 GH/s ○ 35794002499.47684 times the age of univers to solve ○ Numbers from hashcat ● No too bad for per message auth
  • 24. Our thoughts ● Attempts to reduce overhead of MAC based on DES ○ DES is not that slow ● Use fast software hash functions ○ Modern x86/ARM have AES instructions ○ Faster hash rate than MD5 ○ Use AES when possible