A mathematical genius who cracked the German code during World War II took the secret with him

A mathematical genius who cracked the German code during World War II took the secret with him

Code breaking played a key role in the war. Swedish mathematician Arne Beurling is famous for breaking the German cipher machine "G Printer" in 1940. In fact, he was a genius who made Fields Medal-level achievements in mathematics, but his life and achievements in cryptanalysis were not known until more than 20 years ago. He himself never revealed the method of breaking the code, as he said: "Magicians never reveal their secrets."

Written by | Fan Ming

In mid-June 1941, disturbing news reached Sweden. Nazi Germany had drastically reduced its troops in the southern Baltic region, while its naval activities in the Baltic Sea had increased strongly. It was clear that a major military operation was brewing. Denmark and Norway had been occupied by the Nazis for more than a year. Was it Sweden's turn now? Despite this, the Swedish government and the top leaders of the Ministry of Defense did not take any measures beyond the existing preparations - neither general mobilization nor mobilization of troops. Why did this inaction occur? Paralysis of action or irresponsibility? These speculations were all wrong. In fact, as early as a few weeks ago, the government had learned that the German army's unusual military actions were not aimed at Sweden, but at the Soviet Union's "Operation Barbarossa". In order to reduce unnecessary concerns among the people of the country, the government decided to remain silent, which could save a lot of resources and avoid alarming Hitler.

The hero behind the German plan was a Swedish mathematician, Arne Beurling (1905-1986), who cracked the German strategic military communications code "Geheimschreiber" in 1940. This is one of the greatest achievements in the history of cryptography, comparable to the feats of Marian Rejewski of Poland and Alan Turing of Britain who cracked the German Enigma (Enigma means "enigma" in Greek) cipher machine. However, for a long time after the war, Beurling's name and deeds were little known. It was not until 1996 that the book "Sweden's Codebreaker" written by Swedish cryptanalyst and writer Bengt Beckman was published, which presented the life of this extraordinary master to the world. This is a true story with almost all the elements of a thriller: the cruel war years, the lonely mathematical genius, the mysterious decoding "magician"...

Arne Berling Photo credit: popularhistoria.se

The beginnings of encryption technology and the cipher industry

Cryptography is an ancient science. The history of human beings using codes and ciphers to transmit secret information is almost as long as the history of using text. Since hundreds of years before Christ, there have been single-table substitution ciphers used by Hebrew scholars, "Seta cipher sticks" used by Spartans for transposition encryption, "Polybius square table" beat ciphers in the Hellenistic era, and "Caesar cipher" of substitution encryption technology in the Roman Republic. Around 1467, Leon Battista Alberti, a generalist in the Italian Renaissance known as the "father of Western cryptography", proposed a multi-table encryption method, which later developed into a multi-table encryption system composed of a series of Caesar ciphers - "Viginaire cipher", and eventually gave birth to the "one-time pad" with perfect confidentiality in theory. This type of classic cipher is mainly encrypted using pen and paper, or simple mechanical auxiliary tools.

Sweden is a country with many inventors. The world's first cipher machine may be related to the 18th-century Swedish nobleman Baron Fredrik Gripenstierna, who proposed a design for a cipher machine in a letter to King Gustav III of Sweden on September 23, 1786. Gripenstierna wrote in the letter that he drew the drawings of the machine based on what he learned from his grandfather, the famous Swedish scientist and inventor Christopher Polhem, when he was young. Polhem had correspondence with British mathematician and cryptologist John Wallis, who was Newton's teacher and proposed the infinity symbol ∞. Polhem's idea of ​​the cipher machine came from the ideas in the book "The Abacus of Numbers" by Athanasius Kircher, a German Jesuit member and generalist. Gustav III was very interested in this idea, and a Swedish company built a prototype in the same year.

Although the drawings and machines of the Gripenstina cipher machine have been lost, its appearance can be roughly guessed from the description in his letter to Gustav III. This is a cylindrical machine composed of 57 rotating metal disks, which are arranged next to each other and can rotate around the axis. Half of each disk is marked with letters and special characters in sequence, and the other half is numbers between 0 and 99 arranged in a random order. Users can encrypt and decrypt text messages by exchanging letters, characters and numbers and rotating the disks. This cipher machine has a total of about 41,076 possible alphabets. Thomas Jefferson, one of the founding fathers of the United States, invented a similar device with 36 disks in 1795, the "Jefferson Disk", but it was not put into use until 1922, when Americans made the M-94 cipher machine based on its principle.

