4 Cryptography

4 Cryptography

V55.0106 Quantitative Reasoning: Computers, Number Theory and Cryptography 4 Cryptography LOBBY VULTM XYQBB UWZGY QVTTB RYVZU VQZEB XZDNV KKQHI BKBHO UBWBU ZDLQY ZWBRZ WBYQV TPBTT HLBNV YQZDY YZZPD RQYOZ DMKBV YVTRZ WBWDT VULHU HGGVU BRZWB TZVYV THTVP EKBTD MTYVY DYVZU RZWBT VURBV YVTEO BTBUY BWVUM KZRFT ZGGVI BVYTQ HOWBO YZWBR ZWBYQ BGVOT YEBOT ZUVUY QBRKH TTNQZ WBRZW BTVYH UWUZY VGVBT PBMXB PHVKL BYTHT EBRVH KEOVC B A message such as this is meant to appear as a meaningless jumble to most anyone who reads it. It is a simple message coded in a simple way. In this section, we shall learn different ways to code messages, and some approaches used to decode them. Cryptography is a discipline which concerns itself with communication secrecy. Coded mes- sages have long been used by businesses, governments and the military, and for obvious reasons. If you want to send a message to a friend or partner, you do not want it to under- stood by everyone who intercepts that message. Even before the advent of the computer, and the possibility of sending (and intercepting) electronic messages, it was well understood that some coding device was necessary to insure secrecy from “the enemy” who might intercept messages. With the advent of the computer, issues of secrecy have come closer to home, because elec- tronic interception (snooping) has become commonplace, and much easier. When ordering on the Internet, and you give your credit card number, you do not want any intruder to find it. So responsible companies who do business on the Internet must use very sophisticated coding systems to keep this information secret from intruders. In this section we consider some of the methods used to code and decode messages. For simplicity in our treatment, we shall start by sending with messages using the 26 letters A through Z. Thus, we omit small letters, punctuation, spaces, and even numerals. It is convenient to assign numbers to these letters, and the most natural numbering is given in the following table. Letter A B C D E F G H I J K L M Number 1 2 3 4 5 6 7 8 9 10 11 12 13 Letter N O P Q R S T U V W X Y Z Number 14 15 16 17 18 19 20 21 22 23 24 25 0 35 Note that we have assigned Z the number 0, rather than 26. This is because we shall work modulo 26–with remainders when we divide by 26–so it is most convenient to use the numbers from 0 through 25. (Computer scientists usually start labeling A as 0, etc. but we have avoided this, since most of us have learned that A is the first letter, B the second, etc.) It will be useful to learn this table. I find the simplest way is to know that the numbers 5, 10, 15, 20, and 25 correspond to E, J, O, T, and Y. If you know your alphabet, the rest is easy. Shift Substitutions. A very simple coding device is to replace every letter by the letter two positions after it. Thus, A is replaced by C, B by D, and so on. When we come to Y, we replace it by A (going around the circle). Similarly, replace Z by B. Thus, the message STAY RIGHT THERE FOR NOW will be coded as UVCA TKIJV VJGTG HQT PQY or UVCAT KIJVV JGTGH QTPQY since it is customary in coding to give the message in groups of 5 letters. (The spaces between words may give clues as the possible meanings.) Such a code was used by Julius Caesar, and so it has a long history. The person who receives the message UVCAT KIJVV JGTGH QTPQY and who knows the coding device will replace each letter by the letter two before it. The result is of course: STAYR IGHTT HEREF ORNOW The words can now easily be separated and the message is decoded. The original message is called the plaintext; the coded version is called the ciphertext.The process of changing plaintext into ciphertext is called coding or encryption. The process of changing ciphertext back into plaintext is called decoding or decryption. Encryption and decryption can be done if you are privy to the method used. If you have intercepted a message in ciphertext, and you want to find its plaintext meaning, but you don’t know the decryption method, you must use the art of cryptanalysis to find the plaintext. This will be considered in what follows. The encryption above can be given by a simple mathematical formula. Coding A as C, B as D, etc. is described numerically as coding 1 as 3, 2 as 4, 3 as 5, etc. Just add 2. If the plaintext number is p and the corresponding ciphertext number is c,thenthiscodeis simply c = p + 2. However, this formula falls apart for X (24), Y (25) since 24 + 2 = 26, and 25 + 2 = 27. But the formulas will be valid if we work with the remainders when divided by 36 26–that is, congruence mod 26. Thus the correct encryption formula is c p +2mod26 (3) ≡ The congruence (3) can be solved for p: p c 2mod26 (4) ≡ − One of the necessary components of an encryption method is that a ciphertext should be easily coded and decoded by anyone who knows the method, and very difficult by someone doesn’t. Formulas (3) and (4) are simple schemes from this point of view. From our point of view, equation (4) is the decryption equation, since it converts ciphertext into plaintext, while equation (3) is the encryption equation. The conditions 0 p 25 and 0 c 25 ≤ ≤ ≤ ≤ are needed in order that p and c can be assigned a letter of the alphabet. We can illustrate these equations as follows: If the ciphertext letter is F, then we have c =6, since F is the 6th letter of the alphabet. Using equation (4), we find p c 2 mod 26, or p 4 mod 26. So the plaintext must be D, the fourth letter of the alphabet.≡ − On the other hand,≡ if the ciphertext was A, we would find p c 2 mod 26, or p 1 2= 1 mod 26. To convert 1 mod 26, we just add 26 (which is,≡ after− all, 0 mod 26)≡ to− find 1− 25 mod 26, and so the− plaintext letter is Y. Of course we can do this more easily without− a≡ formula: it amount to shifting two places to the left, and “going around a circle.” But in our later examples, this will be difficult to do without a formula. An encryption based on a formula of the type c p + a mod 26 (5) ≡ is called a shift code because we can think of shifting the alphabet over a spaces to do the coding. Because of this equation, it is also called an additive code or cipher. What makes it relatively easy to decipher is that we only have to know how one letter is enciphered to figure out the rest. Equivalently, we need to know the value of a.Hereisanexample. Example. Sally has intercepted the message YMJDF WJMJW J and believes that it is a ciphertext based on a shift code. Furthermore, she believes that the letter E is enciphered as J, because there are so many J’s in the ciphertext. Help her to decipher the message. Method. The conversion formula is of the form c p + a mod 26. We know that when p = 5 (plaintext E), we have c = 10 (ciphertext J).≡ Thus, 10 5+a mod 26. So a 5 ≡ ≡ 37 mod 26, and the encryption formula is c p + 5 mod 26. The ciphertext is thus obtained by shifting 5 to the right, and so deciphering≡ shifts 5 to the left: p c 5 mod 26. Now ≡ − work letter by letter. Y’s number is 25. Here c =25sop 25 5 = 20, so the plaintext corresponding to Y is T. The letter D, has c =4,sohere≡p −4 5= 1 25 (adding 26 to 1). Thus the plaintext for D is Y. Proceeding this way,≡ we− decode− this≡ messages as THEYA− REHER E, or adjusting spaces: THEY ARE HERE. For additive ciphers given by Equation (5), the entire code is known, once we know the single number a. This number is called the key for this coding. Obviously, when you know the key, coding and decoding is simple. Another usage, will come in handy, is to let the key be the ciphertext corresponding to the plaintext A. So for a shift of a =2,wecanspeakofthekey 2, or equivalently, the key C. Similarly, a shift code with key letter G will have a =6. While shift codes can be easily use for coding, they have a severe limitation. Since they are all of the form c p + a mod 26, there are only 25 encipherings of this type available corresponding to a =≡ 1 to 25. (Of course, a = 0 amounts to no coding at all, or the trivial coding.) If you know that a shift code is being used, all you would have to do is to try the 25 different values of a and the decoding of a message can be done. This can be done fairly easily by hand. And with the right computer program, all 25 possible decodings of a message can be done almost instantaneously. All shift codes are given on page 51. It is convenient to use this table for shift codes. The first line, the usual alphabet, is the plaintext line.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    19 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us