1 / 97

MATH 1020: Mathematics For Non-science Chapter 4.2: Cryptography

MATH 1020: Mathematics For Non-science Chapter 4.2: Cryptography. Instructor: Prof. Ken Tsang Room E409-R9 Email: kentsang @uic.edu.hk. Informatics -the science of information. What’s information Correcting errors in transmitted messages

zona
Télécharger la présentation

MATH 1020: Mathematics For Non-science Chapter 4.2: 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 1020: Mathematics For Non-scienceChapter 4.2: Cryptography Instructor: Prof. Ken Tsang Room E409-R9 Email: kentsang@uic.edu.hk

  2. Informatics-the science of information • What’s information • Correcting errors in transmitted messages • Genetic code and information • Data compression • Cryptography

  3. A typical communication system Shannon (1948) Information Theory Received Signal Signal Message Message Receiver Information Source Transmitter Destination Noise Source Bad guys

  4. Computer system security • Consider your bank account • You want to be the only one able to withdraw money from your account. • Similar concerns in the computing resources: • You want to be able to create, read and modify your files and let your co-worker Bob only to read it. • Safeguarding database contents, files, email messages etc. • Securing computer systems is a difficult problem • Information system components including hardware, software, users and data are dynamic in nature, so the solution needs to be re-evaluated.

  5. Secure communication • Many sensitive data are being transmitted through the network all the time • You want to buy a book online and send the bookstore your credit card number… personal data • Your father transfers money from his account to yours in a home banking session… personal data • Bob wants to send secret messages to express his love to Alice… privacy • The branch office of IBM in China sent a new business plan to its headquarter in US…commercial secret • The US Embassy in Beijing sent a cable back to Washington to report China’s latest political and economical developments… national secret

  6. Who needs secure communication? • Before the computer age • Governments • Militaries • Diplomats • Secret societies • Now, everybody who uses the computer • Almost all modern telephone, internet, fax and satellite communications are exploitable due to recent advances in technology and the 'open air' nature of much of the radio communications around the world.

  7. ECHELON:the big brother watching us • The vast international global eavesdropping network has existed since shortly after the second world war, when the US, Britain, Canada, Australia and New Zealand signed a secret (UKUSA) agreement on signals intelligence, or "sigint". • The system, reportedly in development since 1947, has been revealed in a number of public sources, first in a New Statesman article titled Someone's Listening in 1988. Its capabilities and political implications were later investigated by a committee of the European Parliament published in 2001.

  8. ECHELONintercept station at Menwith Hill, England. In the days of the cold war, ECHELON's primary purpose was to keep an eye on the USSR. In the wake of the fall of the USSR. ECHELON justifies it's continued multi-billion dollar expense with the claim that it is being used to fight "terrorism", the catch-all phrase used to justify any and all abuses of civil rights.

  9. ECHELON:the big brother watching us • The purpose of the UKUSA agreement was to create a single vast global intelligence organization sharing common goals and a common agenda, spying on the world and sharing the data. The entire global system is actually run by the US National Security Agency (NSA).

  10. The National Security Agency (NSA) • The United States government's cryptologic organization responsible for the collection and analysis of foreign communications. It coordinates, directs, and engages in activities to produce foreign signals intelligence information, using cryptanalysis and cryptographic technologies.

  11. The struggle to keep communication secure • Throughout history, cryptographers and cryptanalysts struggled to out-wit each other to achieve/expose secure communication.

  12. Enigma machine As the German military strength grew in the late 1920s, it began looking for a better way to secure its communications. It found the answer in a new cryptographic machine called "Enigma." The Germans believed the encryption generated by the machine to be unbreakable. With a theoretical number of ciphering possibilities of 3 x 10**114, their belief was not unjustified.

  13. The first computer: 'Bombe'? During World War II, English mathematician Alan Turing designed the “Bombe”, a machine to find the passwords or 'keys' into the secret codes of 'Enigma’, the famous encryption machine used by the German army in the field and to communicate to U-Boats in the Atlantic.

  14. Between 1939 and 1945, the most advanced and creative forms of mathematical and technological knowledge were combined to master German communications. British cryptanalysts, Alan Turing at the forefront, changed the course of the Second World War and created the foundation for the modern computer. During World War II, Bletchley Park, a Victorian Gothic mansion, was the site of the United Kingdom's main decryption establishment. Electronic machines were built out of readily available parts used for telephone switchgear. This move from mechanical to electronic methods in cryptography was probably the most significant result of the Bletchley Park codebreakers.

  15. Alan M. Turing (1912-1954) Alan Turing is often called the father of modern computers for two other reasons. Before the war he had the idea of a theoretical machine which could be programmed to solve any problem, just like our modern computers. Then, after the war he used the experience of working at Bletchley Park (top secret Laboratory in England during war time) to help build some of the worlds first computers in the UK.

  16. Cryptography- a way to security Cryptography is the study of secret (crypto-) writing (-graphy) • developing algorithms which may be used to: • conceal the context of some message from all except the sender and recipient (privacy or secrecy), and/or • verify the correctness of a message to the recipient (authentication)

  17. Bob & Alice want to communicate “securely” Trudy (intruder) may intercept, delete, add messages Friends and enemies: Alice, Bob, Trudy Bob data, control messages channel secure sender secure receiver data data Alice Trudy

  18. Basic terms of Cryptography • A message is in its original form is plaintext. • The coded (transformed) information is ciphertext • The process of producing ciphertext from plaintext is encryption (encode, encipher ). The reverse of encryption is decryption (decode, decipher). • The art of creating ciphertext is Cryptography. The study of methods of decoding ciphertext back into plaintext without knowledge of the key is called code-breaking, orcryptanalysis.

  19. Alice’s encryption key Bob’s decryption key encryption algorithm decryption algorithm ciphertext plaintext plaintext K K A B How cryptography works m plaintext message KA(m) ciphertext, encrypted with key KA m = KB(KA(m))

  20. Types of Cryptography • Cryptography often uses keys: • Algorithm is known to everyone • Only “keys” are secret • Asymmetric/Public key cryptography • Involves the use of two (1 secret & 1 public) keys • Symmetric/secret key cryptography • Involves the use one secret key

  21. Symmetric & Asymmetric Cryptography K(E) = K(D) K(E) != K(D)

  22. K K S S Symmetric key cryptography Symmetrickey crypto: Bob and Alice share same (symmetric) key: K • e.g., key is knowing substitution pattern in mono alphabetic substitution cipher How do Bob and Alice agree on key value? encryption algorithm decryption algorithm ciphertext plaintext plaintext message, m m = KS(KS(m)) K (m) S S

  23. Secret key encryption In Symmetric-Key encryption, each computer (for example two computers) has a secret key (code) that it can use to encrypt (encode) a packet of information. As an example “shift by 2” with letters could be “A” becomes “C” and “B” becomes “D”. Key distribution (so that A & B share the same key) can be problematic.

  24. Kerckhoffs’ Principle- Key is the only secret In any practical cipher system, it is often assumed that the interceptor will at some point find out the general system that is being used. Security of the message resides in preventing the interceptor from finding out the message key, the specific details of exactly how the system was configured for sending that particular message.

  25. Conventional Cryptosystem Model

  26. Classical Cryptography • Sender, receiver share common key • Keys may be the same, or trivial to derive from one another • symmetric cryptography • Two basic types • Transposition ciphers • Substitution ciphers • Combinations are called product ciphers

  27. Transposition Cipher • Rearrange letters in plaintext to produce ciphertext • Example (Rail-Fence Cipher or 2-columnar transposition) • Plaintext is HELLO WORLD • HELLOWORLD • Ciphertext is HLOOL ELWRD

  28. Transposition Cipher • Generalize to n-columnar transpositions • Example 3-columnar • HELLOWORLDXX • HLODEORXLWLX Modern Transposition ciphers take in N bits and permute using lookup table : called P-Boxes.

  29. Attacking the Transposition Cipher • Anagramming (rearranging the letters of a word/phrase to produce a new word/phrase) • If 1-gram frequencies match English frequencies, but other n-gram frequencies do not, probably transposition • Rearrange letters to form n-grams with highest frequencies

  30. Di-gram - frequencies Pairs of letters in English (referred to as digrams) have their characteristic frequencies. Some of the most common in English are given in the following table. Meaker’s tables, and those of Pratt and Fraprie, are taken from Gaines. One can also analyze trigrams, or longer sequences. Among the most common trigrams in English are THE, ING, THA, AND, ION.

  31. Example: Transposition Cipher • Ciphertext: HLOOLELWRD • Frequencies of 2-grams beginning with H (generally in English) • Examine frequencies of H-{letters in ciphertext} • HE 0.0305 • HO 0.0043 • HL, HW, HR, HD < 0.0010 • Frequencies of 2-grams ending in H (again, generally in English) • Examine frequences of {letters in ciphertext}-H • WH 0.0026 • EH, LH, OH, RH, DH ≤ 0.0002 • Implies it likely that E follows H in plaintext

  32. Example • Arrange so the H and E are adjacent HE LL OW OR LD • Read off across, then down, to get original plaintext

  33. Substitution cipher substituting one character for another • Mono-alphabetic cipher: substitute one letter for another plaintext: abcdefghijklmnopqrstuvwxyz ciphertext: mnbvcxzasdfghjklpoiuytrewq E.g.: Plaintext: bob. i love you. alice ciphertext: nkn. s gktc wky. mgsbc Key: the mapping from the set of 26 letters to the set of 26 letters Total numbers of possible substitutions: 26!

  34. Cæsar Ciphers

  35. Cæsar Ciphers • Cæsar cipher (simplest substitution cipher): ABCDEFGHIJKLMNOPQRSTUVWXYZ GHIJKLMNOPQRSTUVWXYZABCDEF • Example (Cæsar cipher) • Plaintext is HELLO WORLD • Change each letter to the third letter following it (X goes to A, Y to B, Z to C) • Key is 3, usually written as letter ‘D’ • Ciphertext is KHOOR ZRUOG

  36. Attacking the Cæsar Cipher • Exhaustive search • If the key space is small enough, try all possible keys until you find the right one • Cæsar cipher has 26 possible keys • Statistical analysis • Compare to 1-gram model of English

  37. Relative Frequency of Letters in English Text

  38. 0:a 0.080 7:h 0.060 13:n 0.070 19:t 0.090 1:b 0.015 8:i 0.065 0.080 20:u 0.030 14:o 21:v 2:c 0.030 9:j 0.005 15:p 0.020 0.010 3:d 0.040 10:k 0.005 0.002 22:w 0.015 16:q 4:e 0.130 11:l 0.035 17:r 0.065 23:x 0.005 5:f 0.020 12:m 0.030 18:s 0.060 24:y 0.020 6:g 0.015 25:z 0.002 English alphabet Frequencies p(char idx) p(char idx) p(char idx) p(char idx)

  39. Frequency Statistics of Language • In addition to the frequency info of single letters, the frequency info of two-letter (digram) or three-letter (trigram) combinations can be used for the cryptanalysis • Most frequent digrams • TH, HE, IN, ER, AN, RE, ED, ON, ES, ST, EN, AT, TO, NT, HA, ND, OU, EA, NG, AS, OR, TI, IS, ET, IT, AR, TE, SE, HI, OF • Most frequent trigrams • THE, ING, AND, HER, ERE, ENT, THA, NTH, WAS, ETH, FOR, DTH

  40. Cæsar’s weakness • Key is too short • Can be found by exhaustive search • Statistical frequencies not concealed well • They look too much like regular English letters • Improve the substitution permutation • Increase number of mapping options from 26 • Modern substitution ciphers take in N bits and substitute N bits using lookup table: called S-Boxes

  41. Vigènere Cipher • In 1562, Blaise de Vigènereinvented a cipher in which a different Caesar shift is applied to each letter of the plaintext. • Example • Message THE BOY HAS THE BALL • Key VIG • Encipher using Cæsar cipher for each letter: key VIGVIGVIGVIGVIGV plain THEBOYHASTHEBALL cipher OPKWWECIYOPKWIRG

  42. Vigenère Square

  43. Useful Terms for Vigènere Cipher • period: length of key • In earlier example, period is 3 • Poly-alphabetic: the key has several different letters • Unlike Cæsar cipher, which is mono-alphabetic

  44. Attacking the Vigènere Cipher • Approach • Establish period; call it n • Break message into n parts, each part being enciphered using the same key letter, e.g., a Cæsar cipher • Solve each part as separate Cæsar cipher problem • Automated in applet • http://math.ucsd.edu/~crypto/java/EARLYCIPHERS/Vigenere.html

  45. Establish Period • Kaskski: repetitions in the ciphertext occur when characters of the key appear over the same characters in the plaintext • Example : same pattern in the plaintext occurs under the same pattern of key: key VIGVIGVIGVIGVIGV plain THEBOYHASTHEBALL cipher OPKWWECIYOPKWIRG Note the key and plaintext line up over the repetitions (underlined). As distance between repetitions is 9, the period is a factor of 9 (that is, 1, 3, or 9)

  46. M O N A R Keyword = monarchy Plaintext: H S E A A R M U Ciphertext: B P I M R M C M C H Y B D E F G I/J K L P Q S T U V W X Z Playfair Cipher • Best-known multiple-letter substitution cipher • Digram cipher (diagram to digram, i.e., E(pipi+1)=cici+1 through key-based 5x5 transformation table) • Great advance over simple mono-alphabetic cipher • 26 letters  26x26=676 digrams • Still leaves much of the structure of the plaintext language  relatively easy to break • Can be generalized to polygram cipher

  47. Rotor Machines • Mechanical cipher machines, extensively used in WWII; Germany (Enigma), Japan (Purple), Sweden (Hagelin) • Each rotor corresponds to a substitution cipher • A one-rotor machine produces a polyalphabetic cipher with period 26 • Output of each rotor is input to next rotor • After each symbol, the “fast” rotor is rotated • After a full rotation, the adjacent rotor is rotated (like odometer) • - An n rotor machine produces a polyalphabetic cipher with period 26n

  48. The basic Enigma was invented in 1918 by Arthur Scherbius in Berlin. Figure 1 shows just a few of the 26 wires which will give the effect of the substitutions given earlier as a look-up table. For instance there is a wire from Q in the top row to M in the bottom row. Thus an electrical voltage applied to the Q terminal on the top row will appear at the M terminal on the bottom row. It enciphers a message by performing a number of substitutions one after the other. Scherbius's idea was to achieve these substitutions by electrical connections.

  49. The next idea is that it is not much more difficult to compose substitutions which are to be performed one after the other. The bottom row of terminals can simply be connected to the entry terminals of another set of wires, as in figure 2. The voltage appearing at the M terminal carries on to the R terminal on the bottom row. Thus the wirings have achieved a 'substitution' first from Q to M and then from M to R.

  50. Suppose the second set of wirings is displaced by 2 letters, as in Figure 3: In figure 3, an input at letter Q results in a lamp L lighting. Each choice from the 26 possible shifts now gives rise to a completely different substitution alphabet. If the wiring embodying the substitutions are set in a wheel then the shifts are achieved by rotations of one wheels against another.

More Related