Note: this is not to be confused with the Naccache–Stern cryptosystem based on the higher residuosity problem.
The Naccache–Stern Knapsack Cryptosystem is an atypical publickey cryptosystem developed by David Naccache and Jacques Stern in 1997. This cryptosystem is deterministic, and hence is not semantically secure. This system also lacks provable security.
System Overview[]
This system is based on a type of knapsack problem. Specifically, the underlying problem is this: given integers c,n,p and v_{0},...,v_{n}, find a vector such that
The idea here is that when the v_{i} are relatively prime and much smaller than the modulus p this problem can be solved easily. It is this observation which allows decryption.
Key Generation[]
To generate a public/private key pair
 Pick a large prime modulus p.
 Pick a positive integer n.
 For i from 0 to n, set p_{i} to be the ith prime, starting with p_{0} = 2.
 Pick a secret integer s < p1, such that gcd(p1,s) = 1.
 Set .
The public key is then p,n and v_{0},...,v_{n}. The private key is s.
Encryption[]
To encrypt an nbit long message m, calculate
where m_{i} is the ith bit of the message m.
Decryption[]
To decrypt a message c, calculate
This works because the fraction
is 0 or 1 depending on whether p_{i} divides c^{s} mod p.
See also[]
 Merkle–Hellman knapsack cryptosystem
 Graham–Shamir knapsack cryptosystem
References[]
