Public-Key Cryptography Was Invented Twice

Public-Key Cryptography Was Invented Twice

Diffie and Hellman published it in 1976; on the documented record, GCHQ had found it years earlier and kept it secret until 1997, weeks after James Ellis died. Who gets the credit?

Public-key cryptography — the idea that you can publish one key for anyone to use while keeping a second key private — was first published by Whitfield Diffie and Martin Hellman in 1976, and turned into a practical encryption and signature scheme by Rivest, Shamir and Adleman in 1977. On the documented record, it was first discovered earlier, inside Britain's signals intelligence agency, GCHQ: James Ellis conceived "non-secret encryption" around 1969 to 1970, Clifford Cocks found what amounts to RSA in 1973, and Malcolm Williamson found the equivalent of Diffie-Hellman key exchange in 1974. That work stayed classified until December 1997. Whether "first" belongs to secret precedence or public priority is a real question, and each answer says something different about how invention gets credited.

The problem both teams solved

For most of history, encryption had one structural weakness that no cleverness in the cipher could fix. Two parties who wanted to communicate secretly first had to share a secret key, and sharing it securely required a secure channel — the very thing they did not yet have. Governments solved this with couriers, diplomatic bags and key lists printed in advance. It worked, expensively, for organizations that could afford it. It could not work for strangers.

The public-key insight breaks that circle by splitting the key in two. One half can be given to anyone, even printed in a directory; it lets people lock a message, or verify a signature. The other half is kept private; only it can unlock the message, or create the signature. The two halves are mathematically linked, but knowing the public half does not practically reveal the private one.

Once stated, the idea sounds almost obvious. For a long time it did not look possible at all, and it was reached separately inside a secret agency and by researchers working in the open.

The public story: Stanford and MIT

In November 1976, Whitfield Diffie and Martin Hellman at Stanford published "New Directions in Cryptography" in the IEEE Transactions on Information Theory. The paper laid out the concept of public-key cryptography and gave a concrete method, now called Diffie-Hellman key exchange, by which two parties can agree on a shared secret over a channel that an eavesdropper is listening to. Ralph Merkle, then a student at Berkeley, had been working on a related scheme for public key distribution — later known as Merkle's puzzles — and his work is part of the same public lineage.

The following year, Ron Rivest, Adi Shamir and Leonard Adleman at MIT found a scheme that implemented the public-key cryptosystem the Diffie-Hellman paper had described in principle: encrypt with a public key, decrypt with a private one, and sign with the private key so that anyone could verify with the public one. RSA, named from their initials, was published in 1977 and 1978, patented, and commercialized.

These publications did what publications do. They were read, criticized, extended and taught. They shaped the academic field of cryptography, the standards that followed, and eventually protocols such as TLS that secure connections on the internet today. Judged by influence, the public line is the origin of the technology the world actually uses.

The classified story: Cheltenham

Inside GCHQ, the same questions had been asked years earlier. James Ellis, a senior scientist there according to Wired, began thinking around 1969 about whether secure communication was possible without a pre-shared secret. By 1970 he had written up the concept he called non-secret encryption, showing that it was possible in principle — but he did not have a practical mathematical way to do it.

In 1973, Clifford Cocks, a young mathematician who had recently joined the agency, heard about Ellis's idea and found a way to implement it using the difficulty of factoring large numbers. His scheme is essentially what RSA would be four years later. Accounts describe him working it out very quickly after hearing the problem. In 1974 his colleague Malcolm Williamson found a key-exchange method equivalent to what Diffie and Hellman would publish in 1976.

None of it was published. It was classified, as GCHQ's work was, and it does not appear to have been put into operational use at the time — the computing needed to use it routinely was not yet cheap. The inventors could not claim it, discuss it outside the agency, or react publicly when others received credit for the same ideas.

The definitional fork: precedence or priority

This is where the "first" becomes a question of what the word is for.

If "first" means who reached the idea earliest on the documented record, the answer is GCHQ, and not narrowly: Ellis's concept predates Diffie and Hellman's paper by several years, Cocks's scheme predates RSA by four, and Williamson's key exchange predates the public version by two. That order has been on the public record since 1997. A separate claim, made by Bobby Inman as director of the U.S. National Security Agency, that the NSA discovered public-key methods in the early 1970s had never been substantiated, Times Higher Education reported in April 1999.

If "first" means who established the idea in the world — published it, let it be tested, and caused it to be built upon — the answer is Diffie, Hellman and Merkle, then Rivest, Shamir and Adleman. Science tends to assign credit this way, for a reason: an idea no one can read cannot be verified, challenged or used. GCHQ shared Cocks's idea with its intelligence allies, according to an interview with him in Chalkdust, but it was kept from the public, so researchers in the open could not read it or build on it as published work.

Neither reading is objectively settled, and it is more useful to hold both than to pick one. Secret precedence tells you that the mathematics was discoverable, by more than one group, once the question was asked the right way. Public priority tells you how credit, standards and industries actually form. Accounts of how the GCHQ inventors took the outcome vary in tone: Simon Singh's 1999 book The Code Book describes Cocks's attitude as restrained and Williamson as dispassionate, while The New York Times reported in December 1997 that Williamson said he felt bad when others discovered the solution, but concluded that it was one of the restrictions of working for the government. Times Higher Education reported in 1999 that leading cryptographers such as Diffie accept that Ellis's claim is in substance likely to be correct.

December 1997

The British government allowed the story to be told in December 1997. On December 18, according to The Code Book, Clifford Cocks gave a talk that he had been permitted to begin with a brief history of GCHQ's contribution to public-key cryptography, and Ellis's own internal account, The Story of Non-Secret Encryption, written in 1987, was released around the same time.

James Ellis did not see it. He had died on November 25, 1997, a few weeks before the announcement. The man who first asked the question inside GCHQ spent his whole career unable to say that he had, and the public acknowledgment came just too late for him. It is a part of the story that can stay with people, because it shows what classification costs the individuals who live under it.

A short timeline of public-key cryptography

YearMilestoneWhat it established
1969-70James Ellis conceives non-secret encryption at GCHQThe possibility, in principle, of secure communication without a pre-shared key — classified
1973Clifford Cocks devises an RSA-equivalent schemeA practical method based on the difficulty of factoring — classified
1974Malcolm Williamson devises a key-exchange equivalentThe classified counterpart of Diffie-Hellman key exchange
1976Diffie and Hellman publish "New Directions in Cryptography"A journal statement of public-key cryptography, after the authors' June 1976 conference paper, with a working key-exchange method
1977Rivest, Shamir and Adleman publish RSAPractical public encryption and digital signatures, commercialized and patented in the United States (filed 1977, granted 1983)
1997GCHQ's work is made publicThe classified precedence becomes part of the documented history

The timeline stops at the declassification because that is where the dispute becomes visible. The applications that followed — secure web connections, encrypted email, digital signatures — rest on the public line of work, and each of them is its own history. What the 1970s leave behind is an unusual pair of origins: an idea invented in secret and then again in the open, with the credit settling where it could be spoken.

Project Inquiry