Modular binomial
Last updated
Last updated
A modular binomial problem is a mathematical problem in which a binomial expression of the form :
where :
a and b are integers,
e is a positive integer (the exponent),
and N is a positive integer (the modulus).
The modular binomial problem can have the following form :
Given the value of c1, c2 a1, a2, e1, e2 and N
and where N = p*q
it's possible to retrieve p and q as follow :
Make the same with c2
Then
So, q = gcd(pow(a2,(-e2 * e1),N) * pow(c2, e1, N) - pow(a1, (-e1 * e2), N) * pow(c1, e2, N), N)
Do the same to get p