Академический Документы
Профессиональный Документы
Культура Документы
Traditional private/secret/single key cryptography uses one key. Key is shared by both sender and receiver. The risk in this system is that if either party loses the key or it is stolen, the system is broken.
Cryptography
Public Key Algorithm Cryptography based on the Knapsack Problem
Was broken by Shamir in 1984. Shamir showed how to use integer programming to solve the particular class of Subset Sum problems in polynomial time.
The Merkle-Hellman system is based on the subset sum problem (a special case of the knapsack problem). The problem is as follows: given a set of numbers A and a number b, find a subset of A, which sums to b. In general, this problem is known to be NP-
Choose S={s1,s2,..,sm} as a superincreasing sequence, S is a simple knapsack. Choose a multiplier w and a modulus n. The multiplier should have no common factors with the modulus. Then replace every integer si in the simple knapsack with the term hi = w*si mod n Then, H=[h1,h2,.hm] is a hard knapsack
The ciphertext message produced by the encryption algorithm is C=H*P= w*S*P mod n
Example
Alice private key: S={1,2,4,9},w=15 and n=17 now hi =w*si mod n 1*15=15 mod 17=15 2*15=30mod 17=13 4*15=60mod 17=9 9*15=135mod 17=16 The hard knapsack H={15,13,9,16}
Encryption of message
We use knapsack S and H w=15,n=17 and m=4 The message P=0100101110100101 Is encoded with the knapsack H P=0100 1011 1010 0101 [0,1,0,0]*[15,13,9,16]=13 [1,0,1,1]*[15,13,9,16]=40 [1,0,1,0]*[15,13,9,16]=24 [0,1,0,1]*[15,13,9,16]=29 The message is ecrypted as the integers 13,40,24,29, using H
Now multiplicative inverse W = 8 ( 15 mod 17 is 8,since 15*8 mod 17=120 mod 17=(17*17)+1 mod 17 =1) To decipher, we multiply these messages by 8 mod 17 bcoz 8 is 15 mod 17. 13*8=104 mod 17 = 2 = [0 1 0 0] 40*8=320 mod 17 = 2 = [1 0 1 1] 24*8=192 mod 17 = 5 = [1 0 1 0] 29*8=232 mod 17 = 11 =[0 1 0 1] The recovered msg is 0100101110100101
Knapsack problem