pwnbox.number¶
Number theory algorithms.
-
pwnbox.number.cf(n, m)¶ Rational number
n / mto continued fraction.Parameters: - n – numerator.
- m – denominator.
-
pwnbox.number.cf_convergents(cf)¶ Continued fraction to convergents
Parameters: cf – continued fraction.
-
pwnbox.number.crt(remainders, moduli, coprime=True)¶ Chinese Remainder Theorem.
Parameters: - remainders – list of remainders.
- moduli – list of modulies.
- coprime – (optional) set
Falseif modulies are not coprimes.
-
pwnbox.number.fermat_factoring(N, trial=4294967296)¶ Perform Fermat’s factorization.
Parameters: - N – number to factorize.
- trial – (optional) maximum trial number.
-
pwnbox.number.wiener_attack(N, e)¶ Perform Wiener’s attack.
Parameters: - N – RSA public key N.
- e – RSA public key e.