applied cryptography - protocols, algorithms, and source code in c

The message is split into six blocks mi in which m1

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: , 88, 102, 37}. The superincreasing knapsack sequence is the private key. The normal knapsack sequence is the public key. Encryption To encrypt a binary message, first break it up into blocks equal to the number of items in the knapsack sequence. Then, allowing a one to indicate the item is present and a zero to indicate that the item is absent, compute the total weights of the knapsacks—one for every message block. For example, if the message were 011000110101101110 in binary, encryption using the previous knapsack would proceed like this: message = 011000 110101 101110 011000 corresponds to 93 + 81 = 174 110101 corresponds to 62 + 93 + 88 + 37 = 280 101110 corresponds to 62 + 81 + 88 + 102 = 333 The ciphertext would be 174,280,333 Decryption A legitimate recipient of this message knows the private key: the original superincreasing knapsack, as well as the values of n and m used to transform it into a normal knapsack. To decrypt the message, the recipient must first determine n-1 such that n(n-1 ) a 1 (mod m). Multiply each of the ciphertext values by n-1 mod m, and then partition with the private knapsack to get the plaintext values. In our example, the superincreasing knapsack is {2, 3, 6, 13, 27, 52}, m is equal to 105, and n is equal to 31. The ciphertext message is 174, 280, 333. In this case n-1 is equal to 61, so the ciphertext values must be multiplied by 61 mod 105. 174 * 61 mod 105 = 9 = 3 + 6, which corresponds to 011000 280 * 61 mod 105 = 70 = 2 + 3 + 13 + 52, which corresponds to 110101 333 * 61 mod 105 = 48 = 2 + 6 + 13 + 27, which corresponds to 101110 The recovered plaintext is 011000 110101 101110. Practical Implementations With a knapsack sequence of only six items, it’s not hard to solve the problem even if it isn’t superincreasing. Real knapsacks should contain at least 250 items. The value for each term in the superincreasing knapsack should be somewhere between 200 and 400 bits long, and the modulus should be somewhere between 100 to 200 bits long. Real implem...
View Full Document

Ask a homework question - tutors are online