hollywood style decryption
DESCRIPTION
Hollywood style decryption - Rizki WicaksonoTRANSCRIPT
![Page 1: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/1.jpg)
“Hollywood Style Decryption”
on Block Cipher-CBC Rizki Wicaksono / ilmuHacking.com
![Page 2: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/2.jpg)
Rizki Wicaksono
• Penetration tester
• Programming, application security, cryptography
• S1 Teknik Informatika ITB, ECSP, OSWP, ITIL-F
• ilmuHacking.com , facebook.com/ilmuHacking
![Page 3: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/3.jpg)
Hollywood Style Password Cracking
![Page 4: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/4.jpg)
Lets Watch Some Movies
![Page 5: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/5.jpg)
Resident Evil Breaking Door Key Scene
![Page 6: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/6.jpg)
Terminator 2 ATM PIN Cracking Scene
![Page 7: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/7.jpg)
Wargame Launch Code Hacking Scene
![Page 8: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/8.jpg)
The Matrix Beginning Scene
![Page 9: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/9.jpg)
Bloodfist IV Passcode Breaking Scene
![Page 10: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/10.jpg)
Hollywood Style Decryption with
Padding Oracle Attack
![Page 11: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/11.jpg)
Sample Real Attack
![Page 12: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/12.jpg)
Morpheus: Let’s Go See the Oracle
![Page 13: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/13.jpg)
The Oracle
![Page 14: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/14.jpg)
Padding Oracle: Valid/Invalid Pad
![Page 15: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/15.jpg)
1 Bit Information Leakage
![Page 16: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/16.jpg)
PKCS#7 Valid Padding
![Page 17: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/17.jpg)
PKCS#7 Invalid Padding
![Page 18: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/18.jpg)
Cipher Block Chaining
![Page 19: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/19.jpg)
CBC Mode Encryption
![Page 20: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/20.jpg)
CBC Mode Decryption
![Page 21: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/21.jpg)
Malleability
![Page 22: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/22.jpg)
Enough Talking, Start Cracking!
![Page 23: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/23.jpg)
Sample Case
• Decrypt this: 2D7850F447A90B87123B36A038A8682F
• Split into two 8 byte blocks: • C1 = 2D7850F447A90B87
• C2 = 123B36A038A8682F
• Decrypt C2 first, send two block to oracle: • One block + 123B36A038A8682F
• Decrypt one byte at a time (“hollywood style”) starting from the last byte
![Page 24: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/24.jpg)
Decrypt Last Byte
![Page 25: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/25.jpg)
Ask the Oracle
• A xor B = 01. Find A and B!
• Ask the Oracle: • A xor 0 = 01 ?
• A xor 1 = 01 ?
• ….
• A xor 255 = 01 ?
• Oracle answer: • Valid pad = Yes
• Invalid pad = No
![Page 26: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/26.jpg)
Look for Valid Single Byte Pad
![Page 27: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/27.jpg)
Valid Single Byte Pad Found!
![Page 28: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/28.jpg)
Last Byte Decrypted
![Page 29: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/29.jpg)
Last Byte = 0x86
• A xor B = 01. Find A and B!
• Ask the Oracle: • A xor 0x85 = 01 ?
• Oracle answer: • Valid pad = Yes
• A must be 0x86
![Page 30: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/30.jpg)
Decrypt 7th Byte
![Page 31: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/31.jpg)
Decrypt 7th Byte
![Page 32: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/32.jpg)
Look for Valid 2 Byte Pad
![Page 33: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/33.jpg)
Valid 2 Byte Pad Found!
![Page 34: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/34.jpg)
7th Byte Decrypted
![Page 35: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/35.jpg)
Decrypt 6th Byte
![Page 36: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/36.jpg)
Decrypt 6th Byte
![Page 37: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/37.jpg)
Valid 3 Byte Pad Found
![Page 38: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/38.jpg)
6th Byte Decrypted
![Page 39: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/39.jpg)
Decrypt 5th Byte
![Page 40: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/40.jpg)
Decrypt 5th Byte
![Page 41: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/41.jpg)
Valid 4 Byte Pad Found
![Page 42: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/42.jpg)
5th Byte Decrypted
![Page 43: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/43.jpg)
Decrypt 4th Byte
![Page 44: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/44.jpg)
Decrypt 4th Byte
![Page 45: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/45.jpg)
Look for Valid 5 Byte Pad
![Page 46: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/46.jpg)
Valid 5 Byte Pad Found
![Page 47: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/47.jpg)
4th Byte Decrypted
![Page 48: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/48.jpg)
Full Block Decrypted
![Page 49: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/49.jpg)
C2 Block Decrypted
![Page 50: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/50.jpg)
Case
![Page 51: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/51.jpg)
The Oracle
![Page 52: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/52.jpg)
Decryptor
![Page 53: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/53.jpg)
Decryption Demo
![Page 54: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/54.jpg)
Encrypt Fake Message
![Page 55: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/55.jpg)
Encrypt without Knowing the Key
• You can make cipher text say whatever you want when decrypted
• Property of CBC mode
![Page 56: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/56.jpg)
P2 depends on C1
![Page 57: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/57.jpg)
“KILL IT”
![Page 58: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/58.jpg)
“KILL IT”
![Page 59: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/59.jpg)
Encryption Procedure
• Encrypt: “BESOK PAGI SERANGAN UMUM IWO JIMA”
• Split plaintext into blocks: • P1 = ‘BESOK PA’
• P2 = ‘GI SERAN’
• P3 = ‘GAN UMUM’
• P4 = ‘ IWO JIM’
• P5 = ‘A’+07+07+07+07+07+07+07
![Page 60: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/60.jpg)
Encryption Procedure
• Choose C5 all-zeros
• Use padding oracle attack to find Decrypt(Ci)
• C4 = Decrypt(C5) XOR P5
• C3 = Decrypt(C4) XOR P4
• C2 = Decrypt(C3) XOR P3
• C1 = Decrypt(C2) XOR P2
• IV = Decrypt(C1) XOR P1
![Page 61: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/61.jpg)
Encryption Demo
![Page 62: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/62.jpg)
Authenticated Encryption
![Page 63: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/63.jpg)
Authenticate before Decrypt
• Why we need to authenticate/verify encrypted message before decrypting it ? It’s already encrypted with shared secret key, after all.
• Imagine that only Alice and Bob know the key. If Bob could decrypt a cipher text with the secret key and get a clean and understandable plain text, then Bob know it only could be encrypted by Alice
• Many people have thought that, but they were wrong
• Without message authentication, active attacker could use padding oracle attack to decrypt and also encrypt without knowing the key
![Page 64: Hollywood style decryption](https://reader034.vdocuments.site/reader034/viewer/2022051323/548d9d8eb4795964258b4661/html5/thumbnails/64.jpg)
Encryption and MAC
• Encryption provides confidentiality, it doesn’t provide integrity and authenticity
• Don’t use encryption without message authentication
• Encrypt your message then calculate MAC
• Never decrypt message without checking MAC
• Decrypt only when ciphertext is MAC-authenticated