Keira Knightley may co-star as 'complicated love interest' with Benedict Cumberbatch in Alan Turing biopic The Imitation Game

The Atonement actress is thought to be up for the part of Joan Clarke who worked at Bletchley Park and was briefly engaged to the homosexual Enigma code-breaker

Keira Knightley looks set to join Benedict Cumberbatch in a film based on the life of ground-breaking mathematician and Enigma code-breaker Alan Turing.

The Atonement actress is in talks to play a woman who forms a “complicated relationship” with the code-breaker, according to The Hollywood Reporter.

Although details are yet to be released, it is likely that the part Knightley is being touted for is that of Joan Clarke, Turing’s co-worker in Hut 8 at Bletchley Park, a good friend to whom he proposed marriage in 1941.

Graham Moore's screenplay, The Imitation Game, has been commissioned by Black Bear Pictures with Headhunters with Sherlock star Cumberbatch lined up to play Turing.

Turing, who was gay, apparently told Clarke, also a brilliant mathematician and cryptanalyst, about his sexual preference. But Clarke was “unfazed” by her fiancé’s homosexuality, according to Andrew Hodges’ biography, Alan Turing: The Enigma.

However, Turing decided he could not go through with the marriage and the pair remained good friends until his death.

The mathematician is famed for writing the first blueprint for modern computing. He also invented an electromagnetic machine called the 'bombe' which formed the basis for deciphering Germany’s Enigma codes during the war.

The work Turing and his team did at Bletchley Park has been credited with shortening World War II by as many as two years, but it is only six decades after his death that Turing’s contribution is beginning to be fully acknowledged .

Because of the Official Secrets Act, his code-breaking did not become public knowledge until twenty years after his suicide. His parents and brother never knew of his secret war efforts during his lifetime.

Turing was found dead on 7 June 1954, a few weeks before his 42nd birthday, having apparently bitten into an apple laced with cyanide.

His death came soon after he was found guilty of gross indecency for homosexual acts (which were then illegal) avoiding prison by agreeing to be chemically castrated.

Despite his premature death aged 41, Turing was so prolific in the fields of mathematics, computer science and mathematical biology, specifically morphogenesis, that the Science Museum dedicated a whole exhibition to him upon the centenary of his birth last year.

The Imitation Game, thought to have a budget of around $15 million, is an indie film being produced by Teddy Schwarzman with Nora Grossman and Ido Ostrowsky of Amersand Pictures.