Though not known at the time, the outcome of World War II and the defeat of the Nazis is thanks to a gay man, Alan Turing. A pioneering computer scientist and mathematician, Turing worked for British intelligence at the Government Code & Cypher School. There, he and his team developed several methods for cracking German ciphers, including their naval Enigma machine, which is estimated to have shortened the war by as many as four years and saving over fourteen million lives in the process. After the war, Turing worked on models of some of the earliest computers in 1945 (then called the Automated Computing Engine), which wouldn't be finished until after his death. He also added extensively to the fields of mathematical biology (specifically studying the Fibonacci sequence in plant structure) and pattern formation (including designing the first computerized chess program, for a machine that didn't even exist in his lifetime).
Despite his vast accomplishments, Turing was indicted for his sexuality in Great Britain in 1952. He was forced to admit a sexual relationship with a man after reporting a burglary in his home, but homosexual acts were a crime then in the UK. He and his lover, Arnold Murray, were charged with gross indecency, to which Turing plead guilty. The court allowed him the choice between imprisonment or probation, the latter of which included undergoing hormone treatments commonly called chemical castration. He chose probation, which led to impotency and gynecomastia (the growth of male breasts). Because of his conviction, he was no longer allowed to consult British intelligence on matters of cryptography, effectively leaving Turing unemployed as well. He died on June 8, 1954 of cyanide poisoning, assumed to have been purposefully ingested via a poisoned apple (though theories of an accidental death exist). Because his work with the Allies in World War II was classified at the time, he died a disgrace rather than the hero he is now known to be. In recent years, he's been recognized as one of the most influential people of the 20th century, and a royal pardon was issued in 2013 for Turing's indecency conviction.