06.01.2015 Views

Cryptology - Unofficial St. Mary's College of California Web Site

Cryptology - Unofficial St. Mary's College of California Web Site

Cryptology - Unofficial St. Mary's College of California Web Site

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

11.4. THE KNAPSACK CIPHER SYSTEM 225<br />

did know the W ’s, we would be stuck solving a hard knapsack problem.<br />

This hints that this cipher is a good one.<br />

However, if we do know e = 39 and P = 101 we may use the Euclidean<br />

Algorithm to find that d = 57 is solution to 39 × d ≡ 1 (mod 101). Then,<br />

as in Decimation Ciphers, since multiplying by e enciphered, multiplying<br />

by d must (mostly) decipher.<br />

<strong>St</strong>arting with 136, first multiply by d: (d × 136 = 57 × 136)%101 = 76.<br />

Then write 76 as a sum <strong>of</strong> the original W ’s:<br />

76 = 3 + 24 + 49<br />

= 1 · W 1 + 0 · W 2 + 0 · W 3 + 1 · W 4 + 1 · W 5<br />

→ 10011 = s.<br />

So 136 → s. For the other letters we do the same. First, 190 → d · 190 =<br />

(57 · 190)%101 = 88, and then<br />

88 = 3 + 12 + 24 + 49<br />

= 1 · W 1 + 0 · W 2 + 1 · W 3 + 1 · W 4 + 1 · W 5<br />

→ 10111 = w.<br />

So 88 → w. Similarly, 43 → i and 45 → m.<br />

⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄<br />

This cipher system (also known as the Merkle–Hellman knapsack to differentiate<br />

it from other knapsack systems is a public key cipher. We haven’t seen<br />

any public key ciphers since Section 3.6, so let us briefly remind ourselves <strong>of</strong> the<br />

advantage <strong>of</strong> such a cipher. Each person who wishes to be part <strong>of</strong> a conversation<br />

may compute and make public a set <strong>of</strong> U’s, as in the Knapsack Cipher Setup.<br />

As we will see, this allows anyone to send them a secret message, even though<br />

they have never before communicated. There is no need to somehow pass a<br />

secret private key: just look up the person’s public key and start enciphering!<br />

Examples: Using the values W={5, 7, 15, 30, 59}, P = 179, e = 33:<br />

(1) Encipher dark cave.<br />

(2) Decipher 302, 260, 294, 157, 417, 459, 260, 294, 252, 52, 294,<br />

417, 302. 6<br />

⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄<br />

Now with five weights the hard knapsack problem only has 2 5 = 32 possible<br />

answers to check, and so it is not really very hard. (In the previous example,<br />

we could have determined that 136 consisted <strong>of</strong> U 1 , U 4 and U 5 with only a little<br />

6 (1) 137, 157, 260, 304, 252, 157, 397, 294. (2) treasure chest.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!