In a major Berlin sale, the Weinstein Co. has bought U.S. rights to Alan Turing drama “The Imitation Game,” with Benedict Cumberbatch and Keira Knightley starring, for $7 million.

Morten Tyldum (“Headhunters”) directed the project, based on the life story of crypotgrapher and mathematician Turing, who cracked the German “Enigma Code” during WWII and was later prosecuted by the British government in the early 1950s for being a homosexual.

CAA brokered the deal at Berlin, presenting a promo reel of scenes.

“Imitation Game” also stars Mark Strong and Matthew Goode. Producers are Nora Grossman, Ido Ostrowsky and Teddy Schwarzman.

Warner Bros. originally developed the project after Graham Moore’s script landed at the top of  the 2011 Black List. “The Imitation Game” is based on the biography “Alan Turing: The Enigma” by Andrew Hodges.

In September at the Toronto Film Festival, TWC also paid $7 million for U.S. rights to John Carney’s “Can a Song Save Your Life?,” which also stars Knightley.

The news was first reported by the Deadline.com site.