In the autumn of 1973, Clifford Cocks took home a problem about public-key encryption that nobody at his new workplace had solved. He had joined GCHQ, the Government Communications Headquarters, Britain’s signals intelligence agency, only weeks earlier.
The problem was to find a practical way for two people to exchange secret messages without first sharing a secret key. In Cocks’s telling, his mentor, Nick Patterson, introduced it as a “really cool problem, but one that nobody had really got anywhere on.”
Cocks turned it over at home that evening. By the next morning he had the groundwork of a workable method. His write-up, dated 20 November 1973, runs to four short numbered paragraphs. James Ellis, the GCHQ colleague who had first posed the problem, later called the scheme “essentially the RSA Algorithm.” RSA is the method three researchers at the Massachusetts Institute of Technology (MIT) described in 1977, and it is still one of the most widely used public-key algorithms.
GCHQ decided not to build it, and kept the note classified. The public learned of it in December 1997, 24 years later.
An impossible idea, proved possible
The question came from Ellis. In the 1960s, he later wrote, managing “vast quantities of key material” was a headache for the armed forces. Everyone, including him, took it as obvious that secure communication needed a secret key or some other advantage over the eavesdropper. A wartime Bell Telephone Laboratories report changed his mind: to secure a phone call, the recipient could add noise to the line and subtract it afterwards. The recipient took part in the encryption.
Could ordinary encryption work like that? The question “occurred to me in bed one night,” Ellis wrote, “and the proof of the theoretical possibility took only a few minutes.” He set out that proof in an internal report in January 1970. But it relied on lookup tables that would normally be impossibly huge, and ideas for a practical version kept turning out to have flaws. “Because of the weakness of my number theory,” Ellis wrote, “practical implementations were left to others.”
The evening Cocks solved it
Cocks came to the problem from number theory. He had studied mathematics at Cambridge and begun a doctorate at Oxford before deciding academia was not for him. “I knew that what I needed was a mathematical function that was easy to do one way but hard to undo,” he told Chalkdust, a mathematics magazine, in 2019. “I’d been working in number theory, so factorising seemed like something that could work.”
Multiplying two large prime numbers is quick. Recovering the primes from their product takes vastly more work. Cocks’s note turns that gap into a cipher:
- The receiver picks two large primes, P and Q, and sends their product, N, in the open.
- The sender raises each block of the message to the power N, modulo N, and sends the result.
- The receiver, who knows P and Q, computes two helper numbers with Euclid’s algorithm and recovers the message.
An eavesdropper sees N and the ciphertext. As Ellis summed it up, “The security lies in the difficulty of factorising N.”
Ellis later compared the scheme with the published RSA. In RSA, the sender raises the message to a public exponent, e, that the receiver chooses. Cocks’s version fixed it at N. “Cocks is a special case of RSA in that it puts e = N,” Ellis wrote. “The two algorithms are variants of the same method.”
A couple of months later, Malcolm Williamson, a GCHQ colleague and Cocks’s childhood friend, brought Ellis a different scheme. By Ellis’s account, Williamson later also came up with the key exchange Whitfield Diffie and Martin Hellman published in 1976, except that Diffie and Hellman restricted the modulus to a prime. Williamson’s report on it is dated August 1976, more than two months after Diffie and Hellman submitted their paper describing it; Ellis wrote that Williamson published it “much later than he thought of it.”
Why GCHQ shelved it
GCHQ chose not to use the scheme. “They thought very seriously about how to do it, but came to the conclusion, quite correctly at the time, that it was too expensive,” Cocks said. With the computers of the day, he explained, it would have needed special-purpose hardware and would still have been very slow. Ellis had meant the idea to save money on sharing keys, and “given that the aim was to save money,” Cocks said, “it wouldn’t have been feasible.”
Meanwhile, researchers outside government got there on their own. Diffie and Hellman published “New Directions in Cryptography” in November 1976. Ron Rivest, Adi Shamir and Leonard Adleman of MIT described RSA, named from their initials, in an April 1977 memo and published it in February 1978 in Communications of the ACM, a journal of the Association for Computing Machinery. By Chalkdust’s account, they found the same solution independently. They won the ACM’s Turing Award for 2002; Diffie and Hellman won it for 2015.
Twenty-four years later
The secret came out because of a talk. In December 1997 Cocks was due to speak at a cryptography conference in Cirencester, England, and expected questions about whether he had worked on early versions of the algorithm. To head off that speculation, GCHQ declassified his work. Ellis did not see the announcement. He died on 25 November 1997, aged 73, weeks before GCHQ released his account of the story.
What the legend leaves out
The legend makes the discovery a flash of genius. The history published with an IEEE (Institute of Electrical and Electronics Engineers) milestone says “it is claimed” that Cocks found a solution within half an hour. Cocks credits circumstance instead. He describes being “in the right place at the right time, and having the problem explained to me in the right way,” and says being new helped: “I hadn’t quite realised how many people had worked on it in the past and not really got anywhere.”
The credit is shared, too. The IEEE milestone plaque dedicated in Cheltenham in 2010 names all three men: by 1975, it says, Ellis had proved that a symmetric secret-key system was unnecessary, and Cocks with Williamson had shown how public-key cryptography could be achieved.
Not everyone accepts the British claim in full. In 1998 the security expert Bruce Schneier argued in Dr. Dobb’s Journal that the problems of business and personal communications did not occur to people securing a military, so the British did not see their invention as a solution to the key-management problem, and “the notion of digital signatures didn’t occur to them.” Ellis’s own account, though, begins with the armed forces’ key-management headache.
Right, but too early
It is tempting to see GCHQ as a bureaucracy sitting on a breakthrough. Cocks does not: he calls the decision correct for its time. “In those days, cryptography was only really used by governments,” he said. What changed later was what computers could do and who needed to exchange secrets with strangers.
Ellis named what secrecy costs. Most scientists, he wrote, aim to publish first, “because it is through dissemination that the work realises its value.” Cryptography works the other way. The public credit, and later the Turing Awards, went to the people who published.
Which idea has your team shelved as too expensive, and has anyone checked the price since?
Related stories
Sources
- C. C. Cocks, “A Note on ‘Non-Secret Encryption’,” CESG report, 20 November 1973 (released 1997; copy at cryptocellar.org)
- J. H. Ellis, “The History of Non-Secret Encryption,” released by GCHQ/CESG in 1997 (copy at cryptocellar.org)
- Sean Jamshidi and Emily Maw, “In conversation with Clifford Cocks,” Chalkdust, 2019
- W. Diffie and M. E. Hellman, “New Directions in Cryptography,” IEEE Transactions on Information Theory, November 1976 (manuscript received 3 June 1976)
- IEEE Milestone: “Invention of Public-key Cryptography, 1969–1975,” Engineering and Technology History Wiki
- GCHQ, “James Ellis” (profile, including his death on 25 November 1997)
- Bruce Schneier, “The Secret Story of Non-Secret Encryption,” Dr. Dobb’s Journal, April 1998
- MIT News, Ronald Rivest and colleagues receive the 2002 Turing Award, April 2003
- The Stanford Daily, “Whitfield Diffie and Martin Hellman win ACM 2015 A.M. Turing Award,” March 2016
- Featured image: Clifford Cocks at the Royal Society’s admissions day, July 2015. Photograph by Debbie Rowe / The Royal Society, via Wikimedia Commons, CC BY-SA 4.0

Leave a Reply