Daniel J. Bernstein
Abstract
Daniel J. Bernstein (born 1971), known online as djb, sued the United States government as a graduate student in 1995 for the right to publish an encryption program, and won rulings that source code is speech. He then wrote a mail server and a DNS server with a cash reward for anyone who could find a security hole, and designed the cryptographic primitives Salsa20, ChaCha20, Poly1305, and Curve25519, which are now defaults in SSH, Signal, WireGuard, and TLS. He has spent much of his career in public argument with standards bodies, and has usually been worth listening to.
Snuffle
Bernstein was born on 29 October 1971 in East Patchogue, New York. He finished high school at fifteen, placed fifth in the 1987 Westinghouse Science Talent Search, took a mathematics degree at New York University in 1991, and went to Berkeley for a doctorate under the number theorist Hendrik Lenstra, which he completed in 1995.
As a student he had written a short program called Snuffle, which showed how to turn a one-way hash function into an encryption system. He wanted to publish the program, together with a paper explaining it. Under the International Traffic in Arms Regulations, encryption software was a munition, and posting it where foreigners could read it was an export. Bernstein asked the State Department and was told he would need to register as an arms dealer and obtain a licence.
On 21 February 1995, with the Electronic Frontier Foundation behind him and Cindy Cohn as lead counsel, he sued. The argument was that source code is how cryptographers communicate their ideas to each other, and that a licensing scheme for publishing it is a prior restraint on speech.
The Case
In the district court in San Francisco, Judge Marilyn Hall Patel agreed in three steps. On 15 April 1996 she refused to dismiss the case and held that source code is speech for First Amendment purposes. In December 1996 she struck down the relevant parts of the arms regulations. When the government moved encryption to the Commerce Department’s export rules, she struck those down as well, on 25 August 1997.
The government appealed. On 6 May 1999 a panel of the Ninth Circuit ruled two to one for Bernstein, in an opinion by Judge Betty Fletcher, that encryption source code is expression and that the export licensing scheme was an unconstitutional prior restraint.
Misconception: Bernstein established as binding precedent that code is speech
The Ninth Circuit’s 1999 opinion is often cited as the landmark ruling. It did not stand. On 30 September 1999 the court ordered the case reheard by a larger panel and withdrew the opinion. Before the rehearing took place, the government rewrote the export rules, on 14 January 2000, to let publicly available source code be posted after a notification, and the case went back to the district court. Bernstein, by then representing himself, challenged the new rules; on 15 October 2003 the judge dismissed the case and told him to come back if the government made a concrete threat. The lasting appellate ruling on the point came from the Sixth Circuit in Junger v. Daley in April 2000. Bernstein’s case changed the regulations; it left Patel’s district-court opinions, not a circuit precedent. See Myths and Misconceptions and The Crypto Wars of the 1990s.
Software with a Guarantee
In December 1995 Bernstein began writing a mail server. The standard one, Sendmail, was a single large program that ran with full privileges and had a long record of security holes. His replacement, qmail, was split into small programs that ran under different user accounts and did not trust each other’s input, so that a flaw in the part that talked to the network did not hand over the machine. In March 1997 he offered $500 to the first person to publish a verifiable security hole in the latest version. The last release, 1.03, came out on 15 June 1998, and he did not issue another.
In 2005 Georgi Guninski found an integer overflow that could be exploited on 64-bit machines with very large amounts of memory. Bernstein disputed that it was a practical attack. In May 2020 the security firm Qualys published a working remote exploit for the same bug in a default installation. The reward, raised to $1,000 in November 2007, was not paid; the Qualys researchers said it was refused because their exploit depended on conditions outside the guarantee. He applied the same design, and a $1,000 guarantee, to his DNS server djbdns; that reward was paid, in March 2009, to Matthew Dempsky.
Both programs were distributed for years under terms of his own that let anyone use them but did not allow modified versions to be redistributed, so Linux distributions could not ship fixes. In November 2007 he placed them in the public domain.
His writing on the subject is as blunt as the software. He holds that most security bugs come from too much code running with too much privilege, and he attributes qmail’s record to having less of both.
Ciphers and Curves
From the mid-2000s, as a professor at the University of Illinois Chicago and a visiting professor at Eindhoven, Bernstein turned to designing cryptographic primitives. His 2005 demonstration that the timing of table lookups in AES could leak the key shaped everything that followed: his designs avoid data-dependent table lookups and branches, so that correct implementations run in constant time without special effort.
The stream cipher Salsa20 (2005) was selected for the European eSTREAM portfolio in 2008; its variant ChaCha20 followed the same year. Poly1305 is the matching message authenticator. Curve25519, published in 2006, is an elliptic curve for key exchange, chosen so that the arithmetic is fast and the usual implementation mistakes are hard to make, with every constant explained.
That last property mattered after 2013, when the Snowden documents and the Dual_EC_DRBG affair made cryptographers suspicious of the unexplained constants in the curves standardized by NIST. Curve25519 became the alternative. OpenSSH made it the default key exchange in 2014. Signal and WhatsApp use it, as do Tor and WireGuard. TLS 1.3, in 2018, recommends it, and Google had already deployed ChaCha20 with Poly1305 in Chrome and on its servers for phones without AES hardware. NIST approved the curve for US government use in 2023. It is a common default, not a universal one: a TLS connection can still negotiate a NIST curve.
Post-Quantum Arguments
Bernstein co-edited the 2009 book Post-Quantum Cryptography and is a co-designer of SPHINCS+, the hash-based signature scheme that NIST selected in July 2022, which descends from Ralph Merkle’s tree signatures (see Post-Quantum Cryptography). He is also the most persistent critic of the same NIST process. In 2022 he filed a Freedom of Information lawsuit for records of the National Security Agency’s involvement in it, and he has argued at length that the selection of the Kyber key exchange rested on faulty security estimates. Other cryptographers dispute his reading. The pattern is the one from 1995: he thinks the government’s handling of cryptography should be checked in public, and he is prepared to do the checking himself.
📚 Sources
- Electronic Frontier Foundation: Bernstein v. US Department of Justice, case archive (Snuffle, the licensing requirement, complaint of 21 February 1995, rulings of 15 April 1996, December 1996, and 25 August 1997, Ninth Circuit decision of 6 May 1999)
- Bernstein v. United States Department of State, 922 F. Supp. 1426 (N.D. Cal. 1996) (Patel’s first opinion)
- Bernstein v. United States Department of Justice, 192 F.3d 1308 (9th Cir. 1999) (order for rehearing en banc, panel opinion withdrawn; the page returns 403 to scripts)
- Bernstein, Daniel J.: press release on the dismissal of 15 October 2003 (hearing of October 2002, the government’s assurances, Patel’s “concrete threat of enforcement”)
- Bernstein, Daniel J.: “The qmail security guarantee” ($500 offered in March 1997, what the guarantee excludes)
- Bernstein, Daniel J.: “Curve25519: New Diffie-Hellman Speed Records”, Public Key Cryptography: PKC 2006, LNCS 3958, 207–228
- Bernstein, Daniel J. & Buchmann, Johannes & Dahmen, Erik (eds.): Post-Quantum Cryptography (Springer, 2009)
- Junger v. Daley, 209 F.3d 481 (6th Cir. 2000) (decided 4 April 2000)
- Wikipedia: Daniel J. Bernstein (finding aid: birth, education, Salsa20 and eSTREAM, ChaCha20, the 2005 AES timing attack, djbdns reward of March 2009, SPHINCS+, the 2022 lawsuit)
- Wikipedia: Bernstein v. United States (finding aid: the judges of the 1999 panel, the second challenge, 15 October 2003)
- Wikipedia: qmail (finding aid: start in December 1995, $500 in 1997, 1.03 on 15 June 1998, Guninski 2005, $1,000 and public domain in November 2007, Qualys on 19 May 2020)
- Wikipedia: Curve25519 (finding aid: 2013 and the NIST curves, OpenSSH 2014, TLS 1.3, list of users, NIST approval in 2023)