{"id":2308,"date":"2023-05-08T18:51:05","date_gmt":"2023-05-08T18:51:05","guid":{"rendered":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/?post_type=chapter&#038;p=2308"},"modified":"2025-08-26T04:02:28","modified_gmt":"2025-08-26T04:02:28","slug":"cryptography-learn-it-4","status":"web-only","type":"chapter","link":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/chapter\/cryptography-learn-it-4\/","title":{"raw":"Cryptography: Learn It 4","rendered":"Cryptography: Learn It 4"},"content":{"raw":"<h2>Advanced Shared Symmetric-Key Methods<\/h2>\r\n<p>Both the substitution and transposition methods discussed so far are <strong>shared symmetric-key methods<\/strong>, meaning that both sender and receiver would have to have agreed upon the same secret encryption key before any methods could be sent.<\/p>\r\n<p>All of the methods so far have been susceptible to frequency analysis since each letter is always mapped to the same encrypted character. More advanced methods get around this weakness. For example, the Enigma machines used in World War II had wheels that rotated. Each wheel was a substitution cipher, but the rotation would cause the substitution used to shift after each character.<\/p>\r\n<p>For a simplified example, in the initial setup, the wheel might provide the mapping:<\/p>\r\n<p>Original: [latex]ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789[\/latex]<br \/>\r\nMaps to: [latex]2BQF5WRTD8IJ6HLCOSUVK3A0X9YZN1G4ME7P[\/latex]<\/p>\r\n<p>After the first character is encrypted, the wheel rotates, shifting the mapping one space, resulting in a new shifted mapping:<\/p>\r\n<p>Original: [latex]ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789[\/latex]<br \/>\r\nMaps to: [latex]P2BQF5WRTD8IJ6HLCOSUVK3A0X9YZN1G4ME7[\/latex]<\/p>\r\n<p>Using this approach, no letter gets encrypted as the same character over and over.<\/p>\r\n<section class=\"textbox example\">Encrypt the message \u201cSee me\u201d. Use a basic Caesar cipher with shift [latex]3[\/latex] as the initial substitution, but shift the substitution one place after each character.<br \/>\r\n[reveal-answer q=\"4330\"]Show Solution[\/reveal-answer]<br \/>\r\n[hidden-answer a=\"4330\"]The initial mapping is:<br \/>\r\n<br \/>\r\nOriginal: [latex]ABCDEFGHIJKLMNOPQRSTUVWXYZ[\/latex]\r\n\r\n<p>Maps to: [latex]DEFGHIJKLMNOPQRSTUVWXYZABC[\/latex]<br \/>\r\n<br \/>\r\n<\/p>\r\n<p>This would map the first letter, [latex]S[\/latex] to [latex]V[\/latex]. We would then shift the mapping by one.<br \/>\r\n<br \/>\r\n<\/p>\r\n<p>Original: [latex]ABCDEFGHIJKLMNOPQRSTUVWXYZ[\/latex]<\/p>\r\n<p>Now maps to: [latex]EFGHIJKLMNOPQRSTUVWXYZABCD[\/latex]<br \/>\r\n<br \/>\r\n<\/p>\r\n<p>Now the next letter, [latex]E[\/latex], will map to [latex]I[\/latex]. Again we shift the cipher<\/p>\r\n<p><br \/>\r\nOriginal: [latex]ABCDEFGHIJKLMNOPQRSTUVWXYZ[\/latex]<\/p>\r\n<p>Now maps to: [latex]FGHIJKLMNOPQRSTUVWXYZABCDE[\/latex]<\/p>\r\n<p><br \/>\r\nThe next letter, [latex]E[\/latex], now maps to [latex]J[\/latex]. Continuing this process, the final message would be [latex]VIJSL[\/latex].<\/p>\r\n<p>Notice that frequency analysis is much less useful now, since the character [latex]E[\/latex] has been mapped to three different characters due to the shifting of the substitution mapping.<\/p>\r\n<p>[\/hidden-answer]<\/p>\r\n<\/section>\r\n\r\n[caption id=\"attachment_2312\" align=\"alignright\" width=\"344\"]<img class=\"wp-image-2312 size-full\" src=\"https:\/\/content-cdn.one.lumenlearning.com\/wp-content\/uploads\/sites\/18\/2023\/05\/08185553\/Screenshot-2023-05-08-145516.png\" alt=\"An enigma machine, showing several wheels with the alphabet on them.\" width=\"344\" height=\"287\" \/> Figure 1. An engima machine[\/caption]\r\n\r\n<p>The actual Engima machines used in WWII were more complex. Each wheel consisted of a complex substitution cipher, and multiple wheels were used in a chain. The specific wheels used, order of the wheels, and starting position of the wheels formed the encryption key. While captured Engima devices provided the Allied forces details on the encryption method, the keys still had to be broken to decrypt messages.<\/p>\r\n<p>These code breaking efforts led to the development of some of the first electronic computers by Alan Turing at Bletchley Park in the United Kingdom. This is generally considered the beginning of modern computing.<\/p>\r\n<p>In the 1970s, the U.S. government had a competition and ultimately approved an algorithm deemed DES (Data Encryption Standard) to be used for encrypting government data. It became the standard encryption algorithm used. This method used a combination of multiple substitution and transposition steps, along with other steps in which the encryption key is mixed with the message. This method uses an encryption key with length [latex]56[\/latex] bits, meaning there are [latex]256[\/latex] possible keys.<\/p>\r\n<p>This number of keys make a brute force attack extremely difficult and costly, but not impossible. In 1998, a team was able to find the decryption key for a message in [latex]2[\/latex] days, using about [latex]$250,000[\/latex] worth of hardware. However, the price and time will go down as computer power increases.<\/p>\r\n<p>From 1997 to 2001 the government held another competition, ultimately adopting a new method, deemed AES (Advanced Encryption Standard). This method uses encryption keys with [latex]128[\/latex], [latex]192[\/latex], or [latex]256[\/latex] bits, providing up to [latex]2256[\/latex] possible keys, making brute force attacks essentially impossible.<\/p>","rendered":"<h2>Advanced Shared Symmetric-Key Methods<\/h2>\n<p>Both the substitution and transposition methods discussed so far are <strong>shared symmetric-key methods<\/strong>, meaning that both sender and receiver would have to have agreed upon the same secret encryption key before any methods could be sent.<\/p>\n<p>All of the methods so far have been susceptible to frequency analysis since each letter is always mapped to the same encrypted character. More advanced methods get around this weakness. For example, the Enigma machines used in World War II had wheels that rotated. Each wheel was a substitution cipher, but the rotation would cause the substitution used to shift after each character.<\/p>\n<p>For a simplified example, in the initial setup, the wheel might provide the mapping:<\/p>\n<p>Original: [latex]ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789[\/latex]<br \/>\nMaps to: [latex]2BQF5WRTD8IJ6HLCOSUVK3A0X9YZN1G4ME7P[\/latex]<\/p>\n<p>After the first character is encrypted, the wheel rotates, shifting the mapping one space, resulting in a new shifted mapping:<\/p>\n<p>Original: [latex]ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789[\/latex]<br \/>\nMaps to: [latex]P2BQF5WRTD8IJ6HLCOSUVK3A0X9YZN1G4ME7[\/latex]<\/p>\n<p>Using this approach, no letter gets encrypted as the same character over and over.<\/p>\n<section class=\"textbox example\">Encrypt the message \u201cSee me\u201d. Use a basic Caesar cipher with shift [latex]3[\/latex] as the initial substitution, but shift the substitution one place after each character.<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"q4330\">Show Solution<\/button><\/p>\n<div id=\"q4330\" class=\"hidden-answer\" style=\"display: none\">The initial mapping is:<\/p>\n<p>Original: [latex]ABCDEFGHIJKLMNOPQRSTUVWXYZ[\/latex]<\/p>\n<p>Maps to: [latex]DEFGHIJKLMNOPQRSTUVWXYZABC[\/latex]<\/p>\n<p>This would map the first letter, [latex]S[\/latex] to [latex]V[\/latex]. We would then shift the mapping by one.<\/p>\n<p>Original: [latex]ABCDEFGHIJKLMNOPQRSTUVWXYZ[\/latex]<\/p>\n<p>Now maps to: [latex]EFGHIJKLMNOPQRSTUVWXYZABCD[\/latex]<\/p>\n<p>Now the next letter, [latex]E[\/latex], will map to [latex]I[\/latex]. Again we shift the cipher<\/p>\n<p>\nOriginal: [latex]ABCDEFGHIJKLMNOPQRSTUVWXYZ[\/latex]<\/p>\n<p>Now maps to: [latex]FGHIJKLMNOPQRSTUVWXYZABCDE[\/latex]<\/p>\n<p>\nThe next letter, [latex]E[\/latex], now maps to [latex]J[\/latex]. Continuing this process, the final message would be [latex]VIJSL[\/latex].<\/p>\n<p>Notice that frequency analysis is much less useful now, since the character [latex]E[\/latex] has been mapped to three different characters due to the shifting of the substitution mapping.<\/p>\n<\/div>\n<\/div>\n<\/section>\n<figure id=\"attachment_2312\" aria-describedby=\"caption-attachment-2312\" style=\"width: 344px\" class=\"wp-caption alignright\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2312 size-full\" src=\"https:\/\/content-cdn.one.lumenlearning.com\/wp-content\/uploads\/sites\/18\/2023\/05\/08185553\/Screenshot-2023-05-08-145516.png\" alt=\"An enigma machine, showing several wheels with the alphabet on them.\" width=\"344\" height=\"287\" srcset=\"https:\/\/content-cdn.one.lumenlearning.com\/wp-content\/uploads\/sites\/18\/2023\/05\/08185553\/Screenshot-2023-05-08-145516.png 344w, https:\/\/content-cdn.one.lumenlearning.com\/wp-content\/uploads\/sites\/18\/2023\/05\/08185553\/Screenshot-2023-05-08-145516-300x250.png 300w, https:\/\/content-cdn.one.lumenlearning.com\/wp-content\/uploads\/sites\/18\/2023\/05\/08185553\/Screenshot-2023-05-08-145516-65x54.png 65w, https:\/\/content-cdn.one.lumenlearning.com\/wp-content\/uploads\/sites\/18\/2023\/05\/08185553\/Screenshot-2023-05-08-145516-225x188.png 225w\" sizes=\"(max-width: 344px) 100vw, 344px\" \/><figcaption id=\"caption-attachment-2312\" class=\"wp-caption-text\">Figure 1. An engima machine<\/figcaption><\/figure>\n<p>The actual Engima machines used in WWII were more complex. Each wheel consisted of a complex substitution cipher, and multiple wheels were used in a chain. The specific wheels used, order of the wheels, and starting position of the wheels formed the encryption key. While captured Engima devices provided the Allied forces details on the encryption method, the keys still had to be broken to decrypt messages.<\/p>\n<p>These code breaking efforts led to the development of some of the first electronic computers by Alan Turing at Bletchley Park in the United Kingdom. This is generally considered the beginning of modern computing.<\/p>\n<p>In the 1970s, the U.S. government had a competition and ultimately approved an algorithm deemed DES (Data Encryption Standard) to be used for encrypting government data. It became the standard encryption algorithm used. This method used a combination of multiple substitution and transposition steps, along with other steps in which the encryption key is mixed with the message. This method uses an encryption key with length [latex]56[\/latex] bits, meaning there are [latex]256[\/latex] possible keys.<\/p>\n<p>This number of keys make a brute force attack extremely difficult and costly, but not impossible. In 1998, a team was able to find the decryption key for a message in [latex]2[\/latex] days, using about [latex]$250,000[\/latex] worth of hardware. However, the price and time will go down as computer power increases.<\/p>\n<p>From 1997 to 2001 the government held another competition, ultimately adopting a new method, deemed AES (Advanced Encryption Standard). This method uses encryption keys with [latex]128[\/latex], [latex]192[\/latex], or [latex]256[\/latex] bits, providing up to [latex]2256[\/latex] possible keys, making brute force attacks essentially impossible.<\/p>\n","protected":false},"author":15,"menu_order":7,"template":"","meta":{"_candela_citation":"[]","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"part":2245,"module-header":"learn_it","content_attributions":[],"internal_book_links":[],"video_content":null,"cc_video_embed_content":{"cc_scripts":"","media_targets":[]},"try_it_collection":null,"_links":{"self":[{"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/pressbooks\/v2\/chapters\/2308"}],"collection":[{"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/wp\/v2\/users\/15"}],"version-history":[{"count":14,"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/pressbooks\/v2\/chapters\/2308\/revisions"}],"predecessor-version":[{"id":15673,"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/pressbooks\/v2\/chapters\/2308\/revisions\/15673"}],"part":[{"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/pressbooks\/v2\/parts\/2245"}],"metadata":[{"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/pressbooks\/v2\/chapters\/2308\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/wp\/v2\/media?parent=2308"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/pressbooks\/v2\/chapter-type?post=2308"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/wp\/v2\/contributor?post=2308"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/wp\/v2\/license?post=2308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}