Naccache-Stern cryptosystem is mainly based on Chinese Remainder Theorem. According to its wiki page and Partially Homomorphic encryption book, I generated following keys.
1- Picked a family of k small distinct primes. I set k to 6 and primes are
pi = {3, 5, 7, 11, 13, 17}
2- Divide the set in half and find the multiplication of primes as
u = 3x5x7 = 105
v = 11x13x17 = 2431
3- Find sigma as multiplication of u and v
σ = u x v = 105 x 2431 = 255255
4- Choose large primes a and b such that both p = 2au+1 and q=2bv+1 are prime as well
a = 19903238899171
b = 5031940459031
p = 2au + 1 = 2x19903238899171x105+1 = 4179680168825911
q = 2bv + 1 = 2x5031940459031x2431+1 = 24465294511808723
5- Set n to p x q
n = pq = 4179680168825911 x 24465294511808723 = 102257106295492317188047918221653
ϕ(n) = (p-1)(q-1) = 102257106295492288543073237587020
6- Generate a generator g that satisfies g^(ϕ(n)/pi) != 1.
g=28805426433623101967928508095048
7- My plaintext is 17. I will encrypt this as
c = g^m mod n = 28805426433623101967928508095048 ^ 17 mod 102257106295492317188047918221653
c = 56869948461238576264190303866429
8- Decryption requires following steps
ci = c ^(ϕ(n) / pi) mod n
ci = 56869948461238576264190303866429 ^ (102257106295492288543073237587020 / 3) mod 102257106295492317188047918221653
ci = 55506363668208546317381600107672
Then we need to solve DLP from
ci == g^(j x ϕ(n) / pi) mod n for j = 1 to pi
However, there is no j satisfying the following equation.
55506363668208546317381600107672 == 28805426433623101967928508095048^(j*102257106295492288543073237587020/3) mod 102257106295492317188047918221653
I also added the guaranteeing decryption step in Benaloh which is not mentioned in wiki or book. This resolves decryption issues for small keys (35 bit for a and b) but it becomes problematic for larger keys.
Am I skipping some important steps in key generation or this cryptosystem does not guarantee decryption always? If decryption is not guaranteed, then is there a way to check out decryption is guaranteed while generating keys?