{"id":30651,"date":"2015-08-31T23:41:22","date_gmt":"2015-09-01T03:41:22","guid":{"rendered":"http:\/\/www.opensource.im\/uncategorized\/cryptography-university-of-washington.php"},"modified":"2015-08-31T23:41:22","modified_gmt":"2015-09-01T03:41:22","slug":"cryptography-university-of-washington","status":"publish","type":"post","link":"https:\/\/euvolution.com\/open-source-convergence\/cryptography\/cryptography-university-of-washington.php","title":{"rendered":"Cryptography &#8211; University of Washington"},"content":{"rendered":"<p><p>            Cryptography          <\/p>\n<p>            Hill-ciphers          <\/p>\n<p>            an application of            Linear Algebra          <\/p>\n<p>            by:            Paal            Schiefloe          <\/p>\n<p>            3 December 2001<\/p>\n<p>                        [top]          <\/p>\n<p>                    This project for my Linear Algebra class is about          cryptography. I will discuss a simple method of          enciphering and deciphering a message using matrix          transformations and modular arithmetic, and show how          elementary row operations can sometimes be used to          break an opponent's code.        <\/p>\n<p>          The ciphers I will discuss are called Hill          ciphers after Lester S. Hill who introduced them          in two papers: \"Cryptography in an Algebraic Alphabet,\"          American Mathematical Monthly, 36, June-July 1929,          pp. 306-312; and \"Concerning Certain Linear          Transformation Apparatus of Cryptography,\" American          Mathematical Monthly, 38, March 1931, pp. 135-154.        <\/p>\n<p>          I will show an example of how a message is enciphered and          deciphered using Hill ciphers, I will also briefly          discuss how to break a Hill cipher using          elementary row operations by giving an example from                    \"Elementary Linear Algebra, Applications version, edition          6\".        <\/p>\n<\/p>\n<p>                        [top]          <\/p>\n<p>          Cryptography has for long been an important issue in the          realm of computers. It was mainly used for the security          needed for passwords but now cryptography is very          important due to the Internet's flow of sensitive          information such as credit card information and other          sensitive information which is fairly easy to monitor by          unintended third hand parties.        <\/p>\n<p>          The idea behind enciphering a message is to make it          worthless to everyone except for the party with the          deciphering \"key\".        <\/p>\n<p>                        [top]          <\/p>\n<p>                    For Hill ciphers I assign numerical values to each          plaintext and ciphertext letter so that A=1, B=2, C=2 and          so on. If I wanted to I could have assigned numerical          values for all the other characters on a keyboard, but          for simplicity I will only assign numerical values to the          letters in the alphabet in this project.        <\/p>\n<p>          The following procedure shows the simplest Hill ciphers          (Hill 2-cipher), successive pairs of plaintext that are          transformed into ciphertext by a 2 x 2 matrix          A.        <\/p>\n<p>          NOTE: I will impose an additional condition on matrix          A later.          Here I have assigned numerical values to the          alphabet:<\/p>\n<p>          Choose a 2 x 2 matrix A with integer          entries to perform the encoding.        <\/p>\n<p>          (The matrix has to be invertible modulo m, but I          will discuss this later)        <\/p>\n<\/p>\n<p>          Group successive plaintext letters into pairs. If          we end up with one single letter at the end, simply add          an arbitrary \"dummy\" letter to fill out the last pair of          letters.        <\/p>\n<p>          Enciphering Step 3.        <\/p>\n<p>          Convert each plaintext pair p1p2 into a column          vector p.        <\/p>\n<p>          Then form the plaintext matrix P of all our          plaintext column vectors.        <\/p>\n<p>          To encipher the message we multiply our plaintext matrix          P by our transformation matrix          A to form the product          AP.        <\/p>\n<p>          The product of our matrix multiplication is the          ciphertext matrix C.        <\/p>\n<\/p>\n<\/p>\n<\/p>\n<p>          Enciphering Step 4.        <\/p>\n<p>          Now we convert each ciphertext vector into          its alphabetical equivalent and write out our enciphered          message.        <\/p>\n<p>          This was the encoding procedure, pretty simple, huh:)          Let's see how we decipher our enciphered message.        <\/p>\n<p>          Deciphering Step 1.          Now we group the successive ciphertext letters          into pairs and convert each ciphertext pair          c1c2 into a column vector c. Then form the          ciphertext matrix C of all our          ciphertext column vectors. <\/p>\n<p>          Deciphering Step 2.        <\/p>\n<p>          Multiply the ciphertext matrix C          with the inverse of our enciphering matrix          A to obtain the deciphered message. Not too          difficult, huh:)        <\/p>\n<p>          NOTE: To use this procedure we have to understand          the concept of modular arithmetic. In the 6 steps          I showed you above, I chose not to include the modular          arithmetic in the steps for simplicity. However,          modular arithmetic is important for this procedure to          work. Keep reading and I'll show you why this is so          important:)        <\/p>\n<p>                        [top]          <\/p>\n<p>          We have the transformation matrix A        <\/p>\n<p>          When we multiply this vector by our transformation matrix          A, we get the enciphered column vector        <\/p>\n<\/p>\n<\/p>\n<p>                    Uh...hmmm, what letters correspond to the integers 148          and 64? This is where Modular Arithmetic comes in handy.        <\/p>\n<p>          Our alphabet is given by non negative integers from 1, 2,          , ..., m, where m is the length of our alphabet (in this          case m = 26).        <\/p>\n<p>          What we do when we have over 26, is simply \"wrapping          around\" the numbers from 27 to 52 to represent the 26          letters again, then we do the same thing from 53 to 78          etc. We can do the same with negative integers (in this          case Z=0, Y=-1, X=-2 etc.).<\/p>\n<p>                    The procedure of \"wrapping\" is quite general. It is the          same procedure we use every noon and midnight when we          begin again to number the hours 1, 2, etc. In a 24 hour          system, 18:00 is the same as 6:00 (pm) and 13:00 is 1:00          (pm).        <\/p>\n<p>          How we do this mathematically is as follows:          When we have integers greater than 26, we replace it by          the remainder that results when this integer is divided          by 26. So if we have the number 148 from the example          above, we divide 148 by 26 and the remainder is 18.        <\/p>\n<p>          148 - (5 * 26) = 18        <\/p>\n<p>                    Here are a couple examples for some different          modulus:        <\/p>\n<p>          7 = 2 (mod 5) because the remainder is 2 after          dividing 7 by 5        <\/p>\n<p>          19 = 3 (mod 2) because the remainder is 3 after dividing          19 by 2        <\/p>\n<p>          -1 = 25 (mod 26) because the remainder is 25 after          dividing -1 by 26        <\/p>\n<p>                    The formal definitions:        <\/p>\n<p>          If m is a positive integer and a and          b are any integers, then we say that a is          equivalent to b modulo m,          written        <\/p>\n<p>          a = b (mod m)        <\/p>\n<p>          if a-b is an integer multiple of m.        <\/p>\n<\/p>\n<p>          Now to the most important part of the concept of Modular          Arithmetic for Hill ciphers. As mentioned          in the procedure for enciphering and          deciphering plaintext using a simple          Hill-cipher above, we have to impose an          additional condition for our transformation matrix          A:        <\/p>\n<p>          The transformation matrix A must be          invertible modulo m for this procedure to work.        <\/p>\n<p>          So when finding the inverse of our transformation matrix          A we have to take (mod m) into          consideration.<\/p>\n<p>          However, since this project is about Linear Algebra, I          chose to skip the details about the modular arithmetic          here, and provide a table of the reciprocols of modulo 26          instead. The inmportant thing is to keep in mind when          checking our transformation matrix to see if it is          invertile it ha to be invertible modulo m, you see          how this is done in the example provided below the table          of reciprocals modulo 26:.        <\/p>\n<\/p>\n<p>                        [top]          <\/p>\n<p>                    Let's say we want to encipher the following          sentence,\"THE PROFESSOR IS EVIL\", into ciphertext.        <\/p>\n<p>          The first thing we do is to group the letters into pairs          of 2 letters. If we would do a Hill 3-cipher, we would          group the letters in groups of 3 letters and use a 3 x 3          transformation matrix, but in this example we're using a          Hill 2-cipher.        <\/p>\n<p>          For a Hill n-cipher, use n x n transformation matrix.        <\/p>\n<p>          So, I have grouped the letters like this:<\/p>\n<p>          This leads us to step 3 of the procedure, convert each          pair into a column to form the plaintext matrix P.<\/p>\n<p>          Oooops, most of these numbers in E are over 26, but by          using the trick we learned from modular arithmetic we          easily convert into nicer numbers, remember this is in          modulo 26.        <\/p>\n<p>          Then we assign letters to the numerical values by using          our table and this is what we get:        <\/p>\n<p>          RLQFXCHAAQAFCWAXMB        <\/p>\n<p>          Yeah, we enciphered the message, let's hope the professor          can't break it. I'll show you later how Hill-ciphers can          be broken by using row reduction.        <\/p>\n<p>          All right, time to decipher the messages.        <\/p>\n<p>          Let's imagine we just received this message from one of          our classmates, we know the matrix A he\/she used to          encipher the message with, so what do we do?        <\/p>\n<p>          Now we work backwards, once again grouping the ciphertext          into pairs of 2 letters and assigning numerical values          for the letters. We make each pair into a column vector          in a matrix E.        <\/p>\n<p>          Then we simply multiply the matrix E by the inverse of A,          but we have to remember our modular arithmetic from the          example above.        <\/p>\n<\/p>\n<p>          \"THE PROFESSOR IS EVIL\"        <\/p>\n<p>                    Nice, we just deciphered the message.        <\/p>\n<\/p>\n<p>                        [top]          <\/p>\n<p>          If we are able to obtain a small amount          of corresponding plaintext and ciphertext from a secret          message, it is possible to determine the deciphering          matrix A and then again decipher the entire message. We          have learned in class that a linear transformation          is determined by its values at a basis. This means that          if we have a Hill n-cipher, and if        <\/p>\n<p>          p1, p2, ... , pn        <\/p>\n<p>          are linear independent plaintext vectors whose          corresponding ciphertext vectors        <\/p>\n<p>          Ap1, Ap2, ..., Apn        <\/p>\n<p>          are known, then we have enough information to determine          the matrix A and later A-1 (mod m).        <\/p>\n<p>          To illustrate this I found an example from           \"Elementary Linear Algebra, Applications version, edition          6\".<\/p>\n<p>          Let's say that we obtain an enciphered message and we are          able to deduce that it is a letter starting with \"DEAR\".          With a small amount of such data it may be possible to          determine the deciphering matrix of a Hill-cipher and          consequently get access to the rest of the message.        <\/p>\n<\/p>\n<p>                        ...Bibliography\/References...            [top]<\/p>\n<p>                    Howard Anton and Christ Rorres.          Elementary Linear Algebra Application Version. 6th          edition. John Wiley & Sons, INC.        <\/p>\n<p>          Eisenberg, Murray. Hill Ciphers and Modular Linear          Algebra. 3 Nov 1999 (accessed 26 November - 2          December 2001)          <<a href=\"http:\/\/www.math.umass.edu\/~murray\/Hillciph.pdf\" rel=\"nofollow\">http:\/\/www.math.umass.edu\/~murray\/Hillciph.pdf<\/a>>        <\/p>\n<p>          Goulet, John. Project #6 Cryptography. (accessed          26 November - 2 December 2001)          <<a href=\"http:\/\/www.prenhall.com\/divisions\/esm\/app\/ph-linear\/kolman\/html\/proj6.html\" rel=\"nofollow\">http:\/\/www.prenhall.com\/divisions\/esm\/app\/ph-linear\/kolman\/html\/proj6.html<\/a>>        <\/p>\n<p><!-- Auto Generated --><\/p>\n<p>More:<br \/>\n<a target=\"_blank\" href=\"http:\/\/www.math.washington.edu\/~king\/coursedir\/m308a01\/Projects\/Cryptography.htm\" title=\"Cryptography - University of Washington\">Cryptography - University of Washington<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p> Cryptography Hill-ciphers an application of Linear Algebra by: Paal Schiefloe 3 December 2001 [top] This project for my Linear Algebra class is about cryptography. I will discuss a simple method of enciphering and deciphering a message using matrix transformations and modular arithmetic, and show how elementary row operations can sometimes be used to break an opponent's code. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1600],"tags":[],"class_list":["post-30651","post","type-post","status-publish","format-standard","hentry","category-cryptography"],"_links":{"self":[{"href":"https:\/\/euvolution.com\/open-source-convergence\/wp-json\/wp\/v2\/posts\/30651"}],"collection":[{"href":"https:\/\/euvolution.com\/open-source-convergence\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/euvolution.com\/open-source-convergence\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/euvolution.com\/open-source-convergence\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/euvolution.com\/open-source-convergence\/wp-json\/wp\/v2\/comments?post=30651"}],"version-history":[{"count":0,"href":"https:\/\/euvolution.com\/open-source-convergence\/wp-json\/wp\/v2\/posts\/30651\/revisions"}],"wp:attachment":[{"href":"https:\/\/euvolution.com\/open-source-convergence\/wp-json\/wp\/v2\/media?parent=30651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/euvolution.com\/open-source-convergence\/wp-json\/wp\/v2\/categories?post=30651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/euvolution.com\/open-source-convergence\/wp-json\/wp\/v2\/tags?post=30651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}