The Enigma Machine

Total Page:16

File Type:pdf, Size:1020Kb

The Enigma Machine Eric Roberts Handout #31 CS 106A February 3, 2016 The Enigma Machine Cryptography—Bletchley Park The Enigma Machine Bletchley Oxford Eric Roberts CS 106A I’ve twice had the opportunity to teach cryptography at Stanford February 3, 2016 in Oxford, which made it possible to visit Bletchley Park—the home of the Government Code and Cipher School (GCCS), where the Enigma code was broken. Cryptography—Bletchley Park Overview of Assignment #4 Part 1: Check that a key is legal In a letter-substitution cipher, the key must be a permutation of the alphabet, which means that it contains all the letters of the alphabet in some order. Your job in Part 1 is to add code to check that the key entered in the LetterSubstitutionCipher program is legal, as in the following sample run: LetterSubstitutionCipher Letter-substitution cipher. Enter 26-letter key: SHORTKEY That key is illegal. Enter 26-letter key: AABCDEFGHIJKLMNOPQRSTUVWXY That key is illegal. Enter 26-letter key: BCDEFGHIJKLMNOPQRSTUVWXYZA Plaintext: HAL 9000 In our field trips to Bletchley Park, our tour was led by Jean Ciphertext: IBM 9000 Valentine, who worked with the Bombe decryption machine shown in these pictures. Overview of Assignment #4 Overview of Assignment #4 Part 2: Invert a key Part 3: Simulate the Enigma Machine In a letter-substitution cipher, the sender and receiver must use different keys, one for encryption and one for decryption. Your job in Part 2 is to write an invertKey method that determines the decryption key from the encryption key by going through the alphabet and, for each letter, figuring out what plaintext letter would have produced that letter in the ciphertext. Encryption key: ABCDEFGH I JKLMNOPQRSTUVWXYZ |||||||||||||||||||||||||| LZDRXPEAJYBQWFVI HCTGNOMKSU Decryption key: A B C D E F G H I J K L MN O P Q RWS T U V X Y Z | | | | | | | | | | | | | | | | ||| | | ||| | | H (you should practice filling in the rest) – 2 – The Enigma Rotors The Enigma Structure Operation of the Enigma Machine • Whenever the operator types a letter key on the Enigma, the following things happen: 1. The force of the key press advances the fast rotor one position. If the indicator on the fast rotor wraps around from Z to A, that action “carries” to the medium rotor, just like the digits on an odometer. Similarly, if the medium rotor passes Z, the slow rotor advances one position. 2. An electrical signal is fed into the wire corresponding to the key, which then flows through seven letter-substitution steps: – Through the fast rotor from right to left. – Through the medium rotor from right to left. – Through the slow rotor from right to left. – Through the reflector, which turns the signal around. – Through the slow rotor from left to right. – Through the medium rotor from left to right. – Through the fast rotor from left to right and then on to the lamp. Encoding the Letter “A” The Next “A” Is Different – 3 – What Made Enigma Vulnerable? Breaking the Enigma Code • Early in the war, mathematicians working for the Polish • The most common technique used at Bletchley Park was the Resistance were able to smuggle Enigma machines to France known-plaintext attack, in which the codebreakers guess that and England along with a strategy for breaking the code. a particular sequence of characters exists somewhere in the • The British government established a top-secret cryptography decoded message. A sequence of characters that you guess is center at Bletchley Park and staffed it with the top British part of the plaintext is called a crib. mathematicians. • Breaking an Enigma message required the following steps: • The decryption team at Bletchley was able to exploit the – Align the crib with the ciphertext to eliminate crashes in which following facts about the Enigma machine: a letter appears to map to itself. – The encoding is symmetrical. – Create a menu recording the links between letter pairs in the – The Enigma machine can never map a character into itself. crib and ciphertext. • The codebreakers were also helped by the fact that the – Identify loops in the menu at which a chain of letter pairs Germans were both careless and overconfident. In believing cycles back to the original letter. they had an unbreakable encoding machine, they failed to – Use the loops in the menu to create a wiring pattern for an take adequate measures to safeguard the integrity of their electromechanical device called a Bombe that searches for communications. settings of the Enigma rotors that produce the observed pattern. Step 1: Align the Crib and Ciphertext Step 2: Construct the Menu Offset 0: V R L B Z P W M E P M I H F S R J X F M J K W R A K E I N E B E S O N D E R E N E R E I G N I S S E U A E N F V R L B Z P W M E P M I H F S R J X F M J K W R A X Q E Z 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 K E I N E B E S O N D E R E N E R E I G N I S S E This offset crashes at positions 3 and 13. 0 L K V Offset 1: 2 21 U A E N F V R L B Z P W M E P M I H F S R J X F M J K W R A X Q E Z 18 5 K E I N E B E S O N D E R E N E R E I G N I S S E O F I H P B This offset crashes at position 1. 8 3 13 11 12 9 Offset 5: 4 1, 15 16 20 Z E R J N G U A E N F V R L B Z P W M E P M I H F S R J X F M J K W R A X Q E Z 6 23 K E I N E B E S O N D E R E N E R E I G N I S S E 24 17 14 19 No crashes exist in this alignment, so it is a feasible solution. 22 7 10 A X W S M D Step 3: Find the Loops V R L B Z P W M E P M I H F S R J X F M J K W R A K E I N E B E S O N D E R E N E R E I G N I S S E 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0 L K V 2 21 18 5 O F I H P B 8 3 13 11 12 9 4 1, 15 16 20 Z E R J N G 6 23 24 17 14 19 22 7 10 A X W S M D.
Recommended publications
  • To What Extent Did British Advancements in Cryptanalysis During World War II Influence the Development of Computer Technology?
    Portland State University PDXScholar Young Historians Conference Young Historians Conference 2016 Apr 28th, 9:00 AM - 10:15 AM To What Extent Did British Advancements in Cryptanalysis During World War II Influence the Development of Computer Technology? Hayley A. LeBlanc Sunset High School Follow this and additional works at: https://pdxscholar.library.pdx.edu/younghistorians Part of the European History Commons, and the History of Science, Technology, and Medicine Commons Let us know how access to this document benefits ou.y LeBlanc, Hayley A., "To What Extent Did British Advancements in Cryptanalysis During World War II Influence the Development of Computer Technology?" (2016). Young Historians Conference. 1. https://pdxscholar.library.pdx.edu/younghistorians/2016/oralpres/1 This Event is brought to you for free and open access. It has been accepted for inclusion in Young Historians Conference by an authorized administrator of PDXScholar. Please contact us if we can make this document more accessible: [email protected]. To what extent did British advancements in cryptanalysis during World War 2 influence the development of computer technology? Hayley LeBlanc 1936 words 1 Table of Contents Section A: Plan of Investigation…………………………………………………………………..3 Section B: Summary of Evidence………………………………………………………………....4 Section C: Evaluation of Sources…………………………………………………………………6 Section D: Analysis………………………………………………………………………………..7 Section E: Conclusion……………………………………………………………………………10 Section F: List of Sources………………………………………………………………………..11 Appendix A: Explanation of the Enigma Machine……………………………………….……...13 Appendix B: Glossary of Cryptology Terms.…………………………………………………....16 2 Section A: Plan of Investigation This investigation will focus on the advancements made in the field of computing by British codebreakers working on German ciphers during World War 2 (1939­1945).
    [Show full text]
  • How I Learned to Stop Worrying and Love the Bombe: Machine Research and Development and Bletchley Park
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by CURVE/open How I learned to stop worrying and love the Bombe: Machine Research and Development and Bletchley Park Smith, C Author post-print (accepted) deposited by Coventry University’s Repository Original citation & hyperlink: Smith, C 2014, 'How I learned to stop worrying and love the Bombe: Machine Research and Development and Bletchley Park' History of Science, vol 52, no. 2, pp. 200-222 https://dx.doi.org/10.1177/0073275314529861 DOI 10.1177/0073275314529861 ISSN 0073-2753 ESSN 1753-8564 Publisher: Sage Publications Copyright © and Moral Rights are retained by the author(s) and/ or other copyright owners. A copy can be downloaded for personal non-commercial research or study, without prior permission or charge. This item cannot be reproduced or quoted extensively from without first obtaining permission in writing from the copyright holder(s). The content must not be changed in any way or sold commercially in any format or medium without the formal permission of the copyright holders. This document is the author’s post-print version, incorporating any revisions agreed during the peer-review process. Some differences between the published version and this version may remain and you are advised to consult the published version if you wish to cite from it. Mechanising the Information War – Machine Research and Development and Bletchley Park Christopher Smith Abstract The Bombe machine was a key device in the cryptanalysis of the ciphers created by the machine system widely employed by the Axis powers during the Second World War – Enigma.
    [Show full text]
  • STEM DISCOVERY: LONDON 8 Or 11 Days | England
    ® Learn more at Tour s for Girl Scouts eftours.com/girlscouts or call 800-457-9023 STEM DISCOVERY: LONDON 8 or 11 days | England Let STEM be your guide during your exploration of London. Uncover secret messages at Bletchley Park, the birthplace of modern information technology. Practice your sleuthing skills during a CSI-inspired forensics workshop. And plant your feet on two different hemispheres at the Royal Observatory in Greenwich, with the English capital as your backdrop. Make a special visit to Pax Lodge in Hampstead where you will participate in unique Girl Scout programming. EVERYTHING YOU GET: Full-time Tour Director Sightseeing: 2 sightseeing tours led by expert, licensed local guides (3 with extension) Entrances: London Eye, Science Museum/Natural History Museum, Tower of London, theater show, National Museum of Computing, Thames River Cruise, Royal Observatory; with extension: Louvre; Notre-Dame Cathedral Experiential learning: Forensics workshop, Stonehenge activities, Bletchley Park interactive workshop WAGGGS Centre visit: Pax Lodge All of the details are covered: Round-trip flights on major carriers; Comfortable motorcoach; Eurostar high-speed train with extension; 7 overnight stays in hotels with private bathrooms (9 with extension); European breakfast and dinner daily DAY 1: FLY OVERNIGHT TO ENGLAND DAY 2: LONDON – Meet your Tour Director at the airport in London, a city that has become one of the world’s great melting pots while maintaining a distinct character that’s all its own. – Take a walking tour of the city and ride the London Eye, a large Ferris wheel along the River Thames that offers panoramic views of the city.
    [Show full text]
  • Polish Mathematicians Finding Patterns in Enigma Messages
    Fall 2006 Chris Christensen MAT/CSC 483 Machine Ciphers Polyalphabetic ciphers are good ways to destroy the usefulness of frequency analysis. Implementation can be a problem, however. The key to a polyalphabetic cipher specifies the order of the ciphers that will be used during encryption. Ideally there would be as many ciphers as there are letters in the plaintext message and the ordering of the ciphers would be random – an one-time pad. More commonly, some rotation among a small number of ciphers is prescribed. But, rotating among a small number of ciphers leads to a period, which a cryptanalyst can exploit. Rotating among a “large” number of ciphers might work, but that is hard to do by hand – there is a high probability of encryption errors. Maybe, a machine. During World War II, all the Allied and Axis countries used machine ciphers. The United States had SIGABA, Britain had TypeX, Japan had “Purple,” and Germany (and Italy) had Enigma. SIGABA http://en.wikipedia.org/wiki/SIGABA 1 A TypeX machine at Bletchley Park. 2 From the 1920s until the 1970s, cryptology was dominated by machine ciphers. What the machine ciphers typically did was provide a mechanical way to rotate among a large number of ciphers. The rotation was not random, but the large number of ciphers that were available could prevent depth from occurring within messages and (if the machines were used properly) among messages. We will examine Enigma, which was broken by Polish mathematicians in the 1930s and by the British during World War II. The Japanese Purple machine, which was used to transmit diplomatic messages, was broken by William Friedman’s cryptanalysts.
    [Show full text]
  • The First Americans the 1941 US Codebreaking Mission to Bletchley Park
    United States Cryptologic History The First Americans The 1941 US Codebreaking Mission to Bletchley Park Special series | Volume 12 | 2016 Center for Cryptologic History David J. Sherman is Associate Director for Policy and Records at the National Security Agency. A graduate of Duke University, he holds a doctorate in Slavic Studies from Cornell University, where he taught for three years. He also is a graduate of the CAPSTONE General/Flag Officer Course at the National Defense University, the Intelligence Community Senior Leadership Program, and the Alexander S. Pushkin Institute of the Russian Language in Moscow. He has served as Associate Dean for Academic Programs at the National War College and while there taught courses on strategy, inter- national relations, and intelligence. Among his other government assignments include ones as NSA’s representative to the Office of the Secretary of Defense, as Director for Intelligence Programs at the National Security Council, and on the staff of the National Economic Council. This publication presents a historical perspective for informational and educational purposes, is the result of independent research, and does not necessarily reflect a position of NSA/CSS or any other US government entity. This publication is distributed free by the National Security Agency. If you would like additional copies, please email [email protected] or write to: Center for Cryptologic History National Security Agency 9800 Savage Road, Suite 6886 Fort George G. Meade, MD 20755 Cover: (Top) Navy Department building, with Washington Monument in center distance, 1918 or 1919; (bottom) Bletchley Park mansion, headquarters of UK codebreaking, 1939 UNITED STATES CRYPTOLOGIC HISTORY The First Americans The 1941 US Codebreaking Mission to Bletchley Park David Sherman National Security Agency Center for Cryptologic History 2016 Second Printing Contents Foreword ................................................................................
    [Show full text]
  • Code Breaking at Bletchley Park
    Middle School Scholars’ CONTENTS Newsletter A Short History of Bletchley Park by Alex ​ Lent Term 2020 Mapplebeck… p2-3 Alan Turing: A Profile by Sam Ramsey… ​ Code Breaking at p4-6 Bletchley Park’s Role in World War II by ​ Bletchley Park Harry Martin… p6-8 Review: Bletchley Park Museum by ​ Joseph Conway… p9-10 The Women of Bletchley Park by Sammy ​ Jarvis… p10-12 Bill Tutte: The Unsung Codebreaker by ​ Archie Leishman… p12-14 A Very Short Introduction to Bletchley Park by Sam Corbett… p15-16 ​ The Impact of Bletchley Park on Today’s World by Toby Pinnington… p17-18 ​ Introduction A Beginner’s Guide to the Bombe by Luca ​ “A gifted and distinguished boy, whose future Zurek… p19-21 career we shall watch with much interest.” This was the parting remark of Alan Turing’s Headmaster in his last school report. Little The German Equivalent of Bletchley could he have known what Turing would go on Park by Rupert Matthews… 21-22 ​ to achieve alongside the other talented codebreakers of World War II at Bletchley Park. Covering Up Bletchley Park: Operation Our trip with the third year academic scholars Boniface by Philip Kimber… p23-25 this term explored the central role this site ​ near Milton Keynes played in winning a war. 1 intercept stations. During the war, Bletchley A Short History of Bletchley Park Park had many cover names, which included by Alex Mapplebeck “B.P.”, “Station X” and the “Government Communications Headquarters”. The first mention of Bletchley Park in records is in the Domesday Book, where it is part of the Manor of Eaton.
    [Show full text]
  • The Imitation Game, Ca1rncross 1S Shown As a Mathematical Cryptanalyst Who Worked in the Same Section As Alan Turing
    NSA Daily - HISTORY TODAY - 16 January 2015 Page 1 of2 DOCID: 4190908 Dynamic Page -- Highest Possible Class1f1cat1on 1s TOP SEERETh'Sl{TALENT t<:EYI IOLE/iREL TO USA, AUS, CAN, 68R, NZL (U) HISTORY TODAY - 16 January 2015 Run Date: 01/16/2015 (U) The recent motion picture about Alan Turing, The Im1tat1on Game, shows many of the interesting characters who worked at Bletchley Park during World War II. In order to emphasize certain aspects about the life of Dr. Turing, the script sometimes portrayed these other characters differently from the way they were in real life. I I (U) One of these was John Ca1rncross, who -- after the end of the war -- confessed to spying for the Soviet Union. (U) Although much about his spying career 1s still murky, History Today would like to compare what we do know with the way Ca1rncross was portrayed in the film. (U) SPOILER ALERT ON: In The Imitat10n Game, Camcross 1s portrayed as a cryptanalyst working in the section headed by Alan Turing, which 1s trying to solve the German Navy ENIGMA machine and develop the cryptanalytic bombe to exploit 1t on a regular basis. In a private conversation, Ca1rncross reveals that he has recognized that Turing 1s homosexual. When Turing later finds out that Ca1rncross 1 1s secretly bootlegging decrypts to the Soviet Union, Ca1rncross stops him from revealing this by threatening to make Turing's secret public. Later, Turing learns that British intelligence knew of Ca1rncross' 1ll1c1t life all along and was using him to pass d1smformat1on to the Soviet leader, Joseph Stalin.
    [Show full text]
  • Alan Turing and the Turing Test
    Dickinson College Dickinson Scholar Faculty and Staff Publications By Year Faculty and Staff Publications 11-2014 Alan Turing and the Turing Test John P. MacCormick Dickinson College Follow this and additional works at: https://scholar.dickinson.edu/faculty_publications Part of the Computer Sciences Commons Recommended Citation MacCormick, John. "Alan Turing and the Turing Test." Dickinson Science Magazine 1, no. 2 (2014): 31. This article is brought to you for free and open access by Dickinson Scholar. It has been accepted for inclusion by an authorized administrator. For more information, please contact [email protected]. I T*h..bqyl Alan Turing and the Turing Test John MacCormick Assoctets Pnoprsson or CovputEn ScrENct The movie is called The Imitation Game.Why? We'lI get back to that in a minute. First, who was Alan Turing, and why would anyone make a movie about him? He's sometimes described as a mathematician, some- times as an engineer, and sometimes as a computer scientist. All are true. His university degrees were in mathematics; he essentially founded the field of theoretical computer science with a breakthrough paper in the 1930s; and he later helped to engineer some of the earliest real computers. But for something worthy of the big screen, we can turn to Turing's contribution during the Second World War: he was a key member of the team that cracked the German naval Enigma code. It's generally accepted that his work saved many lives and considerably shortened the war. It also makes for an exciting movie script, especially when you consider that the work was done on a shoestring budget by a secret team operating at an English country mansion called Bletchley Park.
    [Show full text]
  • A Resource for Teachers! How to Use Your Richmond
    RICHMOND READERS A FREE RESOURCE FOR TEACHERS! Level 3 This level is suitable for students who have been learning English for at least three years and up to four years. It corresponds with the Common European Framework level B1. SYNOPSIS In 1939, at the beginning of World War II, the British government for homosexual activity. He is offered a choice: prison or pills. He brings together a team of top mathematicians to break the chooses the second. The medication is powerful and dangerous; German Enigma code. The most brilliant of the mathematicians it destroys his mind and his body. Alan commits suicide. is 27 year-old Alan Turing. He has no social skills, however, and soon annoys the rest of the team. He’s a homosexual, at a time THE BACK STORY when homosexual sex was illegal in Britain. Winston Churchill said that Alan Turing made the biggest single Alan wants to build a machine to break the code, an early contribution to the defeat of Nazi Germany. By brilliantly decoding version of a digital computer. The rest of the team think he’s Enigma, Turing gave the Allies a big advantage. Without Turing, wasting time and money, except for Joan Clarke who thinks the Hitler might have won. same way as Alan. The Imitation Game is a dramatised version of Alan Turing’s Joan’s parents are unhappy with her situation as a young story. The real Turing is described as warm and funny, by unmarried woman at Bletchley. Alan rescues the situation by people who knew him. Another important character in the film asking her to marry him.
    [Show full text]
  • File 6, Article 1
    This article tells of a secret letter from General Eisenhower praising the code breakers of Bletchley Park for their contribution to the Allied victory in Europe of World War II. Source: Sawer, Patrick. “Letter reveals Bletchley Park code breakers secretly thanked by General Eisenhower for “priceless” work.” The Telegraph. Online. Posted 1:07 pm GMT March 15, 2016. <http:// www.telegraph.co.uk/history/world-war-two/12194670/Letter- reveals-Bletchley-Park-code-breakers-secretly-thanked-by-General- Eisenhower-for-priceless-work.html? utm_source=dlvr.it&utm_medium=twitter>. Article 1 Article A previously secret letter from US President Dwight D Eisenhower praising the “priceless” work of the Bletchley Park code breakers in helping to win the war went on public display for the first time yesterday. The letter was sent at the end of the Second World War by General Eisenhower, who had been Supreme Commander of Allied Forces in Europe, to Sir Stewart Menzies, wartime chief of the Secret Intelligence Service, and had previously hung on the wall of the office of the Chief of MI6. It has now been put on public view, illustrating they importance the US Government placed on the work of the Bletchley Park code breakers in helping to defeat the Nazis. Letter reveals Bletchley Park code breakers secretly thanked by General Eisenhower for "priceless" work By Patrick Sawer A previously secret letter from US President Dwight D Eisenhower praising the “priceless” work of the Bletchley Park code breakers in helping to win the war went on public display for the first time yesterday. The letter was sent at the end of the Second World War by General Eisenhower, who had been Supreme Commander of Allied Forces in Europe, to Sir Stewart Menzies, wartime chief of the Secret Intelligence Service, and had previously hung on the wall of the office of the Chief of MI6.
    [Show full text]
  • The Historical Impact of Revealing the Ultra Secret
    DOCID: 3827029 Harold C. Deutsch UNCLASSIFIED @>pproved for Release bv NSA on 10-26-2006. FOIA Case# 51639 The Historical Impact of Revealing The Ultra Secret (Reprinted, with permission from Parameters Journal ofthe U.S. Army War College) We really should not have been greatly surprised. Enigma messages.3 To say this much was, of course, to When Group Captain (Colonel) F. W. Winterbotham·s affirm that the machine had not been invulnerable, that work, The Ultra Secrel, burst on our consciousness in its secrets had been at least partially unveiled, and that it 1974, it undoubtedly produced the most sweeping was Soviet rather than Western specialists who had sensation thus far created by an historical revelation.1 It achieved the near-impossible. Kahn did make one was sweeping. especially, in the sense of seeming to reference to the term " Ultra" but seemed to regard it as demand immediate and wholesale revision of historical merely another designation for the solving of the Japanese assumptions about virtually all that determined the course cipher system known as·· Magic." of World War II in the Atlancic sector. In view of the bombshell impact of Winterbotham's It astonishes one to reflecr on how little speculation book in the following year, it is astonishing how little there had been hitherto about the extent of codebreaking sensation resulted from the publication in 1973 of on the part of the Western Allies and how few pressures Gustave Bertrand's Et1ig"14 ou /11 p/111 grll'flde enigme de there had been on governments to answer perplexing la guerre 1939-1945.
    [Show full text]
  • Alan Turing and the Turing Test John Maccormick (Appeared In
    Alan Turing and the Turing test John MacCormick (appeared in Dickinson Science Magazine, volume 1 issue 2, p31) If you’re a fan of the British TV show Sherlock, you might be interested to hear that the lead actor in that show, Benedict Cumberbatch, will be starring as the legendary English scientist Alan Turing in a movie to be released this fall. The movie is called The Imitation Game. Why? We’ll get back to that in a minute. First, who was Alan Turing, and why would anyone make a movie about him? He’s sometimes described as a mathematician, sometimes as an engineer, and sometimes as a computer scientist. All are true. His university degrees were in mathematics; he essentially founded the field of theoretical computer science with a breakthrough paper in the 1930s; and he later helped to engineer some of the earliest real computers. But for something worthy of the big screen, we can turn to Turing’s contribution during the Second World War: he was a key member of the team that cracked the German naval Enigma code. It’s generally accepted that his work saved many lives and considerably shortened the war. And it also makes for an exciting movie script, especially when you consider that the work was done on a shoestring budget by a secret team operating at an English country mansion called Bletchley Park. (Many Dickinson students have visited Bletchley Park as part of the Norwich science program.) But where does the “imitation game” come into it? Well, it turns out that Turing didn’t stop after his seminal work on the theory of computation and cryptography.
    [Show full text]