Introduction to Network Security Missouri S&T University CPE 5420 Cryptology Overview Egemen K. Çetinkaya Egemen K. Çetinkaya Department of Electrical & Computer Engineering Missouri University of Science and Technology cetinkayae@mst.edu http://web.mst.edu/~cetinkayae/teaching/cpe5420fall2016 31 August 2016 rev. 16.0 2014 2016 Egemen K. Çetinkaya
Symmetric encryption Substitution ciphers Transposition ciphers Machine ciphers Steganography Cryptology Overview Outline 31 August 2016 MST CPE 5420 Cryptology Overview 2
Symmetric encryption Substitution ciphers Transposition ciphers Machine ciphers Steganography Cryptology Overview Symmetric Encryption 31 August 2016 MST CPE 5420 Cryptology Overview 3
Plaintext Encryption Techniques Definitions 1 the original message Ciphertext the coded message Enciphering or encryption process of converting from plaintext to ciphertext Deciphering or decryption restoring the plaintext from the ciphertext 31 August 2016 MST CPE 5420 Cryptology Overview 4
Cryptography Encryption Techniques Definitions 2 study of encryption Cryptographic system or cipher schemes used for encryption Cryptanalysis deciphering without any knowledge of enciphering details Cryptology breaking the code areas of cryptography and cryptanalysis together 31 August 2016 MST CPE 5420 Cryptology Overview 5
Symmetric Encryption Definition aka: conventional encryption or single-key encryption Only encryption prior to 1970s development of public-key encryption One of two most widely used encryption technique symmetric asymmetric Examples of symmetric encryption algorithms? 31 August 2016 MST CPE 5420 Cryptology Overview 6
Symmetric Encryption Definition aka: conventional encryption or single-key encryption Only encryption prior to 1970s development of public-key encryption One of two most widely used encryption technique symmetric asymmetric Examples of symmetric encryption algorithms: DES: data encryption standard AES: advanced encryption standard 31 August 2016 MST CPE 5420 Cryptology Overview 7
Symmetric Encryption Simplified Model plaintext, X : intelligible message, input to encryption algo. encryption algorithm, E : substitutions and transformations secret key, K : input to encryption algorithm ciphertext, Y : unintelligible scrambled text decryption algorithm, D : reverse of encryption algorithm 31 August 2016 MST CPE 5420 Cryptology Overview 8
Symmetric Encryption Cryptosystem Model strong encryption algorithm, but not secret unable to determine the key or decrypt the ciphertext share the keys in a secure fashion 31 August 2016 MST CPE 5420 Cryptology Overview 9
Cryptography Cryptographic System Types Operation type transforming plaintext to ciphertext substitution: elements mapped into another transposition: elements are rearranged essential requirement - information is not lost and reversible The number of keys used symmetric, single-key, secret-key, private-key asymmetric, two-key, public-key The way in which the plaintext is processed block cipher stream cipher 31 August 2016 MST CPE 5420 Cryptology Overview 10
Cryptanalysis Attack Types on Encryption System Attacker aims to recover the key rather than a plaintext of a single ciphertext for recovering any messages in the future as well Two types of attacks against crypto system cryptanalysis exploits algorithm characteristics or plain-cipher-text pairs brute-force attack attacker tries every possible key on ciphertext on average, half of all possible keys must be tried some degree of knowledge about plaintext is needed as the key space increases, becomes practically impossible 31 August 2016 MST CPE 5420 Cryptology Overview 11
Cryptanalysis Attack Types on Encrypted Messages Assumption: cryptanalyst have access to encryption algorithm and ciphertext Ciphertext only Known plaintext one or more plaintext-ciphertext pairs are known Chosen plaintext plaintext chosen by cryptanalyst Chosen ciphertext ciphertext chosen by cryptanalyst Chosen text combination of ciphertext and plaintext 31 August 2016 MST CPE 5420 Cryptology Overview 12
Cryptography Encryption Scheme Security Unconditionally (perfectly) secure ciphertext generated by the scheme does not contain enough information to determine corresponding plaintext adversary does not learn anything despite time & resources except one-time-pad there is no algorithm in this category Computationally secure cost of breaking cipher exceeds value of encrypted info time required to break cipher exceeds useful lifetime of info 31 August 2016 MST CPE 5420 Cryptology Overview 13
Symmetric encryption Substitution ciphers Transposition ciphers Machine ciphers Steganography Cryptology Overview Substitution Ciphers 31 August 2016 MST CPE 5420 Cryptology Overview 14
Substitution Techniques Overview Letters of plaintext are replaced by other: letters numbers symbols Examples? 31 August 2016 MST CPE 5420 Cryptology Overview 15
Substitution Techniques Examples Letters of plaintext are replaced by other: letters numbers symbols Examples: Caesar cipher monoalphabetic substitution cipher Playfair cipher Hill cipher polyalphabetic substitution cipher: Vigenère, Vernam one-time pad 31 August 2016 MST CPE 5420 Cryptology Overview 16
Substitution Techniques Caesar Cipher Simplest and earliest known substitution cipher used by Julius Caesar for military messages also known as shift cipher Replaces each letter of the alphabet with letter by some fixed number of positions Caesar cipher: three places further down the alphabet Alphabet is wrapped around plain: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C 31 August 2016 MST CPE 5420 Cryptology Overview 17
Substitution Techniques Caesar Cipher Algorithm Caesar algorithm can be expressed as: C = E(3, p ) = ( p + 3) mod 26 A shift may be of any amount C = E(k, p ) = ( p + k ) mod 26 Where key k takes on a value in the range 1 to 25 Decryption algorithm is simply: p = D( k, C ) = ( C k ) mod 26 Important characteristics brute-force cryptanalysis: encryption and decryption algorithms are known there are only 25 keys to try language of the plaintext is known and easily recognizable 31 August 2016 MST CPE 5420 Cryptology Overview 18
Substitution Techniques Monoalphabetic Substitution Cipher Caesar cipher is not secure with only 25 possible keys Arbitrary substitution increases the key space If permutation of 26 alphabetic characters is used, then there are 26! or ~ 4 x 10 26 possible keys Easy to break using frequency of data Countermeasure is to provide multiple substitutes homophones for a single letter a letter is assigned different cipher symbols: e 16, 74, 35 each homophone assigned to a letter in rotation or randomly 31 August 2016 MST CPE 5420 Cryptology Overview 19
Substitution Techniques Relative Frequency of Letters in English Text If the message is long, message can be cracked 31 August 2016 MST CPE 5420 Cryptology Overview 20
Substitution Techniques English Alphabet Number of letters? Number of vowels? Number of consonants? Digrams: two letter combinations, common ones? Trigrams: three letter combinations, common ones? Common words? 31 August 2016 MST CPE 5420 Cryptology Overview 21
Substitution Techniques English Alphabet Egemen K. Çetinkaya Letters: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Vowels: A E I O U Consonants: B C D F G H J K L M N P Q R S T V W X Y Z Common digrams: TH, IN, ER, RE, AN Common trigrams: THE, ING, AND, ION, ENT Common words: THE, OF, AND, TO, A Frequency of AEIOU: 39% Frequency of LNRST: 33% Frequency of JKQXZ: 1% [ref: http://jnicholl.org/cryptanalysis/data/englishdata.php] 31 August 2016 MST CPE 5420 Cryptology Overview 22
Substitution Techniques Playfair Cipher Egemen K. Çetinkaya Best-known multiple-letter encryption cipher Brief history: invented by Sir Charles Wheatstone in 1854 perfected by Lord Baron Playfair at British foreign office used as the standard field system by British Army in World War I US Army and allies during World War II first published solution in 1914 by Joseph O. Mauborgne Treats digrams in the plaintext as single units translates these units into ciphertext digrams Based on the use of a 5 x 5 matrix of letters constructed using a keyword 31 August 2016 MST CPE 5420 Cryptology Overview 23
Substitution Techniques Playfair Cipher Algorithm Plaintext is encrypted two letters at a time Repeating plaintext letters are separated with a filler balloon would be treated as ba lx lo on; x is filler letter Plaintext letters that are on the same row of the matrix are each replaced by the letter to the right for example, ar is encrypted as RM Plaintext letters that are on the same column are each replaced by the letter beneath for example, mu is encrypted as CM Otherwise, each plaintext letter in a pair is replaced by the letter that lies in its own row and the column 31 August 2016 MST CPE 5420 Cryptology Overview 24
Substitution Techniques Playfair Cipher Example Fill in letters of keyword from left to right and from top to bottom excluding duplicates Example using the keyword MONARCHY hs BP and ea IM or JM M O N A R C H Y B D E F G I/J K L P Q S T U V W X Z 31 August 2016 MST CPE 5420 Cryptology Overview 25
Substitution Techniques Hill Cipher Developed by the mathematician Lester Hill in 1929 Hides single-letter frequencies as Playfair cipher Larger matrix hides more frequency information 3 x 3 Hill cipher hides single-letter frequency information two-letter frequency information Strong against a ciphertext-only attack Easily broken with a known plaintext attack 31 August 2016 MST CPE 5420 Cryptology Overview 26
Substitution Techniques Polyalphabetic Substitution Cipher Improves on the simple monoalphabetic technique Uses different monoalphabetic substitutions Common features: set of related monoalphabetic substitution rules is used key determines which particular rule is chosen Canonical examples: Vigenère cipher Vernam cipher 31 August 2016 MST CPE 5420 Cryptology Overview 27
Substitution Techniques Vigenère Cipher Best known and one of the simplest Multiple ciphertext letters for each plaintext letter Substitution rules consists of the 26 Caesar ciphers with shifts of 0 through 25 A key is needed that is as long as the message Usually, the key is a repeating keyword 31 August 2016 MST CPE 5420 Cryptology Overview 28
Substitution Techniques Tabula Recta Egemen K. Çetinkaya Vigenère table is formed by shifting letters cyclically 31 August 2016 MST CPE 5420 Cryptology Overview 29
Substitution Techniques Vigenère Cipher Example Keyword: computer Message: crypto is cool Key: COMPUTERCOMP Plaintext: CRYPTOISCOOL Ciphertext:EFKENHMJECAA 31 August 2016 MST CPE 5420 Cryptology Overview 30
Substitution Techniques Vigenère Autokey System Periodic nature of keyword can be eliminated by nonrepeating keyword Autokey system: keyword is concatenated with the plaintext itself Keyword: computer Message: crypto is cool Key: Plaintext: Ciphertext: COMPUTERCRYP CRYPTOISCOOL EFKENHMJEFMA 31 August 2016 MST CPE 5420 Cryptology Overview 31
Substitution Techniques Vernam Cipher Introduced by Gilbert Vernam in 1918 @ AT&T Works on binary bits rather than letters XORing ( ) the plaintext and the key Requires a very long but repeating keyword 31 August 2016 MST CPE 5420 Cryptology Overview 32
Substitution Techniques One-Time Pad Vernam cipher eliminates frequency analysis keyword has no statistical relationship to plaintext partially: uses long key but repeating Joseph Mauborgne proposed one-time pad Uses random key that is as long as the message Key is not repeated after a message is encrypted/decrypted, it is discarded Scheme is unbreakable produces random output no statistical relationship to the plaintext ciphertext contains no information about the plaintext there is simply no way to break the code 31 August 2016 MST CPE 5420 Cryptology Overview 33
Substitution Techniques One-Time Pad Properties One-time pad relies on the randomness of the key One-time pad offers complete security The constraints are: generating large quantities of random keys key distribution and protection is significant issue It is used for high-security communication 31 August 2016 MST CPE 5420 Cryptology Overview 34
Substitution Techniques Cipher Comparison Egemen K. Çetinkaya Relative frequency of occurrence of letters 31 August 2016 MST CPE 5420 Cryptology Overview 35
Symmetric encryption Substitution ciphers Transposition ciphers Machine ciphers Steganography Cryptology Overview Transposition Ciphers 31 August 2016 MST CPE 5420 Cryptology Overview 36
Transposition Techniques Overview Permutation on the plaintext letters reordering the plaintext Examples? 31 August 2016 MST CPE 5420 Cryptology Overview 37
Transposition Techniques Examples Permutation on the plaintext letters reordering the plaintext Examples: rail fence raw transposition cipher Frequency analysis still possible They can be cracked by anagrams sliding text around Security increase by more transposition stages 31 August 2016 MST CPE 5420 Cryptology Overview 38
Transposition Techniques Rail Fence Cipher Simplest transposition cipher Also called zigzag cipher Algorithm is two step: plaintext is written down as a sequence of diagonals then read off as a sequence of rows Example with 3 rails (or fences) W... E... H... O... C... T... A... E. R. I. T. E. O. L. E. U. I. Y. L. S... A... N... C... S... R... C... S Ciphertext: WEHOCTAERITEOLEUIYLSANCSRCS Plaintext? 31 August 2016 MST CPE 5420 Cryptology Overview 39
Transposition Techniques Raw Transposition Cipher Also called columnar transposition, more complex Algorithm works: write the message in a rectangle, row by row and read the message off, column by column but permute the order of the columns order of columns becomes key to the algorithm 31 August 2016 MST CPE 5420 Cryptology Overview 40
Transposition Techniques Raw Transposition Cipher Example 6 1 2 4 3 5 D O Y O U L I K E T H E C L A S S X Example: key length? null? ciphertext? 31 August 2016 MST CPE 5420 Cryptology Overview 41
Transposition Techniques Raw Transposition Cipher Example 6 1 2 4 3 5 D O Y O U L I K E T H E C L A S S X Example: key length: 6 null: X ciphertext: OKL YEA UHS OTS LEX DIC 31 August 2016 MST CPE 5420 Cryptology Overview 42
Symmetric encryption Substitution ciphers Transposition ciphers Machine ciphers Steganography Cryptology Overview Machine Ciphers 31 August 2016 MST CPE 5420 Cryptology Overview 43
Cryptography Machine Ciphers Multiple stages of encryption difficult to cryptanalyze Widespread use in 1920-1970 Examples? 31 August 2016 MST CPE 5420 Cryptology Overview 44
Cryptography Machine Ciphers Multiple stages of encryption difficult to cryptanalyze Widespread use in 1920-1970 Examples: Rotor machine Enigma machine Purple machine 31 August 2016 MST CPE 5420 Cryptology Overview 45
Symmetric encryption Substitution ciphers Transposition ciphers Machine ciphers Steganography Cryptology Overview Steganography 31 August 2016 MST CPE 5420 Cryptology Overview 46
Steganography Overview Conceal the existence of the message Cryptography: message unintelligible to outsiders Steganography techniques: character marking invisible ink pin punctures typewritter correction ribbon 31 August 2016 MST CPE 5420 Cryptology Overview 47
Steganography A Puzzle for Inspector Morse Egemen K. Çetinkaya Can you see the hidden message? 31 August 2016 MST CPE 5420 Cryptology Overview 48
Steganography Love Letter from 1850s http://www.brainpickings.org/index.php/2014/09/01/victorian-cryptographic-love-letter 31 August 2016 MST CPE 5420 Cryptology Overview 49
Security vs. Obscurity Overview Idea around secrecy of the design if the attackers don t know design, they unlikely to attack primarily valid in early crypto work also called security by obscurity Modern crypto is around simplicity principle design should be easily explained strength should be in the key (key length) and algorithm also called security by design or open security Would you rather: hide your money under a tree or put it in safe? 31 August 2016 MST CPE 5420 Cryptology Overview 50
References and Further Reading [S2017] William Stallings, Cryptography and Network Security: Principles and Practice, 7th edition, Prentice Hall, 2017. [KPS2002] Charlie Kaufman, Radia Perlman, and Mike Speciner, Network Security: Private Communication in a Public World, 2nd edition, Prentice Hall, 2002. Fun links: http://www.bletchleypark.org.uk http://www.nsa.gov/about/cryptologic_heritage/museum 31 August 2016 MST CPE 5420 Cryptology Overview 51
End of Foils 31 August 2016 MST CPE 5420 Cryptology Overview 52