Module rsa

Module rsa 

Source
Expand description

Generic RSA implementation

FunctionsΒ§

blind πŸ”’
Returns the blinded c, along with the unblinding factor.
compute_modulus πŸ”’
Compute the modulus of a key from its primes.
compute_private_exponent_carmicheal πŸ”’
Compute the private exponent from its primes (p and q) and public exponent
compute_private_exponent_euler_totient πŸ”’
Compute the private exponent from its primes (p and q) and public exponent This uses Euler’s totient function
recover_primes
The following (deterministic) algorithm also recovers the prime factors p and q of a modulus n, given the public exponent e and private exponent d using the method described in NIST 800-56B Appendix C.2.
rsa_decrypt
⚠️ Performs raw RSA decryption with no padding or error checking.
rsa_decrypt_and_check
⚠️ Performs raw RSA decryption with no padding.
rsa_encrypt
⚠️ Raw RSA encryption of m with the public key. No padding is performed.
unblind πŸ”’
Given an m and and unblinding factor, unblind the m.