Alan Turing (Benedict Cumberbatch) is a brilliant mathematician with an off-putting personality.
He is hired by a commander to help crack Enigma, an unbreakable German code, to decipher messages communicated during World War II. The code is reset by the Germans every morning, so Alan puts his energy into constructing a supercomputer to help run through the possibilities. Along with five other code breakers, including a brilliant woman named Joan (Keira Knightley), they realize that they can decipher the code using recurring phrases in messages, namely “heil Hitler” which ends the weather report every morning. They crack the code and assist the Allies discretely, never getting credit so they will be able to decipher messages in future wars.
Ten years later, a detective takes special interest in Alan for having a classified and empty war file; he finds out Turing’s secret is not that he is a spy but that he is a homosexual. Alan is indicted and forced to either take estrogen treatments (to allegedly rid him of his homosexuality) or years in prison, where he will not be able to continue his work. The medication destroys him mentally and he finally commits suicide.
His contributions to science develop into what is now known as computers.