{"id":2290,"date":"2023-05-08T18:24:35","date_gmt":"2023-05-08T18:24:35","guid":{"rendered":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/?post_type=chapter&#038;p=2290"},"modified":"2025-08-26T04:01:58","modified_gmt":"2025-08-26T04:01:58","slug":"cryptography-learn-it-3","status":"web-only","type":"chapter","link":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/chapter\/cryptography-learn-it-3\/","title":{"raw":"Cryptography: Learn It 3","rendered":"Cryptography: Learn It 3"},"content":{"raw":"<h2>Transposition Ciphers<\/h2>\r\n<p>Another approach to cryptography is <strong>transposition cipher<\/strong>.<\/p>\r\n<section class=\"textbox keyTakeaway\">\r\n<div>\r\n<h3>transposition cipher<\/h3>\r\n<p>A <strong>transposition cipher<\/strong> is one in which the order of characters is changed to obscure the message.<\/p>\r\n<\/div>\r\n<\/section>\r\n\r\n[caption id=\"attachment_2294\" align=\"alignright\" width=\"192\"]<img class=\"wp-image-2294 size-full\" src=\"https:\/\/content-cdn.one.lumenlearning.com\/wp-content\/uploads\/sites\/18\/2023\/05\/08183134\/crpyt4.png\" alt=\"A scytale, a stick with a strip of paper wrapped around it several times.\" width=\"192\" height=\"116\" \/> Figure 1. A Scytale[\/caption]\r\n\r\n<p>An early version of a transposition cipher was a Scytale[1], in which paper was wrapped around a stick and the message was written. Once unwrapped, the message would be unreadable until the message was wrapped around a same-sized stick again.<\/p>\r\n<p>One modern transposition cipher is done by writing the message in rows, then forming the encrypted message from the text in the columns. Let's try an example.<\/p>\r\n<section class=\"textbox example\">Encrypt the message \u201cMeet at First and Pine at midnight\u201d using rows [latex]8[\/latex] characters long.<br \/>\r\n[reveal-answer q=\"4330\"]Show Solution[\/reveal-answer]<br \/>\r\n[hidden-answer a=\"4330\"]We write the message in rows of 8 characters each. Nonsense characters are added to the end to complete the last row. [latex]MEETATFI[\/latex] [latex]RSTANDPI[\/latex] [latex]NEATMIDN[\/latex] [latex]IGHTPXNR[\/latex]. We could then encode the message by recording down the columns.<br \/>\r\n<p style=\"text-align: center;\">[latex]MEETATFI[\/latex]<br \/>\r\n[latex]RSTANDPI[\/latex]<br \/>\r\n[latex]NEATMIDN[\/latex]<br \/>\r\n[latex]IGHTPXNR[\/latex]<\/p>\r\n<p>The first column, reading down, would be [latex]MRNI[\/latex].<\/p>\r\n<p>Altogether, the encoded message would be [latex]MRNI\\: ESEG\\: ETAH\\: TATT\\: ANMP\\: TDIX\\: FPDN\\: IINR[\/latex]. The spaces would be removed or repositioned to hide the size of the table used, since that is the encryption key in this message.[\/hidden-answer]<\/p>\r\n<\/section>\r\n<p>More complex versions of this rows-and-column based transposition cipher can be created by specifying an order in which the columns should be recorded. For example, the method could specify that after writing the message out in rows that you should record the third column, then the fourth, then the first, then the fifth, then the second. This adds additional complexity that would make it harder to make a brute-force attack.<\/p>\r\n<p>To make the encryption key easier to remember, a word could be used. For example, if the key word was \u201c[latex]MONEY[\/latex]\u201d, it would specify that rows should have [latex]5[\/latex] characters each. The order of the letters in the alphabet would dictate which order to read the columns in. Since [latex]E[\/latex], the [latex]4[\/latex]th letter in the word, is the earliest letter in the alphabet from the word [latex]MONEY[\/latex], the [latex]4[\/latex]th column would be used first, followed by the [latex]1[\/latex]st column ([latex]M[\/latex]), the [latex]3[\/latex]rd column ([latex]N[\/latex]), the [latex]2[\/latex]nd column ([latex]O[\/latex]), and the [latex]5[\/latex]th column ([latex]Y[\/latex]).<\/p>\r\n<section class=\"textbox example\">Encrypt the message [latex]BUY\\: SOME\\: MILK\\: AND\\: EGGS[\/latex] using a transposition cipher with key word [latex]MONEY[\/latex].<br \/>\r\n[reveal-answer q=\"4331\"]Show Solution[\/reveal-answer]<br \/>\r\n[hidden-answer a=\"4331\"]<br \/>\r\nWriting out the message in rows of [latex]5[\/latex] characters: [latex]BUYSO[\/latex][latex]MEMIL[\/latex][latex]KANDE[\/latex][latex]GGSPK[\/latex]. We now record the columns in order [latex]4\\: 1\\: 3\\: 2\\: 5[\/latex] : [latex]SIDP\\: BMKG\\: YMNS\\: UEAG\\: OLEK[\/latex]. As before, we\u2019d then remove or reposition the spaces to conceal evidence of the encryption key.[\/hidden-answer]<\/section>\r\n<section class=\"textbox tryIt\">[ohm2_question hide_question_numbers=1]5222[\/ohm2_question]<\/section>\r\n<p>To decrypt a keyword-based transposition cipher, we\u2019d reverse the process.<\/p>\r\n<section class=\"textbox example\">Decrypt the message [latex]RHA\\: VTN\\: USR\\: EDE\\: AIE\\: RIK\\: ATS\\: OQR[\/latex] using a row-and-column transposition cipher with keyword [latex]PRIZED[\/latex].<br \/>\r\n[reveal-answer q=\"4332\"]Show Solution[\/reveal-answer]<br \/>\r\n[hidden-answer a=\"4332\"]<br \/>\r\nThe keyword [latex]PRIZED[\/latex] tells us to use rows with [latex]6[\/latex] characters. Since [latex]D[\/latex] comes first in the alphabet, we start with [latex]6[\/latex]th column. Since [latex]E[\/latex] is next in the alphabet, we\u2019d follow with the [latex]5[\/latex]th column. Continuing, the word [latex]PRIZED[\/latex] tells us the message was recorded with the columns in order [latex]4\\: 5\\: 3\\: 6\\: 2\\: 1[\/latex].For the decryption, we set up a table with [latex]6[\/latex] characters in each row. Since the beginning of the encrypted message came from the last column, we start writing the encrypted message down the last column.\r\n\r\n<p style=\"text-align: center;\">[latex]\\begin{array}{|l|l|l|l|}<br \/>\r\n\\hline &amp; &amp; &amp; &amp; &amp; \\mathrm{R} \\\\<br \/>\r\n\\hline &amp; &amp; &amp; &amp; &amp; \\mathrm{H} \\\\<br \/>\r\n\\hline &amp; &amp; &amp; &amp; &amp; \\mathrm{A} \\\\<br \/>\r\n\\hline &amp; &amp; &amp; &amp; &amp; \\mathrm{V} \\\\<br \/>\r\n\\hline<br \/>\r\n\\end{array}[\/latex]<\/p>\r\n<p>The [latex]5[\/latex]th column was the second one the encrypted message was read from, so is the next one we write to.<\/p>\r\n<p style=\"text-align: center;\">[latex]\\begin{array}{|l|l|l|l|}<br \/>\r\n\\hline &amp; &amp; &amp; &amp; \\mathrm{T} &amp; \\mathrm{R} \\\\<br \/>\r\n\\hline &amp; &amp; &amp; &amp; \\mathrm{N} &amp; \\mathrm{H} \\\\<br \/>\r\n\\hline &amp; &amp; &amp; &amp; \\mathrm{U} &amp; \\mathrm{A} \\\\<br \/>\r\n\\hline &amp; &amp; &amp; &amp; \\mathrm{S} &amp; \\mathrm{V} \\\\<br \/>\r\n\\hline<br \/>\r\n\\end{array}[\/latex]<\/p>\r\n<p>Continuing, we can fill out the rest of the message.<\/p>\r\n<p style=\"text-align: center;\">[latex] \\begin{array}{|l|l|l|l|l|l|}<br \/>\r\n\\hline \\mathrm{A} &amp; \\mathrm{I} &amp; \\mathrm{R} &amp; \\mathrm{S} &amp; \\mathrm{T} &amp; \\mathrm{R} \\\\<br \/>\r\n\\hline \\mathrm{I} &amp; \\mathrm{K} &amp; \\mathrm{E} &amp; \\mathrm{O} &amp; \\mathrm{N} &amp; \\mathrm{H} \\\\<br \/>\r\n\\hline \\mathrm{E} &amp; \\mathrm{A} &amp; \\mathrm{D} &amp; \\mathrm{Q} &amp; \\mathrm{U} &amp; \\mathrm{A} \\\\<br \/>\r\n\\hline \\mathrm{R} &amp; \\mathrm{T} &amp; \\mathrm{E} &amp; \\mathrm{R} &amp; \\mathrm{S} &amp; \\mathrm{V} \\\\<br \/>\r\n\\hline<br \/>\r\n\\end{array} [\/latex]<\/p>\r\n<p>Reading across the rows gives our decrypted message: [latex]AIRSTRIKEONHEADQUARTERSV[\/latex]<\/p>\r\n<p>[\/hidden-answer]<\/p>\r\n<\/section>\r\n<p>Unfortunately, since the transposition cipher does not change the frequency of individual letters, it is still susceptible to frequency analysis, though the transposition does eliminate information from letter pairs.<\/p>","rendered":"<h2>Transposition Ciphers<\/h2>\n<p>Another approach to cryptography is <strong>transposition cipher<\/strong>.<\/p>\n<section class=\"textbox keyTakeaway\">\n<div>\n<h3>transposition cipher<\/h3>\n<p>A <strong>transposition cipher<\/strong> is one in which the order of characters is changed to obscure the message.<\/p>\n<\/div>\n<\/section>\n<figure id=\"attachment_2294\" aria-describedby=\"caption-attachment-2294\" style=\"width: 192px\" class=\"wp-caption alignright\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2294 size-full\" src=\"https:\/\/content-cdn.one.lumenlearning.com\/wp-content\/uploads\/sites\/18\/2023\/05\/08183134\/crpyt4.png\" alt=\"A scytale, a stick with a strip of paper wrapped around it several times.\" width=\"192\" height=\"116\" srcset=\"https:\/\/content-cdn.one.lumenlearning.com\/wp-content\/uploads\/sites\/18\/2023\/05\/08183134\/crpyt4.png 192w, https:\/\/content-cdn.one.lumenlearning.com\/wp-content\/uploads\/sites\/18\/2023\/05\/08183134\/crpyt4-65x39.png 65w\" sizes=\"(max-width: 192px) 100vw, 192px\" \/><figcaption id=\"caption-attachment-2294\" class=\"wp-caption-text\">Figure 1. A Scytale<\/figcaption><\/figure>\n<p>An early version of a transposition cipher was a Scytale[1], in which paper was wrapped around a stick and the message was written. Once unwrapped, the message would be unreadable until the message was wrapped around a same-sized stick again.<\/p>\n<p>One modern transposition cipher is done by writing the message in rows, then forming the encrypted message from the text in the columns. Let&#8217;s try an example.<\/p>\n<section class=\"textbox example\">Encrypt the message \u201cMeet at First and Pine at midnight\u201d using rows [latex]8[\/latex] characters long.<\/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\">We write the message in rows of 8 characters each. Nonsense characters are added to the end to complete the last row. [latex]MEETATFI[\/latex] [latex]RSTANDPI[\/latex] [latex]NEATMIDN[\/latex] [latex]IGHTPXNR[\/latex]. We could then encode the message by recording down the columns.<\/p>\n<p style=\"text-align: center;\">[latex]MEETATFI[\/latex]<br \/>\n[latex]RSTANDPI[\/latex]<br \/>\n[latex]NEATMIDN[\/latex]<br \/>\n[latex]IGHTPXNR[\/latex]<\/p>\n<p>The first column, reading down, would be [latex]MRNI[\/latex].<\/p>\n<p>Altogether, the encoded message would be [latex]MRNI\\: ESEG\\: ETAH\\: TATT\\: ANMP\\: TDIX\\: FPDN\\: IINR[\/latex]. The spaces would be removed or repositioned to hide the size of the table used, since that is the encryption key in this message.<\/p><\/div>\n<\/div>\n<\/section>\n<p>More complex versions of this rows-and-column based transposition cipher can be created by specifying an order in which the columns should be recorded. For example, the method could specify that after writing the message out in rows that you should record the third column, then the fourth, then the first, then the fifth, then the second. This adds additional complexity that would make it harder to make a brute-force attack.<\/p>\n<p>To make the encryption key easier to remember, a word could be used. For example, if the key word was \u201c[latex]MONEY[\/latex]\u201d, it would specify that rows should have [latex]5[\/latex] characters each. The order of the letters in the alphabet would dictate which order to read the columns in. Since [latex]E[\/latex], the [latex]4[\/latex]th letter in the word, is the earliest letter in the alphabet from the word [latex]MONEY[\/latex], the [latex]4[\/latex]th column would be used first, followed by the [latex]1[\/latex]st column ([latex]M[\/latex]), the [latex]3[\/latex]rd column ([latex]N[\/latex]), the [latex]2[\/latex]nd column ([latex]O[\/latex]), and the [latex]5[\/latex]th column ([latex]Y[\/latex]).<\/p>\n<section class=\"textbox example\">Encrypt the message [latex]BUY\\: SOME\\: MILK\\: AND\\: EGGS[\/latex] using a transposition cipher with key word [latex]MONEY[\/latex].<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"q4331\">Show Solution<\/button><\/p>\n<div id=\"q4331\" class=\"hidden-answer\" style=\"display: none\">\nWriting out the message in rows of [latex]5[\/latex] characters: [latex]BUYSO[\/latex][latex]MEMIL[\/latex][latex]KANDE[\/latex][latex]GGSPK[\/latex]. We now record the columns in order [latex]4\\: 1\\: 3\\: 2\\: 5[\/latex] : [latex]SIDP\\: BMKG\\: YMNS\\: UEAG\\: OLEK[\/latex]. As before, we\u2019d then remove or reposition the spaces to conceal evidence of the encryption key.<\/div>\n<\/div>\n<\/section>\n<section class=\"textbox tryIt\"><iframe loading=\"lazy\" id=\"ohm5222\" class=\"resizable\" src=\"https:\/\/ohm.one.lumenlearning.com\/multiembedq.php?id=5222&theme=lumen&iframe_resize_id=ohm5222&source=tnh\" width=\"100%\" height=\"150\"><\/iframe><\/section>\n<p>To decrypt a keyword-based transposition cipher, we\u2019d reverse the process.<\/p>\n<section class=\"textbox example\">Decrypt the message [latex]RHA\\: VTN\\: USR\\: EDE\\: AIE\\: RIK\\: ATS\\: OQR[\/latex] using a row-and-column transposition cipher with keyword [latex]PRIZED[\/latex].<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"q4332\">Show Solution<\/button><\/p>\n<div id=\"q4332\" class=\"hidden-answer\" style=\"display: none\">\nThe keyword [latex]PRIZED[\/latex] tells us to use rows with [latex]6[\/latex] characters. Since [latex]D[\/latex] comes first in the alphabet, we start with [latex]6[\/latex]th column. Since [latex]E[\/latex] is next in the alphabet, we\u2019d follow with the [latex]5[\/latex]th column. Continuing, the word [latex]PRIZED[\/latex] tells us the message was recorded with the columns in order [latex]4\\: 5\\: 3\\: 6\\: 2\\: 1[\/latex].For the decryption, we set up a table with [latex]6[\/latex] characters in each row. Since the beginning of the encrypted message came from the last column, we start writing the encrypted message down the last column.<\/p>\n<p style=\"text-align: center;\">[latex]\\begin{array}{|l|l|l|l|}<br \/>  \\hline & & & & & \\mathrm{R} \\\\<br \/>  \\hline & & & & & \\mathrm{H} \\\\<br \/>  \\hline & & & & & \\mathrm{A} \\\\<br \/>  \\hline & & & & & \\mathrm{V} \\\\<br \/>  \\hline<br \/>  \\end{array}[\/latex]<\/p>\n<p>The [latex]5[\/latex]th column was the second one the encrypted message was read from, so is the next one we write to.<\/p>\n<p style=\"text-align: center;\">[latex]\\begin{array}{|l|l|l|l|}<br \/>  \\hline & & & & \\mathrm{T} & \\mathrm{R} \\\\<br \/>  \\hline & & & & \\mathrm{N} & \\mathrm{H} \\\\<br \/>  \\hline & & & & \\mathrm{U} & \\mathrm{A} \\\\<br \/>  \\hline & & & & \\mathrm{S} & \\mathrm{V} \\\\<br \/>  \\hline<br \/>  \\end{array}[\/latex]<\/p>\n<p>Continuing, we can fill out the rest of the message.<\/p>\n<p style=\"text-align: center;\">[latex]\\begin{array}{|l|l|l|l|l|l|}<br \/>  \\hline \\mathrm{A} & \\mathrm{I} & \\mathrm{R} & \\mathrm{S} & \\mathrm{T} & \\mathrm{R} \\\\<br \/>  \\hline \\mathrm{I} & \\mathrm{K} & \\mathrm{E} & \\mathrm{O} & \\mathrm{N} & \\mathrm{H} \\\\<br \/>  \\hline \\mathrm{E} & \\mathrm{A} & \\mathrm{D} & \\mathrm{Q} & \\mathrm{U} & \\mathrm{A} \\\\<br \/>  \\hline \\mathrm{R} & \\mathrm{T} & \\mathrm{E} & \\mathrm{R} & \\mathrm{S} & \\mathrm{V} \\\\<br \/>  \\hline<br \/>  \\end{array}[\/latex]<\/p>\n<p>Reading across the rows gives our decrypted message: [latex]AIRSTRIKEONHEADQUARTERSV[\/latex]<\/p>\n<\/div>\n<\/div>\n<\/section>\n<p>Unfortunately, since the transposition cipher does not change the frequency of individual letters, it is still susceptible to frequency analysis, though the transposition does eliminate information from letter pairs.<\/p>\n","protected":false},"author":15,"menu_order":6,"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\/2290"}],"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":25,"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/pressbooks\/v2\/chapters\/2290\/revisions"}],"predecessor-version":[{"id":15671,"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/pressbooks\/v2\/chapters\/2290\/revisions\/15671"}],"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\/2290\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/wp\/v2\/media?parent=2290"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/pressbooks\/v2\/chapter-type?post=2290"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/wp\/v2\/contributor?post=2290"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/quantitativereasoning\/wp-json\/wp\/v2\/license?post=2290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}