In the early 20th century, with the invention of some electric machines, more complex and effective encryption methods came into being, and a group of cryptographic geniuses emerged. For example, Swedish mathematician Arvid Damm was also an engineer and inventor, who received his doctorate from Uppsala University in 1896. In July 1916, he co-founded a Swedish limited company AB Cryptograph with Olof Gyldén, a naval officer who was also interested in cryptography. It was probably the first company in the world to focus entirely on encryption machines and achieve commercial success. Damm was one of the early inventors of the wired rotor principle for machine encryption. He applied for a Swedish patent and designed several cipher machines, including the B1 prototype, which could automatically encrypt input text. In 1922, the Nobel family and the Hagelin family injected capital into the bankrupt AB Cryptograph. Three years later, Boris Hagelin took over the management of the company on behalf of his family, reorganized and renamed it, and produced a simplified but practical version of the B1 cipher machine, the B21, which was sold to the Swedish military.

Hagelin's main competitor was German electrical engineer Arthur Scherbius, whose Enigma machine went into mass production in 1925. Hagelin's products competed with earlier versions of the Enigma machine, but sold better. His most famous product was the C36, and he sold tens of thousands of smaller versions to the US military during World War II. Hagelin later moved to Switzerland and founded Crypto AG in Bern in 1952, closing the Swedish company in 1958. After the war, Crypto AG quickly became a leader in the cipher machine industry, and also copied two Gripenstiuna machines in the 1970s. Hagelin is also the only cipher machine manufacturer in history to become a billionaire. As the world's communications went digital, the company was broken up and sold in 2018.

Three-rotor Enigma machine (left) and C36 cipher machine (right) | Image source: Wikipedia

Signal Interception and Cryptanalysis

Cryptanalysis is the study of decrypting encrypted information without knowing the secret information. The English word cryptanalysis comes from the Greek kryptós, meaning "to hide", and analýein, meaning "to unravel". Although the word did not appear until 1920, the methods of breaking codes and cipher machines are much older. Cryptanalysis and cryptography have evolved together and are considered two sides of the same coin: in order to create a secure code, it is necessary to consider the possibility of cryptanalysis. Successful cryptanalysis has had a significant impact on the course of history, especially in wartime. In January 1917 during World War I, the British intelligence agency intercepted and deciphered the German Foreign Ministry's "Zimmermann Telegram", which became the direct cause of the United States' entry into the war. The successful cracking of the German Enigma machine in World War II enabled the Allies to win the European battlefield in advance and played a decisive role in the entire war.

As early as the beginning of the 20th century, the Swedish military had its own signal intelligence and encryption department, which successfully cracked some encrypted messages from the Russian Baltic Fleet during World War I. Sweden had signed a cooperation agreement with Germany to share this intelligence and allowed the German Foreign Ministry to send telegrams to overseas embassies on Swedish warships. In return, Germany granted Sweden access to the methods and results of the encryption department and trained encryption professionals for it. The Zimmermann telegram was sent to the German ambassador to Mexico in this way, which disclosed the plan of unrestricted submarine warfare and suggested that Mexico and Germany form a military alliance against the United States. This telegram was intercepted by the British and passed on to the United States. In the 1930s, the Swedish Navy strengthened its work on intercepting radio signals from Russia, Germany, Britain and other countries on naval bases and ships along the Baltic Sea, and began to train its own cryptography and cryptanalysis talents.

Yves Gyldén (1895–1963) was a pioneer and the most important expert in cryptography and cryptanalysis in Sweden in the 1930s. His father, Olof Gyldén, was Arvid Damm's business partner and his grandfather was the famous astronomer Hugo Gyldén. Gyldén had both linguistic and mathematical talents and was fluent in Swedish, French and Spanish. He believed that cryptanalysis was an art. In 1931, Gyldén published the book "The Contribution of Cryptographic Agencies in the World Wars", which introduced the coding and decryption operations of all European countries from the 1880s to World War I, and predicted the role of cryptanalysis in future wars. Gyldén was also an excellent teacher. He taught cryptography and cryptanalysis courses in many military schools. Many encryption machines developed by Hagelin during the same period were based on the latest advances in cryptanalysis, including Gyldén's work.

