What is the function that returns the private key d if I know:
- The Two primes numbers (q, p)
- a selected public key e.
In an RSA algorithm?
What is the function that returns the private key d if I know:
In an RSA algorithm?
Copyright © 2021 JogjaFile Inc.
In RSA, $d$ must be the inverse of $e$ modulo $(p-1)(q-1)$. Various algorithms to compute modular inverses exist; the most common one is a simple extension of Euclid's algorithm for computing the greatest common divisor of $e$ and $(p-1)(q-1)$.
There are code examples to be found here.