Turing Bombe machines cracked 3,000 messages a day and are said to have shortened the war by two years thanks to the military secrets they uncovered
However, he was not rewarded with honours by the state, or public adulation. Instead he was persecuted because of his homosexuality, opting for chemical castration rather than imprisonment after conviction for gross indecency.
Two years later, in 1954, he took his own life.
Now, after thousands signed a petition calling for the government to apologise, Britain's prime minister, Gordon Brown has done so.
He said he was deeply sorry that Mr Turing had been treated inhumanely under the homophobic laws of the time.