problem 1
play

Problem 1 k zero bits n bits IV Block Block Block Block - PowerPoint PPT Presentation

Problem 1 k zero bits n bits IV Block Block Block Block Cipher Cipher Cipher Cipher removed January 27, 2011 Practical Aspects of Modern Cryptography 2 Problem 1 IV Inverse Inverse Inverse Inverse Cipher Cipher Cipher Cipher


  1. Problem 1 k zero bits n bits IV Block Block Block Block Cipher Cipher Cipher Cipher removed January 27, 2011 Practical Aspects of Modern Cryptography 2

  2. Problem 1 IV Inverse Inverse Inverse Inverse Cipher Cipher Cipher Cipher Missing bits January 27, 2011 Practical Aspects of Modern Cryptography 3

  3. Problem 1 π‘œ ο‚— Let b = 𝑛 be the number of blocks . ο‚— Plaintext 𝑄 0 , 𝑄 1 , … , 𝑄 𝑐 , ciphertext 𝐷 0 , 𝐷 1 , … , 𝐷 𝑐 . ο‚— We care about 𝐷 π‘βˆ’1 , 𝐷 𝑐 , 𝑄 π‘βˆ’1 and 𝑄 𝑐 . ο‚— We know 𝑙 , the number of bits removed from the penultimate block, since 𝑙 = 𝑛 βˆ’ (π‘œ mod 𝑛). ο‚— Recall that for CBC decryption, we have plaintext block 𝑄 𝑗 = Decrypt( 𝐿, 𝐷 𝑗 ) ⨂ 𝐷 π‘—βˆ’π‘— 1/27/2011 Practical Aspects of Modern Cryptography

  4. Problem 1 𝑄 𝑗 = Decrypt( 𝐿, 𝐷 𝑗 ) ⨂ 𝐷 π‘—βˆ’π‘— Compute π‘Œ 𝑐 = Decrypt( 𝐿, 𝐷 𝑐 ) (intermediate value of final 1. block) We also know π‘Œ 𝑐 = 𝑄 𝑐 π‘Œπ‘ƒπ‘† 𝐷 π‘βˆ’1 2. if we have all the bits in 𝐷 𝑐 . Finally, we know the last 𝑙 bits of 𝑄 𝑐 are 0 (pad). 3. So for each of the padding bits 𝑄 𝑐,π‘›βˆ’π‘™+1 , … , 𝑄 𝑐,𝑛 4. we have π‘Œ 𝑐,𝑗 = 𝑄 𝑐,𝑗 XOR 𝐷 π‘βˆ’1,𝑗 for 𝑗 = 𝑛 βˆ’ 𝑙 + 1, … , 𝑛 Since 𝑄 𝑐,𝑗 = 0 , then π‘Œ 𝑐,𝑗 = 𝐷 π‘βˆ’1,𝑗 5. 1/27/2011 Practical Aspects of Modern Cryptography

  5. Problem 1: Ciphertext Stealing Plaintext 110101 00…0 IV Inverse Inverse Inverse Inverse Cipher Cipher Cipher Cipher 110101 Ciphertext

  6. Problem 2 ο‚— Decrypt a 𝑙 -block segment in the middle of a long CBC- encrypted ciphertext. ο‚— What is the minimum number of blocks of ciphertext that need to be decrypted? ο‚— Which blocks do you need to decrypt and how will you decrypt them? 1/27/2011 Practical Aspects of Modern Cryptography

  7. Problem 2 ο‚— In CBC decryption, we have plaintext block 𝑄 𝑗 = Decrypt( 𝐿, 𝐷 𝑗 ) ⨂ 𝐷 π‘—βˆ’π‘— ο‚— NOTE: Boundary case "𝐷 βˆ’1 " = IV. ο‚— Each plaintext block we want requires one decryption of the corresponding plaintext plus one XOR. ο‚— So the minimum number of ciphertext blocks to be decrypted is 𝑙. ο‚— If you want plaintext blocks 𝑄 𝑗 , 𝑄 𝑗+1 , … , 𝑄 𝑗+π‘™βˆ’1 , then you need ciphertext blocks 𝐷 π‘—βˆ’1 , 𝐷 𝑗 , 𝐷 𝑗+1 , … , 𝐷 𝑗+π‘™βˆ’1 . ο‚— If 𝑗 = 0 , instead of 𝐷 π‘—βˆ’1 you need the IV. 1/27/2011 Practical Aspects of Modern Cryptography

  8. Problem 3 ο‚— 𝐼 is a Merkle-DamgΓ₯rd hash function w/ compression function 𝐺 . Black box takes inputs π½π‘Š and 𝑧 and outputs an 𝑦 such that 𝐺 π½π‘Š, 𝑦 = 𝑧. ο‚— Show how by using the black box at most 2 𝑙 times you can find a set of 2 𝑙 messages that all have the same hash value when input into the full hash function 𝐼 . 1/27/2011 Practical Aspects of Modern Cryptography

  9. Problem 3 – Solution 1 β€² satisfying ο‚— Basic idea: find pairs of messages 𝑦 𝑗 , 𝑦 𝑗 β€² = 𝑧 𝑗 , 𝑗 = 1, . . , 𝑙 𝐺 π½π‘Š 𝑗 , 𝑦 𝑗 = 𝐺 π½π‘Š 𝑗 , 𝑦 𝑗 𝑧 𝑗 = π½π‘Š 𝑗+1 π½π‘Š 1 = π½π‘Š ο‚— Start at the end. Choose a random target output value 𝑧 𝑙 and a random input value 𝑧 π‘™βˆ’1 = π½π‘Š 𝑙 . Call the black box β€² . twice with π½π‘Š 𝑙 , 𝑧 𝑙 to generate 𝑦 𝑙 , 𝑦 𝑙 ο‚— Now move back a block. We have 𝑧 π‘™βˆ’1 , choose random β€² π½π‘Š π‘™βˆ’1 = 𝑧 π‘™βˆ’2 . Run the box twice, get 𝑦 π‘™βˆ’1 , 𝑦 π‘™βˆ’1 . 1/27/2011 Practical Aspects of Modern Cryptography

  10. Problem 3 – Solution 1 ο‚— We now have 4 two-block messages that hash to the same value when F is the compression function: β€² , 𝑦 π‘™βˆ’1 β€² β€² β€² 𝑦 π‘™βˆ’1 𝑦 𝑙 , 𝑦 π‘™βˆ’1 𝑦 𝑙 𝑦 𝑙 , 𝑦 π‘™βˆ’1 𝑦 𝑙 ο‚— Repeat this procedure 𝑙 times and you’ll have made 2𝑙 β€² . calls to the black box to generate 𝑙 pairs 𝑦 𝑗 , 𝑦 𝑗 ο‚— To generate 2 𝑙 messages that hash to the same value, make 𝑙 -block messages where the 𝑗 th block is either 𝑦 𝑗 or β€² . Two choices per block, 𝑙 blocks == 2 𝑙 . 𝑦 𝑗 1/27/2011 Practical Aspects of Modern Cryptography

  11. Problem 3 – Solution 2 ο‚— The β€œfixed point” solution ο‚— Choose a fixed value for π½π‘Š. Now call the black box to find an 𝑦 such that 𝐺 π½π‘Š, 𝑦 = π½π‘Š. ο‚— Concatenate 𝑦 as many times as you want, the hash will still be π½π‘Š. So to get 2 𝑙 messages: ο‚— 𝑦, 𝑦𝑦, 𝑦𝑦𝑦, 𝑦𝑦𝑦𝑦, … , 𝑦𝑦𝑦 … 𝑦𝑦𝑦 ( 2 𝑙 total times) 1/27/2011 Practical Aspects of Modern Cryptography

  12. Problem 4 ο‚— 𝐻(𝑦) = 𝐼(𝑦) βˆ₯ 𝐼′(𝑦) , 𝐼(𝑦) and 𝐼′(𝑦) are hash functions with π‘œ -bit outputs, so 𝐻(𝑦) has 2π‘œ -bit outputs. ο‚— Normally, with a birthday attack we would expect to have to generate 2 2π‘œ/2 = 2 π‘œ messages to find a collision. ο‚— However, 𝐼(𝑦) is badly broken (as in Prob. 3) so assume we can generate 2 π‘œ/2 messages that all have the same hash value in 𝐼 𝑦 . 1/27/2011 Practical Aspects of Modern Cryptography

  13. Problem 4 ο‚— Now compute 𝐼′(𝑦) for each of the 2 π‘œ/2 that have the same hash value in 𝐼(𝑦) . ο‚— By the birthday attack we expect to find a collision from those 2 π‘œ/2 messages. 1/27/2011 Practical Aspects of Modern Cryptography

  14. Problem 4 ο‚— Was it a good idea to construct 𝐻(𝑦) = 𝐼(𝑦) βˆ₯ 𝐼′(𝑦) ? 1/27/2011 Practical Aspects of Modern Cryptography

  15. Problem 4 ο‚— Was it a good idea to construct 𝐻(𝑦) = 𝐼(𝑦) βˆ₯ 𝐼′(𝑦) ? ο‚— Well, it depends… 1/27/2011 Practical Aspects of Modern Cryptography

  16. Problem 4 ο‚— Was it a good idea to construct 𝐻(𝑦) = 𝐼(𝑦) βˆ₯ 𝐼′(𝑦) ? ο‚— Well, it depends… ο‚— YES: At the cost of computing two hashes vs. one, you get resistance if one of 𝐼, 𝐼′ breaks. 1/27/2011 Practical Aspects of Modern Cryptography

  17. Problem 4 ο‚— Was it a good idea to construct 𝐻(𝑦) = 𝐼(𝑦) βˆ₯ 𝐼′(𝑦) ? ο‚— Well, it depends… ο‚— YES: At the cost of computing two hashes vs. one, you get resistance if one of 𝐼, 𝐼′ breaks, but… ο‚— NO: However, 𝐻(𝑦) doesn’t have the security margin you’d expect of a 2π‘œ - bit hash function. It’s only as strong as the better of its two components 1/27/2011 Practical Aspects of Modern Cryptography

  18. Problem 5 ο‚— Alice οƒ  Bob: 𝑛 = β€œplease pay the bearer $1”, 𝐼(𝑙, 𝑛) . ο‚— 𝑛 is an exact multiple of 𝐼’𝑑 block size (so you don’t need to do any padding). ο‚— What can Bob do? 1/27/2011 Practical Aspects of Modern Cryptography

  19. Problem 5 ο‚— Note that 𝑙 is only an input to the first application of 𝐼 β€² 𝑑 compression function (e.g. it’s the π½π‘Š to the hash of the first block of 𝑛 ) ο‚— Bob can append data to 𝑛 , create 𝑛 β€² = 𝑛 βˆ₯ β€œ,000,000”, and compute 𝐼 𝑙, 𝑛 β€² from 𝐼(𝑙, 𝑛) . 1/27/2011 Practical Aspects of Modern Cryptography

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend