Crypto
-
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.
-
The Discrete Logarithm Problem
The discrete logarithm problem (DLP) is a fundamental problem in group theory that underpins the security of many cryptographic systems, including elliptic curve cryptography and the Diffie-Hellman key exchange.
In a cyclic group $G$ with generator $g$, every element $h\in G$ can be expressed as $h=g^x$ for some integer $x$. Computing $g^x$ given $g$ and $x$ is fast and efficient – $\mathcal O(\log x)$ using the method of repeated squaring.
The inverse problem, however – given $g$ and $h=g^x$, find $x$ – is believed to be computationally hard in certain groups. We haven’t proven that it’s hard (P vs NP is still an open problem), but we have decades of cryptanalysis and no known efficient algorithms for solving DLP in well-chosen groups, which gives us confidence in its hardness.
-
A Cypherpunk's Manifesto
The following is an archival copy of Eric Hughes’ “A Cypherpunk’s Manifesto”, originally published on 9 March 1993. The manifesto is a foundational text for the cypherpunk movement, advocating for privacy and the use of cryptography in an open society. The original text can be found at https://www.activism.net/cypherpunk/manifesto.html.
Privacy is necessary for an open society in the electronic age. Privacy is not secrecy. A private matter is something one doesn’t want the whole world to know, but a secret matter is something one doesn’t want anybody to know. Privacy is the power to selectively reveal oneself to the world.