1 the mathematics of star trek lecture 9: cryptography

Download 1 The Mathematics of Star Trek Lecture 9: Cryptography

If you can't read please download the document

Upload: erik-cobb

Post on 24-Dec-2015

213 views

Category:

Documents


1 download

TRANSCRIPT

  • Slide 1
  • 1 The Mathematics of Star Trek Lecture 9: Cryptography
  • Slide 2
  • 2 Topics Introduction Definitions and Terminology Steganography Transposition Ciphers Substitution Ciphers
  • Slide 3
  • 3 Introduction Throughout history, people have had the need to send messages to other people in secret! Methods have been developed to disguise and break secret messages. Just like an organism, these methods evolve, with new ones being developed as old ones are broken! (Think of bacteria and antibiotics!) More than ever the world relies on secure transmission of data to run smoothly (email, phone, cable TV, internet, online shopping, banking, military communication, law enforcement, intelligence gathering, etc.).
  • Slide 4
  • 4 Introduction (cont.) In this section we will look at some of the mathematics related to cryptography, codes and ciphers! Lets start with some terminology.
  • Slide 5
  • 5 Definitions and Terminology A code is a form of secret communication in which a word or phrase is replaced with a word, number, or symbol. Example 1: A simple code for an army. Attack at dawn Jupiter. The coast is clear Tippy-toe. Each commander and soldier would have a copy of the codes in some sort of codebook.
  • Slide 6
  • 6 Definitions and Terminology (cont.) A cipher is a form of secret communication in which letters are replaced with a letter, number, or symbol. Example 2: One example of a cipher is to replace each letter using the following scheme: Plaintext:attack at dawn Ciphertext:ZGGZXP ZG WZDM Send ciphertext as ZGG ZXP ZGW ZDM. Recipient would need to know how message was created. Plaintextabcdefghijklmnopqrstuvwxyz CiphertextZYXWVUTSRQPONMLKJIHGFEDCBA
  • Slide 7
  • 7 Definitions and Terminology (cont.) Cryptography is the science of concealing the meaning of a message. It is also used to mean the science of anything connected with ciphersan alternative to cryptology, which is the science of secret writing. To encrypt a message, one conceals the meaning of the message via a code or cipher. Similar definitions hold for encode and encipher. To decrypt a message, one turns an ecrypted message back into the original message. Similar definitions hold for decode and decipher.
  • Slide 8
  • 8 Definitions and Terminology (cont.) Remark: The words cryptography and cryptology come from the Greek words (kryptos) hidden (logos) word or reason (graphia) writing
  • Slide 9
  • 9 Definitions and Terminology (cont.) Steganography is the science of hiding the existence of a message. Steganography also comes from Greek: (steganos) covered Both steganography and cryptography were developed in parallelexamples of both have been found in the 5 th century B.C.
  • Slide 10
  • 10 Examples of Steganography Invisible ink (1 st century A.D. present): Use organic fluid such as lemon juice or milk to write a message on paper. Heat the paper and the writing will turn brown. Hard-boiled eggs (16 th century Italy): Mix alum and vinegar to make ink. Write on hard-boiled egg. Writing will penetrate shell and leave message on hardened egg white surface!
  • Slide 11
  • 11 Examples of Steganography (cont.) Square grid (grille) method (16 th century Italy 20 th century) Invented by Girolamo Cardano. Text is placed on a grid. Add in random letters to fill grid. To read message, put cover with correct openings onto the grid. Variant: Use words instead of letters and add in random words to fill in grid. See Edgar Allen Poes article A Few Words on Secret Writing, Grahams Magazine, July 1841, pp. 33-38. me s s a ge rcme wsto skpa bgea rcme wsto skpa bgea
  • Slide 12
  • 12 Examples of Steganography (cont.) Computer files (20 th century present) Add data to a file, such as a JPEG image (picture). Send via email or post to the internet on a web page. Message undetectable without appropriate software. Related idea: Watermarking is the addition of identifying information into items such as checks. Digital watermarking is used to embed copyright information into video, music, and text data. Note: Steganography is a great way to send a message in secretprovided it is not foundthen anyone can read the message!
  • Slide 13
  • 13 Cryptography! Cryptography can be split into two branchestransposition ciphers and substitution ciphers. A transposition cipher is a system of encryption in which the letters in a message are rearranged. A substitution cipher is a system of encryption in which letters in a message are replaced with other letters or symbols.
  • Slide 14
  • 14 Examples of Transposition Ciphers Scytale (SITalee) (Sparta 5 th century B.C.) Sender and receiver have batons of equal circumference. Wrap a strip of leather around baton and write message along length of the baton. Unroll the strip and carry! Question: How would one decipher an intercepted scytale message?
  • Slide 15
  • 15 Examples of Transposition Ciphers (cont.) Turning Grille Method (Variant of Cardanos method aboveused by German intelligence in South America in WWII). Put text in an 8 x 8 grid, with 16 openings cut in an overlay grid. When rotated 90 o, 180 o, 270 o, all 64 spaces will be exposed exactly once. Example from article by Stephen Fratini, Mathematics Magazine, Volume 75, #5, December 2002, pp. 389- 391 (Handout).
  • Slide 16
  • 16 Examples of Substitution Ciphers Caesar Cipher (1 st Century B.C. used by Julius Caesar to encrypt letters sent to Cicero). Basic Idea: The cipher alphabet is the plain alphabet shifted n spaces right. For example, if we take n = 14, we get: Plaintext:attack at dawn Ciphertext:OHHOQY OH ROKB Plaintextabcdefghijklmnopqrstuvwxyz CiphertextOPQRSTUVWXYZABCDEFGHIJKLMN
  • Slide 17
  • 17 Examples of Substitution Ciphers (cont.) Keyword Cipher Use a keyword or phrase as the basis of the encryption scheme. For example, let MATHEMATICS be the keyword. Remove repeated letters in the keyword and add in remaining letters of alphabet in order. MATHEMATICS MATHEICS Plaintextabcdefghijklmnopqrstuvwxyz CiphertextMATHEICSBDFGJKLNOPQRUVWXYZ
  • Slide 18
  • 18 Examples of Substitution Ciphers (cont.) Rearrangement Cipher Rearrange letters of alphabet in any order. The Caesar and keyword ciphers are special cases of the rearrangement cipher! Question: How many different rearrangement ciphers are there? To answer this question, we need the Fundamental Principle of Counting!
  • Slide 19
  • 19 Examples of Substitution Ciphers (cont.) Fundamental Principle of Counting (FPC): If there aren 1 choices for item 1 n 2 choices for item 2 n m choices for item m then the number of ways to choose one of each item is n 1 x n 2 x... x n m.
  • Slide 20
  • 20 Examples of Substitution Ciphers (cont.) Example 3: How many outfits can I make with 4 shirts, 3 pairs of pants, and 5 pairs of shoes? # shirt choices:4 # pants choices:3 # shoe choices:5 FPC implies 4 x 3 x 5 = 60 outfits
  • Slide 21
  • 21 Examples of Substitution Ciphers (cont.) To figure out how many different rearrangement ciphers there are, we can use FPC: # choices for ciphertext letter for a:26 # choices for ciphertext letter for b:25 # choices for ciphertext letter for y:2 # choices for ciphertext letter for z:1 FPC implies 26 x 25 x x 2 x 1 = 26!, or about 4.03 x 10 26 different ciphers!
  • Slide 22
  • 22 Examples of Substitution Ciphers (cont.) Additive Cipher Using the idea of modular arithmetic, we can create a cipher! For any non-negative integer a and positive integer n, we define a mod n to be the remainder when a is divided by n. Example 4: 18 mod 5 = 3, since 18 = 3 x 5 + 3 4 mod 7 = 4, since 4 = 0 x 7 + 4 28 mod 26 = 2, since 28 = 1 x 26 + 2 26 mod 13 = 0, since 26 = 2 x 13 + 0
  • Slide 23
  • 23 Examples of Substitution Ciphers (cont.) We can add and multiply numbers mod n too! Example 5: Find (27+15) mod 26 and (27x15) mod 26. 27+15 = 42 and 42 mod 26 = 16, so (27+15) mod 26 = 16 or 27 mod 26 = 1 and 15 mod 26 = 15, so (27+15) mod 26 = (1+15) mod 26 = 16 mod 26 = 16 27 x 15 = 405 and 405 mod 26 = 15, so (27 x 15) mod 26 = 15 or (27 x 15) mod 26 = (1 x 15) mod 26 = 15 mod 26 = 15
  • Slide 24
  • 24 Examples of Substitution Ciphers (cont.) To find (a+b) mod n: Add a to b, then find the resulting sum mod n, Or find a mod n, find b mod n, and add the results mod n. Multiplication works in a similar fashion! Handout: + and x tables for Z n Now we are ready to make an additive cipher!
  • Slide 25
  • 25 Examples of Substitution Ciphers (cont.) First, assign 1, 2, , 26 mod 26 to a, b, , z. Next, choose a fixed integer m between 0 and 25. To get the ciphertext y from plaintext x, add m mod 26, i.e., y = (x+m) mod 26. As an example, here is the additive cipher alphabet for m=14. Plaintextabcdefghijklm Plaintext #12345678910111213 Ciphertext #151617181920212223242501 CiphertextOPQRSTUVWXYZA Plaintextnopqrstuvwxyz Plaintext #1415161718192021222324250 Ciphertext #234567891011121314 CiphertextBCDEFGHIJKLMN
  • Slide 26
  • 26 Examples of Substitution Ciphers (cont.) Continuing the additive cipher example with m = 14, to encipher the plaintext letter e, we do the following: e 5 (5+14) mod 26 = 19 mod 26 = 19 19 S Thus, plaintext e is enciphered as ciphertext S.
  • Slide 27
  • 27 Examples of Substitution Ciphers (cont.) Continuing the additive cipher example with m = 14, to decipher ciphertext S, we add the additive inverse of 14 mod 26, which is 12: S 19 (19+12) mod 26 = 31 mod 26 = 5 5 e Thus, ciphertext S is deciphered as plaintext e. Question: What does the additive cipher look like? Answer: Caesar cipher! (The Caesar cipher is also called the additive cipher!)
  • Slide 28
  • 28 Notes on Ciphers For any cipher there is an algorithm, which is a general encrypting method, and a key which specifies the exact details of the algorithm. Example 6: For the Caesar cipher, Algorithmshift the alphabet, Keyhow many places to shift! Thus, there are 26 keys for this cipher.
  • Slide 29
  • 29 Notes on Ciphers (cont.) The key must remain secure! If the key is found, the code will be broken. If the algorithm is known, the code can still be secure! For a code or cipher, the greater the number of keys, the greater the security!
  • Slide 30
  • 30 Notes on Ciphers (cont.) The examples of substitution ciphers weve seen are called monoalphabetic substitution ciphers. The systems weve seen are symmetric because sender and receiver must both know (have) the key.
  • Slide 31
  • 31 References The Code Book by Simon Singh, Anchor Books, 1999. Stephen Fratini, An Encryption Algorithm using a Variation of the Turning-Grille Method, Mathematics Magazine, Volume 75, Number 5, December 2002, pp. 389-391. Edgar Allen Poe, A Few Words on Secret Writing, Grahams Magazine, July 1841, pp. 33-38.