As cryptographic algorithms became increasingly complex, cryptanalysis gradually became primarily dependent on mathematical methods. In 1924, 19-year-old Arne Bölling entered the Department of Mathematics at Uppsala University. He became interested in encryption and codebreaking during his military service in 1930–1931. During a weekend course, Bölling visited the Swedish Defense Department's B21 cipher machine. After inspecting the machine, he claimed that the machine had security flaws. The next day he came up with a solution, which surprised the course instructor. After his service, Bölling returned to Uppsala University to continue his studies, obtained a doctorate, and later became a professor. On July 1, 1937, the General Staff of the Swedish Armed Forces (Försvarsstaben) was officially established, with ten departments including the Cipher Department, and began to train cryptanalysts. Gilden served as an instructor for courses such as cryptanalysis and statistical applications, and Bölling also participated in organizing a cryptography course part-time.

The former site of the General Staff's Cipher Department | Source: popularhistoria.se (left) and the author (right)

Scandinavia's geopolitical location, political games in unpredictable events, and military build-up in the later stages of the war kept the Swedish government neutral throughout World War II. On July 1, 1942, the department in the General Staff of the Swedish Armed Forces responsible for signal intelligence and encryption was divided into an independent agency, the "Armed Forces Radio Bureau" (Försvarsväsendets Radioanstalt), abbreviated as FRA. During the war, the General Staff's cipher department was located in an old building at Karlaplan 4 in the center of Stockholm. Now the building has been demolished and rebuilt. In October 2022, FRA placed a commemorative plaque at the door of the old site with the inscription: "The signal intelligence service department operated in this building from 1939 to 1943. The Swedish Armed Forces Radio Bureau pays tribute to the men and women who worked silently here and made great contributions to the country."

Deciphering the German G code printer

After the outbreak of World War II, Berling was drafted into the army and entered the intelligence encryption department. His team was initially assigned to study the Soviet information transmission system and successfully deciphered 10,400 telegrams from the Baltic Fleet - the Soviets used four-digit and five-digit codes with additional super encryption. In peacetime, the Swedish Ministry of Defense has never had such a deep understanding of the organization and operation of important foreign defense departments. In the summer of 1940, Berling achieved the most outstanding achievement of his life: cracking the German G code printer, which was used for telex communications between the German Embassy in Stockholm and Norway. In April 1940, shortly after Germany occupied Denmark and Norway, it asked Sweden to lease the cable between Oslo and Copenhagen along the west coast. Although this move was contrary to Sweden's position as a neutral country, it provided a rare opportunity to crack the German code.

The Halske T52 G-printer from Siemens of Germany is a large teletype with built-in encryption, mainly used by senior Nazi military personnel and diplomatic missions. Compared with the G-printer, the Enigma machine is much smaller and widely used by the German army and submarines. The Enigma machine has no printed text and must be used by two people. Deciphering the code requires access to the physical machine and requires a lot of computing resources. It was at the critical stage when the British encountered difficulties in deciphering the code that they obtained the cipher machine from three German submarines to decipher it, but the Swedish defense department did not have these conditions at the time. Cracking the G-printer means that the Swedish government and the top leaders of the Ministry of Defense can understand the intelligence of the highest-level personnel who control the war situation at the most critical moment of the German offensive threat, such as the "Operation Barbarossa" mentioned at the beginning of this article, which provides important support for keeping Sweden away from war.

A G printer collected by the Swedish Military Museum | Source: Photo by the author

The G-printer used the most advanced encryption methods of the time, including the use of ten code wheels of different sizes, which could be connected to relays in a variety of ways to convert the five-digit teletype characters entered into other encrypted characters. These characters were decrypted by the receiver using a machine set up according to the same conventions, with a total of 893,622,318,929,520,960 different combinations possible. Based on coded telegrams intercepted by Swedish intelligence and plain text sent by undercover agents in the German embassy, ​​Berlin selected the information flow that matched the sender and receiver within 24 hours of May 25, 1940 and printed it out word for word. After two weeks of thinking and calculating, he completed the cracking work using only pen and paper. Before this, Berlin knew nothing about teletype machines and their encryption methods, and the Germans believed that the G-printer was unbreakable, so his success attracted widespread public attention after the war.

