Download presentation
Presentation is loading. Please wait.
Published byColeen Walker Modified over 6 years ago
1
CSE565: Computer Security Lecture 2 Basic Encryption & Decryption
Shambhu Upadhyaya Computer Science & Eng. University at Buffalo Buffalo, New York, 14260 8/31/17 UB Fall 2017
2
Overview Lecture 2 Overview Terminology (10 minutes)
Encryption by Substitutions & Transpositions (60 minutes) 8/31/17 UB Fall 2017
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 page 8/31/17 UB Fall 2017
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: Original Plaintext Plaintext Ciphertext Encryption Decryption P=D(C) =D(E(P)) P=(p1,p2, …pn) C=(c1,c2, … cm) C=E(P) 8/31/17 UB Fall 2017
5
Cryptography & Cryptanalysis
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! 8/31/17 UB Fall 2017
6
Cryptanalysis Attacks
Type of attack What is known to cryptanalyst Ciphertext only Algorithm, ciphertext Known plaintext Algorithm, ciphertext, corresponding plaintext Chosen plaintext Algorithm, ciphertext, plaintext chosen by analyst with corresponding ciphertext Chosen ciphertext Algorithm, ciphertext, ciphertext chosen by analyst with corresponding decrypted plaintext Chosen text Combination of the above two Brute force attack is the simplest. But may not be practical. 8/31/17 UB Fall 2017
7
Substitutions & Transpositions
Monoalphabetic Ciphers Polyalphabetic Ciphers These are called Stream Ciphers Transpositions Permutation These are Block Ciphers 8/31/17 UB Fall 2017
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 8/31/17 UB Fall 2017
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) Combine distributions that are high with ones that are low. T is sometimes enciphered as a and sometimes as b, X is sometimes enciphered as a and sometimes as b. The high frequency of T mixes with the low frequency of X. This produces a more moderate distribution for a and b. 8/31/17 UB Fall 2017
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) ( Kasiski method for repeated patterns Makes use of the regularity of English Index of coincidence – works on the variation of the frequencies in a distribution – how high is high and how low is low…..it is a probabilistic method 8/31/17 UB Fall 2017
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 8/31/17 UB Fall 2017
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 ciphertext key plaintext ANKYODKYUREPFJBYOJDSPLREYIUNOFDOIUERFPLUYTS pxlmvmsydofuyrvzwc tnlebnecvgdupahfzzlmnyih mr mustard with the candlestick in the hall ANKYODKYUREPFJBYOJDSPLREYIUNOFDOIUERFPLUYT pftgpmiydgaxgoufhklllmhsqdqogtewbqfgyovuhwt miss scarlet with the knife in the library 8/31/17 UB Fall 2017
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 8/31/17 UB Fall 2017
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! ( Double transposition algorithm makes breaking more difficult It uses transposition of a transposed text Discussion of example 8/31/17 UB Fall 2017
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 8/31/17 UB Fall 2017
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.