Number-Theory
-
Generating Cryptographic Primes in Rust
This is a draft post. There may be some rough edges, but the core content is here. Feedback is welcome!
Many cryptographic schemes rely on large prime numbers for their security. RSA needs two of them. Diffie-Hellman needs one. DSA, ElGamal, Paillier — primes everywhere. Cryptographic libraries need to generate these primes efficiently and securely when producing keypairs. In this post, we’ll learn how these primes are generated, and implement our own in Rust.