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

β–Ά
problem 1
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1
slide-2
SLIDE 2

Problem 1

Block Cipher Block Cipher Block Cipher Block Cipher IV

January 27, 2011 Practical Aspects of Modern Cryptography 2

n bits k zero bits removed

slide-3
SLIDE 3

Inverse Cipher Inverse Cipher Inverse Cipher Inverse Cipher IV

January 27, 2011 Practical Aspects of Modern Cryptography 3

Problem 1

Missing bits

slide-4
SLIDE 4

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

slide-5
SLIDE 5

Problem 1

𝑄𝑗 = Decrypt(𝐿, 𝐷𝑗) ⨂ π·π‘—βˆ’π‘—

1.

Compute π‘Œπ‘ = Decrypt(𝐿, 𝐷𝑐) (intermediate value of final block)

2.

We also know π‘Œπ‘ = 𝑄𝑐 π‘Œπ‘ƒπ‘† π·π‘βˆ’1 if we have all the bits in 𝐷𝑐.

3.

Finally, we know the last 𝑙 bits of 𝑄𝑐 are 0 (pad).

4.

So for each of the padding bits 𝑄𝑐,π‘›βˆ’π‘™+1, … , 𝑄𝑐,𝑛 we have π‘Œπ‘,𝑗 = 𝑄𝑐,𝑗 XOR π·π‘βˆ’1,𝑗 for 𝑗 = 𝑛 βˆ’ 𝑙 + 1, … , 𝑛

5.

Since 𝑄𝑐,𝑗 = 0, then π‘Œπ‘,𝑗 = π·π‘βˆ’1,𝑗

1/27/2011 Practical Aspects of Modern Cryptography

slide-6
SLIDE 6

Problem 1: Ciphertext Stealing

Inverse Cipher Inverse Cipher Inverse Cipher Inverse Cipher

Plaintext Ciphertext

IV

110101 110101 00…0

slide-7
SLIDE 7

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

slide-8
SLIDE 8

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

slide-9
SLIDE 9

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

slide-10
SLIDE 10

Problem 3 – Solution 1

ο‚— Basic idea: find pairs of messages 𝑦𝑗, 𝑦𝑗

β€² satisfying

𝐺 π½π‘Š

𝑗, 𝑦𝑗 = 𝐺 π½π‘Š 𝑗, 𝑦𝑗 β€² = 𝑧𝑗, 𝑗 = 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

slide-11
SLIDE 11

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

slide-12
SLIDE 12

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

slide-13
SLIDE 13

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 22π‘œ/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

slide-14
SLIDE 14

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

slide-15
SLIDE 15

Problem 4

ο‚— Was it a good idea to construct 𝐻(𝑦) = 𝐼(𝑦) βˆ₯ 𝐼′(𝑦)?

1/27/2011 Practical Aspects of Modern Cryptography

slide-16
SLIDE 16

Problem 4

ο‚— Was it a good idea to construct 𝐻(𝑦) = 𝐼(𝑦) βˆ₯ 𝐼′(𝑦)? ο‚— Well, it depends…

1/27/2011 Practical Aspects of Modern Cryptography

slide-17
SLIDE 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.

1/27/2011 Practical Aspects of Modern Cryptography

slide-18
SLIDE 18

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

slide-19
SLIDE 19

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

slide-20
SLIDE 20

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