When I run my python 3 program:
exp = 211
p = 199
q = 337
d = (exp ** (-1)) % ((p - 1)*(q - 1))
results in 211^(-1).
But when I run the calculation in wolfram alpha I get the result I was expecting.
I did some test outputs and the variables exp
, p
and q
in the program are all the integer values I used in wolfram alpha.
My goal is to derive a private key from a (weakly) encrypted integer. If I test my wolfram alpha result, I can decrypt the encrypted message correctly.
0.5 % 2
to be ? – Outpost0.5
would be the answer, but why does wolfram alpha provide the answer I was looking for ? – Submarginal(1/211) mod ((199 - 1)*(337 - 1))
into Alpha gives the Python answer: roughly,0.00473
– Ikon