The Key to Rebecca is a novel by British author Ken Follett. Published in 1980 by Pan Books (ISBN 0792715381), it was a noted bestseller that achieved popularity both in the United Kingdom and worldwide. The code mentioned in the title is an intended throwback from Follett to Daphne du Maurier's famed suspense novel Rebecca.

Many plot elements in the novel are based on actual historical details. The real-life Eppler, like Follett's fictional Alex Wolff, had grown up in Egypt after his mother had remarried to a wealthy Egyptian, and thus had a mixed German and Arab cultural heritage, greatly facilitating his ability to penetrate British-ruled Egypt. Like Follett's spy, Eppler was based at a houseboat on the river Nile, got help from a nationalist-inclined belly dancer in his espionage work, and used a system of codes based on Daphne du Maurier's book Rebecca – which provided the title of Follett's book. And Eppler did request assistance from the Cairo-based Free Officers Movement, who were at the time nominally pro-Axis in the belief that they would 'liberate' Egypt from the British, and specifically from the young Anwar Sadat.

Sadat plays an important role in the plot, and the scene of his arrest by the British is largely derived from Sadat's own autobiography – though the British officer who actually arrested him was not Follett's protagonist, Major William Vandam, a completely fictional character. When seeing Sadat already beginning to think of making the most of his arrest and "preparing to play martyr", Vandam thinks "He is very adaptable, he should be a politician"; the reader, obviously, is well aware that Sadat is the future President of Egypt.

However, Wolff is a far more formidable character than the actual Eppler, who "deliberately sabotaged his own radio, because he wanted to enjoy himself and live with a Jewish prostitute".[4] In contrast, Follett's Wolff - though having a sensual and pleasure-loving side - is completely dedicated to his mission, driven by a curious mixture of German nationalism, Egyptian patriotism and an overwhelming personal ambition. Like the German spy Faber in Follett's earlier Eye of the Needle, he is supremely intelligent, competent and resourceful, and utterly ruthless - ever ready to kill anyone perceived as threatening him, and preferring to do it silently with a knife. However, towards the end of the book, Wolff displays an increasing sadistic streak absent from Follett's earlier spy.

Among other things, Wolff is credited with having crossed the Sahara into Egypt by himself on camel back, rather than being ferried there, as was the actual Eppler. To enable Wolff to carry out such an epic feat, Follett provides him with a Bedouin background. Thus Wolff is thoroughly conversant with three distinct cultures; Nazi Germany, the Egyptian urban elites and the desert-dwelling tribes - the last two as distant from each other as they are from the first.

Another major departure is to make Wolff's espionage of far greater strategic significance than Eppler's ever was, making the very outcome of the war – or at least of the North African campaign – hinge on it, and fictionally crediting some of Rommel's main battle victories to information provided by Wolff, having gained access to secret battle plans carried by a Secret Intelligence Service officer.

A departure from cryptologic sense occurs in Follett's title conceit: the "key" or code sequence used to render the Axis spy's messages unreadable by the Allies without it. The author has it as a written down device, available for capture by the wily Major Vandam, but the actual code key imagined by Follett is so simple that a real agent would have simply memorized it, not had it written down for anyone to get hold of. To have it as a mnemonic "key" would have required a different method for the book's climax, either involving a "Bletchley Park" type codebreaker trick (some early "computer" perhaps) or by Vandam pressuring Wolff to reveal it (unlikely, given the obstinate history of the Nazi-Bedouin character).

The quote from Rommel which serves as the book's motto - "Our spy in Cairo is the greatest hero of them all" is genuine, and the battles of the North African Campaign are described accurately. However, the credit given to information provided by Wolff as decisively helping Rommel's victories - and to Vandam's disinformation in causing his ultimate defeat - is fictional.

The Key to Rebecca immediately attained bestseller status, becoming a main selection of the Book of the Month Club, garnering an initial printing of 100,000 copies within days and having been serialized in several magazines, even before any reviews had been published.[1] Positive reviews of the novel cited its depth in historical detail, and accurate depictions of Cairo and the Egyptian desert in World War II.[1] Follett noted that it was due to the success of The Key to Rebecca that he had believed he had truly been successful.[3]

In 1985, The Key to Rebecca was adapted into a film, directed by David Hemmings and starring David Soul as Alex Wolff and Cliff Robertson as Maj. William Vandam.[5] It was filmed in Tunisia and was shot as a two-part, four-hour TV movie; syndicated as part of the Operation Prime Time package, the first part aired in New York City on WPIX on April 29, 1985, with the second part airing on May 9, 1985. (Dates varied by station.) [5] Produced by Taft Entertainment in association with Castle Comb Productions, it was later shown in the United Kingdom, Scandinavia and several other countries in which the novel had been popular.[5][6]

Len Deighton's novel City of Gold is laid in the same time and place as the present book, and with a similar theme - the British worried about a spy in Cairo sending information to Rommel. However, in Deighton's depiction, it is ultimately discovered there had been no spy, and information got to the Germans due to faulty radio security. Like Follett's story, Deighton's is also based on historical fact.