Вы находитесь на странице: 1из 23

Private Key Cryptography

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.

Private Key Cryptography


Uses two keys a public key and a private key Asymmetric since parties are not equal
Public-key/two-key/asymmetric cryptography involves the use of two keys:
a public-key, which may be known by anybody, and can be used to encrypt messages, and verify signatures a private-key, known only to the recipient, used to

Public Key Cryptography


Public key cryptosystem was introduced in 1976 by Diffie and Hellman.In PKC different keys are used for encryption and decryption.

MerkleHellman knapsack cryptosystem


The MerkleHellman knapsack cryptosystem was one of the earliest public key cryptosystems invented by Ralph Merkle and Martin Hellman in 1978.

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-

Easy knapsack problem


An easy knapsack problem is one in which set A={a1, a2, .. an} is a super increasing sequence. A super increasing sequence is one in which the sum next to term of sequence is greater than the sum of all preceding terms:
Example: A={1,2,4,8, 2n-1} is super increasing sequence.

Polynomial time algorithm for easy Knapsack problem

Merkle-Hellman Additive Knapsack cryptosystem

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

Merkle hellman knapsack encryption algorithm


The merkle hellman algo begins with a binary message i.e binary sequence P=[p1,p2,.pk] Divide the message into blocks of m bits The encipherment of message P is a sequence of targets,where eaach target is the sum of some of the terms of the hard knapsack H. Each term of the ciphertext is Pi * H, the target derived using block Pi as the selection vector.

Knapsack Decryption algorithm


Compute W as multiplicative inverse of w mod n such that Ww=1( mod n) The connection b/w easy and hard knapsack is H= w* S mod n

The ciphertext message produced by the encryption algorithm is C=H*P= w*S*P mod n

Knapsack Decryption algorithm


To decipher,multiply C by by W,since W*C=W*H*P=W*w*S*P=S*P mod n The plain text Pi could be found by using polynomial time algorithm for easy knapsack.

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

Вам также может понравиться