1 / 24

Cryptography

Math for Liberal Studies – Fall 2008. Cryptography. Adding Security to Messages. How do we protect the security of the messages we send? This is a very important issue in the information age Consider the number of times you send information you hope is secure: text messaging e-mail

calum
Download Presentation

Cryptography

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Math for Liberal Studies – Fall 2008 Cryptography

  2. Adding Security to Messages • How do we protect the security of the messages we send? • This is a very important issue in the information age • Consider the number of times you send information you hope is secure: • text messaging • e-mail • online shopping • etc.

  3. Prevention: Not an Option • It is largely impossible to prevent messages from being intercepted • Since we can’t keep people from reading our messages, we should try to disguise them so that the messages only make sense to the intended recipient • This process is called “encryption”

  4. Encryption: Systems are Key • Whenever we encrypt a message, it is vital that we do it systematically • It is hard to keep messages secret, but much easier to have a secret system • Many systems are based on a keyword or phrase that is only known to a select few

  5. Starting Simple: The Caesar Cipher • The simplest cipher was used originally by Julius Caesar • Take the letters of your message and change them according to this rule: • A  D • B  E • C  F • D  G • etc. • W  Z • X  A • Y  B • Z  C

  6. An Example • ATTACK AT DAWN • This becomes DVVDFN DV GDZQ • Notice that the new message looks like nonsense, but we can recover the original message since we know the rule • Sometimes we will remove the spaces and write the message in blocks of equal numbers of letters: DVVD FNDV GDZQ • This further disguises our message

  7. You Try It • The message XVHWK HIRUF HOXNH has been encoded using the Caesar cipher • Decode the message • USE THE FORCE LUKE

  8. Generalizing Caesar • We can take the idea of the Caesar cipher and generalize it to make it more secure • Instead of always shifting 3 letters ahead in the alphabet, we can secretly agree on a number to shift

  9. More Examples • Encode the message “RETREAT” using a Caesar cipher (shift 7) • YLAYLHA • The message “ACBU CCGS” was encoded using a Caesar cipher (shift 14). Decode the message • MONGOOSE

  10. Problems • Even when we choose a secret number, this isn’t a very secure code • Whatever letter “A” gets encoded as, it will be encoded as the same letter throughout our message • Using “frequency analysis,” these types of codes are easy to break

  11. Another Approach: Numbers • The new approach we will use is similar to the Caesar cipher • To make it easier, we will replace our letters with numbers: • A = 0 • B = 1 • C = 2 • etc. • Z = 25

  12. Alphabet Math • Using these numbers, we can “add” two letters together • D + L = 3 + 11 = 14 = O • What about R + Y = 17 + 24 = 41? • When the total is over 41, we “wrap around” back to the beginning of the alphabet • Wrapping around means that we end up at 41 – 26 = 15 = P

  13. Rethinking Caesar • Using this new idea, we can think of the original Caesar cipher as “Add D to every letter of the message” • If we choose a secret number to use for the Caesar cipher, we can think of that as choosing a secret letter • Why not choose a secret word?

  14. Vignère Cipher • For this cipher, we choose a secret keyword • Write down your original message, and then write down the keyword beneath it, repeating as many times as needed • For example, suppose our keyword is MATH

  15. An Example • THISISMYMESSAGE • MATHMATHMATHMAT • Now add the two rows together: • FHBZUSFFYELZMGX

  16. Now You Try It • Encode the message HASTA LA VISTA BABY using the keyword ARNOLD • HRFH LOAM VGED BROM

  17. Decoding • How do we decode a message using the Vignère cipher? • Instead of adding the keyword, we simply subtract • Reality check: Can we subtract F – R? • This would be 5 – 17 = -12, but we just wrap around again, so add 26 • -12 + 26 = 14 = O

  18. An Example • Decode the message “REAFX PSLLM VILGF UIWV” using the keyword “JESSE” • I AIN’T GOT TIME TO BLEED

  19. Another Level of Complexity • Even the Vignère cipher is relatively easy to crack, though it takes some more advanced techniques • Another cipher that uses some of the same ideas is called the Autokey cipher • Instead of repeating the keyword over and over, we only write it down once

  20. Example • Suppose we want to encode the message “SAY HELLO TO MY LITTLE FRIEND” with keyword “PACINO” • This time we write down the original message, and on the next line, the keyword followed by the message again • SAYHELLOTOMYLITTLEFRIEND • PACINOSAYHELLOTOMYLITTLE • Now we add the two lines together as before: HAAPR ZDORV QJWWM HXCQZ BXYH

  21. Your Turn • Encode the message “LORD OF THE RINGS” with the Autokey cipher using keyword “FRODO” • LORDOFTHERINGS • FRODOLORDOFTHE • QFFGCQHYHFNGNW

  22. Decoding Autokey: Tricky • The problem with decoding a message using the Autokey cipher is that we don’t know what to subtract, since it includes the original message • We have to decode the message a little bit at a time

  23. An Example • Decode the message “XHRVX HDSGG ATSAR TV” using the keyword “RETURN” • We know we need to subtract: XHRVXH DSGGAT SARTV RETURN FOREST MOONO FOREST MOONOF ENDOR

  24. Extra Credit • Caesar cipher (shift 3) • RQWKH ILQDO HADPB RXZLO O • Vignère cipher (keyword: FINAL) • GMNSV JLSOC YPRSP HZRT • Autokey cipher (keyword: EXAM) • RRMNR LIIMT DPAPP VW

More Related