Berling never complicated simple problems. He did not use advanced mathematical knowledge and mysterious formulas in his work. Instead, he took full advantage of some weaknesses in the design and operation of the G printer and the way German operators processed information, such as sending messages with the same settings multiple times. Based on the codes generated by the G printer, Berling also designed a mathematical model of the device. With the help of engineer Vigo Lindstein, they built a machine that worked exactly the opposite of the G printer and named it "App". Germany's encrypted messages sent to this machine could be directly converted into plain text and printed out, automating the decryption process and saving a lot of time for decryption personnel to translate telegrams by hand. Germany's top military secrets were sent to the desks of senior Swedish security officials in real time until the end of 1943, when the German side discovered the loopholes and used new systems and encryption technology to plug them.

Part of the original document used to crack the G-printer code | Image source: fra.se

During his lifetime, Berling was very tight-lipped about his decryption methods. One of his famous sayings was: " Magicians never reveal their secrets ." Berling's former student in Uppsala, Carl-Gösta Borelius, a long-time FRA cryptanalyst and director of the data center, was involved in the decryption of the G printer from 1941 to 1943. An important clue is that during the use of the G printer, operators usually inserted alpha shifts at each space to avoid falling into digital patterns, which means that alpha shift + space is a common combination. In the 1980s, Borelius wrote an internal report speculatively reconstructing Berling's possible method, arguing that 3 = letter shift, 4 = number shift, and 5 = space. In the fall of 1940, Berling also cracked the encrypted telegrams in Czech without knowing the language at all, which made him feel even more accomplished than decrypting the G printer.

A rare mathematician

Born in Gothenburg on the west coast of Sweden, his father was an experienced and bad-tempered captain. In 1928, Berling began to study for a doctorate under the guidance of Anders Wiman, a mathematics professor at Uppsala University, and was deeply influenced by another professor, Erik Holmgren. The following year, he and Finnish mathematician Lars Ahlfors proved the Denjoy conjecture on the asymptotic value of holomorphic functions at about the same time. However, Berling dropped out of school that year to go crocodile hunting in Panama with his father, and later went to serve in the military. Therefore, he did not publish his research results until 1933 and received his doctorate, missing the Fields Medal, which was first awarded in 1936. Berling's doctoral thesis, Etudes sur un problème de majoration, written in French, became one of the most influential mathematical documents at the time.

After graduating with a doctorate, Berling taught at Uppsala University and became one of the two professors in the department in 1937. He devoted his most creative years to breaking German codes in order to serve his country. From 1948 to 1949, Berling was invited by Ahlfors to be a visiting professor at Harvard University. In 1954, he resigned from his teaching position in Uppsala and became a tenured professor at the Institute for Advanced Study at Princeton, where he inherited Einstein's office until his retirement in 1973. Berling's main research areas are harmonic analysis, complex analysis and potential theory. He integrated these three fields in a unique way and made many important contributions. Berling is a very creative mathematician. He is well-known in the mathematical community for his contributions such as the Beurling theorem of invariant subspaces, the Beurling-Ahlfors theorem of quasi-conformal mappings and the Beurling-Malliavin theorem in function theory. He is considered a master of analytical mathematics.

Berlin on his yacht after the war (left) and in his later years in Princeton (right) | Source: iva.se

One dimension of Berling's thinking is guided not by logic but by sensibility, intuition and beauty. For him, the world of mathematics seems to be integrated with real life. Berling is a perfectionist who selectively publishes articles only after all the details are solved, so many of his manuscripts have never been published. Berling is very charismatic, has a very strong sense of justice and fair play, and is unquestionably loyal and generous to his friends, willing to share his ideas selflessly. Anyone who is close to him will be infected by his strong personality and passion for mathematics. Berling has a strong physique and loves outdoor hiking, adventure, hunting and sailing, which is quite in line with his father's legacy. There seems to be some magic from the Nordic primeval forest hidden in his research work. Reading his papers will make people feel that they are led by a strong hand through the fascinating natural scenery.

