The head of intelligence agency GCHQ has paid tribute to World War II codebreaker Alan Turing, saying that the "cost of intolerance was a loss to the nation" during centenary celebrations of the mathematician's birth.
Spy chief Iain Lobban described Turing as "one of the great minds of the 20th century" whose breakthroughs have laid the foundations of the modern information age".
Turing worked at the Government Code and Cypher School at Bletchley Park - the forerunner of GCHQ - where he devised the techniques which cracked the German Enigma code.
Turing is widely considered the father of computer science and artificial intelligence.
But despite his achievements he was found guilty of "gross indecency" in 1952, a conviction for the-then illegal act of homosexual sex.
Turing chose to be chemically castrated by being injected with female hormones rather than go to prison. Two years after his conviction he died of cyanide poisoning, a verdict recorded as suicide at his inquest.
Although his mother and other academics have maintained his death was accidental, many have argued he took the poison deliberately to end the persecution he was suffering for being homosexual.
In a speech at Leeds University, Mr Lobban said Turing's premature death underlined the cost of intolerance.
"We can't rewrite the past. We can't wish mid-twentieth century Britain into a different society with different attitudes," he said.
"We can be glad that we live in a more tolerant age. And we should remember that.”
This early computer was designed by the wartime codebreaker and mathmatician Alan Turing.
Mr Lobban said that he hoped wider appreciation of Turing's achievements would inspire a new generation of schoolchildren to study science and mathematics.
"Through our eyes, Turing was a founder of the information age: one of the people whose concepts are at the heart of a technological revolution which is as far-reaching as the industrial revolution," he said.
"Throughout the post-war era, we continued to enjoy the benefits of the abstract Turing machine model, from our 1980s washing machines to the mini computers we carry in our pockets today.
"Turing was part of a revolution which has led to a transformation of every aspect of our lives."
Lobban’s tribute comes amid a chorus of voices clamouring for Turing’s conviction to be quashed.
Earlier this week, the Home Office announced that gay men who were convicted before 1967 for taking part in consensual sex acts can now apply to have their records wiped clean.
As one of the most respected mathematicians in modern history, the centenary of Alan Turing's birth has seen a number of inventive tributes to the computer pioneer.
Google created a working replica of the Turing machine as a doodle on its homepage and a monopoly board that commemorated important places and events in Turing's life by produced by games company Winning Moves.
The production of the first 1,000 boarded were paid for by Google and donated to Bletchley Park to raise money for the heritage site.
Gordon Brown apologised for the treatment of Alan Turing in 2009, saying in a speech:
I am pleased to have the chance to say how deeply sorry I and we all are for what happened to him. Alan and the many thousands of other gay men who were convicted, as he was convicted, under homophobic laws, were treated terribly.
So on behalf of the British government, and all those who live freely thanks to Alan's work, I am very proud to say: we're sorry. You deserved so much better.