In 1976 W. Diffie and M. Hellman introduced the concept of public-key cryptography. Two years later R. Merkle and M. Hellman published a cryptosystem based on the subset sum problem [MH78]. At that time it was the only alternative cryptosystem to the existing RSA-Cryptosystem.
As described in the chapter about subset sum problems there are knapsack vectors such that a problem (A, s) is easily and efficiently solvable, for example superincreasing knapsacks. On the other hand it may be extremely difficult to get a solution for (A, s) if A is not superincreasing.
Merkle and Hellman used this fact to construct a cryptosystem based on the subset sum problem. Starting with a superincreasing knapsack vector A, a second knapsack vector B is built hiding the superincreasing property of A. The knapsack A is part of the private key whereas the knapsack B forms the public key. A message p then is encrypted by computing the sum c = pB = b1p1 + ... + bnpn, with pi representing the i-th bit of p.
Anyone being in possession of the cipher c is faced with the difficult problem (B, c). The owner of the private key however can easily determine the original message p because he knows the secret superincreasing sequence A.
Now the Merkle-Hellman Cryptosystem is explained in detail.
To be a correct cryptosystem, encryption of a plaintext p followed by decryption must yield p, that is d(e(p)) = p, with d the decryption function and e the encryption function respectively.
Indeed,
Because both c' < M as well as SUM (ai) < M, c' = pA = a1p1 + ... + anpn. With solving (A, c') and, if used, reversing the permutation pi the original plaintext p is received.
Remarks
![]() |
Low Dense Knapsacks | ![]() |