On the other hand, Berling could not tolerate others' doubts about his intelligence and ability, and had a strong sense of ownership of his research results. He was very sensitive to unfair treatment, especially not good at dealing with bureaucratic institutions, which caused some conflicts and tragedies in interpersonal relationships. As early as 1939, when Berling and Gilden worked together in the defense department, the two heavyweights in the Swedish cryptography industry had a physical conflict. After cracking the German G printer code, Berling's position seemed irreplaceable, but his relationship with the military leadership and some colleagues was far from harmonious. After the establishment of the Radio Bureau FRA in 1942, the new director terminated Berling's employment contract. He returned to Uppsala University to continue his mathematical research and teaching, and served as a consultant to the Radio Bureau until the end of the war. In Uppsala, he and another professor in the Department of Mathematics were incompatible, and the two never spoke.

Berling mentored nine PhD students in his lifetime. His favorite student, Lennart Carleson, winner of the 2006 Abel Prize, was attracted by Berling's personality and chose mathematician as his lifelong career. Carleson described his mentor in this way: "Berlin has a complex and passionate relationship with mathematics. It is said that Newton regarded the universe as a code created by God for scientists to analyze. I think this is Berling's view on mathematics. He only accepts pure and beautiful theories, and he measures his own and others' works with the attitude of an artist." In the early 1950s, the trend of analytical mathematics shifted from classical analysis to abstract analysis. Carleson believed that this marginalized Berling to some extent, and his genius and achievements were greatly underestimated. During his more than 20 years at Princeton, Berling always felt lonely. It seemed that the United States was not a place suitable for him.

Berlin's bust and family cemetery | Source: Wikipedia (left) and author's photo (right)

On November 20, 1986, Berlin died in Princeton at the age of 81 and was buried in the family plot in the northern cemetery of Stockholm. On the occasion of Berlin's centenary in 2005, the Department of Mathematics at Uppsala University erected a bust of him, which is now placed on the campus of the Department of Mathematics. Berlin was a rare genius. Whether engaged in technical or theoretical work, whether cryptanalysis or mathematical research, as his lifelong friend and collaborator Alfors said: "In everything Berlin did, talent was everywhere." Carlsson and Alfors agreed that Berlin's academic legacy will have an impact on mathematicians for many years, perhaps even generations. Berlin is regarded as a national pride in Sweden for his feat of cracking German codes during World War II. In today's increasingly turbulent international situation and the vital importance of network security, commemorating Berlin is more realistic.

This article is supported by the Science Popularization China Starry Sky Project

Produced by: China Association for Science and Technology Department of Science Popularization

Producer: China Science and Technology Press Co., Ltd., Beijing Zhongke Xinghe Culture Media Co., Ltd.

Special Tips

1. Go to the "Featured Column" at the bottom of the menu of the "Fanpu" WeChat public account to read a series of popular science articles on different topics.

2. Fanpu provides a function to search articles by month. Follow the official account and reply with the four-digit year + month, such as "1903", to get the article index for March 2019, and so on.

Copyright statement: Personal forwarding is welcome. Any form of media or organization is not allowed to reprint or excerpt without authorization. For reprint authorization, please contact the backstage of the "Fanpu" WeChat public account.

<<:  The sleep bug used by Sun Wukong, you have actually seen it! 丨Bolan Daily

>>:  Narcissus or garlic sprouts? Beware of poisoning if you eat the wrong one!

Recommend

In 10 minutes, you can realize global prompt of network status changes in APP

Never expect users to follow your pre-set steps t...

OPEC: World Oil Outlook 2020 (332 pages)

OPEC released its 2020 World Oil Outlook on Thurs...

An introduction to Kugou advertising promotion styles and material specifications!

Kugou is Tencent’s first social karaoke applicati...

Has the secret of crop circles been solved long ago?

If you see strange patterns in a wheat field, you...

Internet finance operation: one picture analyzes user operation!

The work content of user operation is complex and...

The product promotion logic of Internet advertising!

What the advertising business sells is every one ...

Analysis of GuangDianTong information flow optimization techniques!

Guangdiantong is one of Tencent’s two major infor...

Android source code warehouse management

Source code introduction A simple warehouse manag...

What are the best attributions for app promotion at present?

The App has been developed, the advertising has b...