{"id":1200,"date":"2010-11-05T08:49:56","date_gmt":"2010-11-05T12:49:56","guid":{"rendered":"http:\/\/www.acarlstein.com\/?p=1200"},"modified":"2010-11-05T09:32:51","modified_gmt":"2010-11-05T13:32:51","slug":"introduction-to-network-security-part-7","status":"publish","type":"post","link":"http:\/\/blog.acarlstein.com\/?p=1200","title":{"rendered":"Introduction to Network Security &#8211; Part 7"},"content":{"rendered":"<p><strong>NOTIFICATION:<\/strong><strong> <\/strong>These  examples are provided for  educational purposes.     The use of this  code and\/or information is  under your own responsibility and risk. The  information and\/or code is      given \u2018as is\u2019. I do not take  responsibilities of how they are used.<\/p>\n<p><strong>Transposition Ciphers<br \/>\n<\/strong><\/p>\n<p>The main idea of transposition ciphers is to rearrange the order of the letters used in the plaintext. This prevent the attacker to be able to recognise the message by using the frequency of distributions.<\/p>\n<p><strong>Rail Fence Cipher<\/strong><\/p>\n<p><span style=\"text-decoration: underline;\">Encryption<\/span><\/p>\n<p>The basic concept of encryption on Rail Fence cipher is the follow:<\/p>\n<ol>\n<li>Select a number of rows greater or equal to two. For this example, we will pick three:<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2010\/11\/rail-fence-cipher.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1221\" title=\"rail fence cipher\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2010\/11\/rail-fence-cipher.jpg\" alt=\"\" width=\"19\" height=\"59\" \/><\/a><\/li>\n<li>Place each letter of the message in each row, one letter at a time, on one row at a time, from the top to the bottom\n<ol>\n<li>Lets assume the plaintext is &#8220;SUPERSECRETMESSAGE&#8221;<\/li>\n<li>Rearrange the letters on the rows:<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1222\" title=\"rail fence cipher_3\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_3.jpg\" alt=\"\" width=\"268\" height=\"82\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_3.jpg 424w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_3-300x91.jpg 300w\" sizes=\"auto, (max-width: 268px) 100vw, 268px\" \/><\/a><\/li>\n<\/ol>\n<\/li>\n<li>After finished, we append one row after another in order, forming the ciphertext.<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1223\" title=\"rail fence cipher_4\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_4.jpg\" alt=\"\" width=\"499\" height=\"102\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_4.jpg 772w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_4-300x61.jpg 300w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/a><\/li>\n<\/ol>\n<p><span style=\"text-decoration: underline;\">Decryption<\/span><\/p>\n<p>The decryption of a rail fence cipher is almost the reverse process of the encryption.<\/p>\n<ol>\n<li>You will need the ciphertext and the number of rows:\n<ol>\n<li>The ciphertext is &#8220;SEEEEAURCTSGPSRMSE&#8221;<\/li>\n<li>The number of rows is:<br \/>\n|rows| = 3<\/li>\n<\/ol>\n<\/li>\n<li>Computer the length of the ciphertext. In this case, the ciphertext &#8220;SEEEEAURCTSGPSRMSE&#8221; is:<br \/>\n|ciphertext| = 18<\/li>\n<li>Lets calculate the columns that we will have:<br \/>\nNumber of Columns = ( |ciphertext| \u00f7 |rows| ) + ( |ciphertext| mod |rows| )<br \/>\n= ( 18 \u00f7 3 ) + (18 mod 3 )<br \/>\n= 6 + 0<br \/>\n= 6 columns<\/li>\n<li>Now, we have a table of 3 rows by 6 columns:<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_6.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1227\" title=\"rail fence cipher_6\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_6.jpg\" alt=\"\" width=\"112\" height=\"64\" \/><\/a><\/li>\n<li>Let fill up this table with the ciphertext, one letter at a time, from top to down and left to right:<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_7.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1228\" title=\"rail fence cipher_7\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_7.jpg\" alt=\"\" width=\"419\" height=\"74\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_7.jpg 668w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_7-300x52.jpg 300w\" sizes=\"auto, (max-width: 419px) 100vw, 419px\" \/><\/a><\/li>\n<li>Now recreate the plaintext from this table:<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_9.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1229\" title=\"rail fence cipher_9\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_9.jpg\" alt=\"\" width=\"383\" height=\"236\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_9.jpg 558w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2010\/11\/rail-fence-cipher_9-300x184.jpg 300w\" sizes=\"auto, (max-width: 383px) 100vw, 383px\" \/><\/a><\/li>\n<\/ol>\n\n<script>\nvar zbPregResult = '0';\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>NOTIFICATION: These examples are provided for educational purposes. The use of this code and\/or information is under your own responsibility and risk. The information and\/or code is given \u2018as is\u2019. I do not take responsibilities of how they are used. Transposition Ciphers The main idea of transposition ciphers is to rearrange the order of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,264],"tags":[217,316,321,323,265,324,356,266,328],"class_list":["post-1200","post","type-post","status-publish","format-standard","hentry","category-programming","category-network-security","tag-cipher","tag-ciphertext","tag-decryption","tag-encryption","tag-network","tag-plaintext","tag-rail-fence","tag-security","tag-transposition"],"_links":{"self":[{"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=\/wp\/v2\/posts\/1200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1200"}],"version-history":[{"count":9,"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=\/wp\/v2\/posts\/1200\/revisions"}],"predecessor-version":[{"id":1226,"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=\/wp\/v2\/posts\/1200\/revisions\/1226"}],"wp:attachment":[{"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1200"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}