I am implementing Schnorr identification protocol.
I have an example from book “Handbook of applied cryptography” example 10.37.
Everything works without one thing.
(p = 48731, q = 433, B = 11444) - public params.
v = 7355 - public Key.
a = 357 - privateKey.
t = 8 - identification certanity,
Protocol Actions
A choses r = 274 and sends to B x = B^r mod p = 37123.
B sends to A e ( 1 <=e <= 2^t), e = 129.
A sends to B y = (ae + r) mod q. - this doesn't work. should be 255.
B comutes z = ((B^y)(V^e)) mod p. if z == x then identity is ok.
So, i have problem with (ae + r) mod q, should 255 and I have 429.
code :
BigInteger ae = a.multiply(e);
ae = ae.mod(q);
y = ae.add(r);
y = y.mod(q);
result y = 429
if i ll compute
BigInteger ae = a.multiply(e);
y = ae.add(r);
y = y.mod(q);
result is the same.
Please help me.
Thanks.
q=433is incorrect, it should be divisor ofp-1. Correct value is 443.