Presentation is loading. Please wait.

Presentation is loading. Please wait.

9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.1 CSE565: Computer Security Lecture 2 Basic Encryption & Decryption Shambhu Upadhyaya Computer Science &

Similar presentations


Presentation on theme: "9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.1 CSE565: Computer Security Lecture 2 Basic Encryption & Decryption Shambhu Upadhyaya Computer Science &"— Presentation transcript:

1 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.1 CSE565: Computer Security Lecture 2 Basic Encryption & Decryption Shambhu Upadhyaya Computer Science & Eng. University at Buffalo Buffalo, New York, 14260

2 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.2 Overview  Lecture 2 Overview  Terminology (10 minutes)  Encryption by Substitutions & Transpositions (60 minutes)

3 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.3 Announcements  Background Material – 1  Properties of Arithmetic  Inverses  Divisors  Prime Numbers  Greatest Common Divisor  Background Material – 2  Modular arithmetic  Basic properties  Operations  Refer to Useful Notes on Handouts pageHandouts

4 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.4 Terminology  Encryption  A process of encoding a message  Decryption  It is the reverse process  Encryption Algorithms  A key K is generally used  Symmetric encryption:  Asymmetric encryption: Plaintext P=(p1,p2, …pn) Ciphertext Original Plaintext EncryptionDecryption C=(c1,c2, … cm) C=E(P) P=D(C) =D(E(P))

5 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.5 Cryptography & Cryptanalysis  Cryptography  Hidden writing – encryption to conceal text  Cryptanalysis  Break an encryption  Attempt to break a single message  Attempt to recognize patterns in encrypted messages  Attempt to find general weaknesses  Breakable Encryption  Given enough time and data, encryption can be broken  Practicality is an issue  Risky to proclaim an algorithm secure!

6 Cryptanalysis Attacks Type of attackWhat is known to cryptanalyst Ciphertext onlyAlgorithm, ciphertext Known plaintextAlgorithm, ciphertext, corresponding plaintext Chosen plaintextAlgorithm, ciphertext, plaintext chosen by analyst with corresponding ciphertext Chosen ciphertextAlgorithm, ciphertext, ciphertext chosen by analyst with corresponding decrypted plaintext Chosen textCombination of the above two 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 3.6

7 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.7 Substitutions & Transpositions  Substitutions  Monoalphabetic Ciphers  Polyalphabetic Ciphers  These are called Stream Ciphers  Transpositions  Permutation  These are Block Ciphers

8 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.8 Monoalphabetic Ciphers  Caesar Cipher  Formula:  Treaty Impossible --> wuhdwb lpsrvvleoh  Advantages & Disadvantages  Easy to perform  Simple, so easy to predict the pattern  Repeat characters give clue to break  Permutation Cipher  Use a key  ABCDE ………  Keyab……….  Since key is short, most plaintext letters are only one or two positions off  Time complexity of these algorithms – linear in n where n is the no. of characters in plaintext

9 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.9 Polyalphabetic Substitution Ciphers  Main problem with mono-alphabetic ciphers is the non-flat frequency distribution  A flat distribution gives no information to cryptanalyst  Flattening by combining distributions  Two or more separate encryption alphabets for the same character of the plaintext  E.g., one encryption for characters in odd positions and another for at even positions  Reduces the repeat symbols in the ciphertext  Makes it hard to break  (Discussion of an example)

10 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.10 Vigenere Tableau  Need to smooth out peaks and valleys of frequency distribution  Can be done by extending no. of permutations  Extreme case – extend to 26 permutations  A 26 X 26 table is used (discussion of example)  Key word of length 3 is sufficient to smooth out the distribution  Cryptanalysis of Polyalphabetic Substitution  Reading exercise  Focus on Kasiski method and Index of Coincidence method (Look up Ref. Texts)  (http://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher)http://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher

11 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.11 Perfect Substitution Cipher  Requires an infinite non-repeating sequence of alphabets  This will confound the cryptanalyst  One-Time pads  Vernam Cipher  Uses an arbitrarily long sequence of numbers  Formula:  Random Numbers  Middle digits of phone numbers in a residential directory  Pseudo random numbers – linear congruential random number generator  Formula:

12 Unbreakable Cipher  Use a Vigenere table with 27 characters (includes space)  Use a one-time key as long as the message  Two different decryptions using two keys  Cryptanalyst cannot figure out which key is correct – hence the code is unbreakable 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.12 ciphertext key plaintext ciphertext key plaintext ANKYODKYUREPFJBYOJDSPLREYIUNOFDOIUERFPLUYTS pxlmvmsydofuyrvzwc tnlebnecvgdupahfzzlmnyih mr mustard with the candlestick in the hall ANKYODKYUREPFJBYOJDSPLREYIUNOFDOIUERFPLUYT pftgpmiydgaxgoufhklllmhsqdqogtewbqfgyovuhwt miss scarlet with the knife in the library

13 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.13 Transpositions  It is a method where letters of the message are rearranged  Goal here is diffusion rather than confusion  Information is spread widely across the ciphertext  Columnar transposition is an easy one  Characters are rearranged into columns  (Study of an example)  Encipherment/Decipherment Complexity  Algorithm is constant in the amount of work per character  Time is proportional to length of message  Space required is directly proportional to message length  Output characters cannot be produced until all characters are read in  Delay depends on the length of the message  Not appropriate for long messages

14 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.14 Cryptanalysis  Digrams, trigrams & other patterns used to break encryption  Digram – letter pairs such as -re- -th- -en- -ed- etc.  Trigram – groups such as ent, and, ing, thi etc.  Cryptanalysis by trial & error & using a moving window for comparison  This is a reading exercise! (http://en.wikipedia.org/wiki/Transposition_cipher)http://en.wikipedia.org/wiki/Transposition_cipher  Double transposition algorithm makes breaking more difficult  It uses transposition of a transposed text  Discussion of example

15 9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.15 Summary  Stream Ciphers  Mono and poly-alphabetic encryptions  Since they convert one symbol of plaintext immediately into a symbol of ciphertext  Features include: a) speed of transformation, b) low error propagation  Disadvantages are: a) low diffusion, b) susceptible to malicious insertions  Block Ciphers  Columnar transposition algorithm and fractionated Morse  Group of plaintext symbols are encrypted as one block  Features include: a) diffusion, b) immunity to insertions  Disadvantages are: a) slowness of encryption, b) error propagation


Download ppt "9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.1 CSE565: Computer Security Lecture 2 Basic Encryption & Decryption Shambhu Upadhyaya Computer Science &"

Similar presentations


Ads by Google