510 likes | 561 Views
SYMMETRIC AND ASYMMETRIC KEY CRYPTOGRAPHY. Topics. Introduction Classical Encryption Techniques Block Ciphers and Data Encryption standards Advanced Encryption standard Public Key Cryptography RSA Diffie-Hellman Elgamal Curve Arithmetic Elliptic Curve arithmetic
E N D
Topics • Introduction • Classical Encryption Techniques • Block Ciphers and Data Encryption standards • Advanced Encryption standard • Public Key Cryptography • RSA • Diffie-Hellman • Elgamal Curve Arithmetic • Elliptic Curve arithmetic • Elliptic Curve cryptography.
Introduction • Plaintext • Ciphertext • Encryption • Decryption • Cryptography • Cryptanalysis • Cryptology
Cryptanalysis Opposite of Cryptography
Brute Force Attack • Definition - What does Brute Force Attack mean? • A brute force attack is a trial-and-error method used to obtain information such as a user password or personal identification number (PIN). • In a brute force attack, automated software is used to generate a large number of consecutive guesses as to the value of the desired data. • Brute force attacks may be used by criminals to crack encrypted data, or by security analysts to test an organization's network security.
5 Ingredients of SCM Plaintext Cipher text Encryption Decryption Algorithm Secret Key
There are two requirements for secure use of conventional encryption: Strong encryption algorithm Sender and receiver must have obtained copies of the secret key in a secure way & must key secure
An encryption scheme is unconditionally secure if the cipher text generated by the scheme does not contain enough information to determine uniquely the corresponding plaintext, no matter how much cipher text is available. The cost of breaking the cipher exceeds the value of the encrypted information. The time required to break the cipher exceeds the useful lifetime of the information. An encryption scheme is said to be computationally secureif either of the foregoing two criteria are met.
Substitution Ciphers • …………where letters of plaintext are replaced by other letters or by numbers or symbols or if plaintext is viewed as a sequence of bits, then substitution involves replacing plaintext bit patterns with cipher text bit patterns
Caesar Cipher • The earliest known, and the simplest, use of a substitution cipher was by Julius Caesar. • The Caesar cipher involves replacing each letter of the alphabet with the letter standing three places further down the alphabet. For example, • plain: meet me after the toga party • cipher: PHHW PH DIWHU WKH WRJD SDUWB
Note that the alphabet is wrapped around, so that the letter following Z is A. • We can define the transformation by listing all possibilities, as follows:
Caesar Cipher • Then the algorithm can be expressed as follows. For each plaintext letter p, substitute the ciphertext letter C: • C = E(3, p) = (p + 3) mod 26
A shift may be of any amount, so that the general Caesar algorithm is C = E(k, p) = (p + k) mod 26 • where k takes on a value in the range 1 to 25. The decryption algorithm is simply • p = D(k, C) = (C - k) mod 26 • If it is known that a given cipher text is a Caesar cipher, then a brute-force cryptanalysis is easily performed: simply try all the 25 possible keys.
Mono-alphabetic Ciphers • With only 25 possible keys, the Caesar cipher is far from secure • A dramatic increase in the key space can be achieved by allowing an arbitrary substitution. • A permutation of a finite set of elements S is an ordered sequence of all the elements of S, with each element appearing exactly once. • For example, if S = {a, b, c}, there are six permutations of S: abc, acb, bac, bca, cab, cba
In general, there are n! permutations of a set of n elements, because the first element can be chosen in one of n ways, the second in n - 1 ways, the third in n – 2 ways, and so on. First Broken by Arabic Scientist in 9th Century
If, the “cipher” line can be any permutation of the 26 alphabetic characters, then there are 26! or greater than 4 * 10 ==> 26! possible keys. • This is 10 orders of magnitude greater than the key space for DES and eliminates brute-force techniques for cryptanalysis. Such an approach is referred to as a monoalphabetic substitution cipher, because a single cipher alphabet (mapping from plain alphabet to cipher alphabet) is used per message.
Possible Attack • If the cryptanalyst knows the nature of the plaintext (e.g., noncompressed English text), then the analyst can exploit the regularities of the language. The ciphertext to be solved is: • UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ • VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX • EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
Step for Cryptanalysis • The relative frequency of the letters is determined and compared to a standard frequency distribution for English. • Make some tentative assignments & start to fill in the plaintext to see if it looks like a reasonable “skeleton” of a message.
A more systematic approach is to look for other regularities. • For example, certain words may be known to be in the text. Or we could look for repeating sequences of cipher letters and try to deduce their plaintext equivalents. • A powerful tool is to look at the frequency of two-letter combinations, known as digrams.
The most common such digram is th. • In our ciphertext, the most common digramis ZW, which appears three times. So we make the correspondence of Z with t and W with h. • Then, by our earlier hypothesis, we can equate P with e. • Now, notice that the sequence ZWP appears in the cipher text, and we can translate that sequence as “the.”
Continued analysis of frequencies plus trial and error should easily yield a solution from this point. • The complete plaintext, with spaces added between words, follows: • it was disclosed yesterday that several informal but • direct contacts have been made with political • representatives of the vietcong in moscow
Principal methods are used in substitution ciphers to lessen the extent to which the structure of the plaintext survives in the cipher text:, and the other is to use multiple cipher alphabets. one approach is to Encrypt multiple letters of plaintext: Play-Fair Cipher other is to use multiple cipher alphabets: Hill Cipher
Unit 2 Continued Unit 2 Continued
Not even the large number of keys in a mono-alphabetic cipher provides security One approach to improving security was to encrypt multiple letters The play-fair cipher is an example Play-fair cipher
Invented by Wheatstone on 26 March 1854,but it was promoted by Lord Playfair History
History Continued • It was rejected by the british foreign office when it was developed • It was used for tactical purposes in the second boer and world war I by british • For the same purpose by the australians and germans during world war II • The first published solution of the Playfair cipher was published in 1914
Working • A 5X5 matrix of letters based on a keyword • Fill in letters of keyword (sans duplicates) • Fill rest of matrix with other letters • Eg. Using the keyword MONARCHY
Security of the Playfair Cipher • Security much improved over monoalphabetic • Since have 26 x 26 = 676 digrams • Would need a 676-entry frequency table to analyse (verses 26 for a monoalphabetic) • And correspondingly more ciphertext • Was widely used for many years (eg. US & british military in WW1) • It can be broken, given a few hundred letters
Polyalphabetic Ciphers • Another approach to improving security is to use multiple cipher alphabets. • Called polyalphabetic substitution ciphers. • Makes cryptanalysis harder with more alphabets to guess and flatter frequency distribution. • Use a key to select which alphabet is used for each letter of the message. • Use each alphabet in turn. • Repeat from start after end of key is reached.
Working key: deceptivedeceptivedeceptive plaintext: wearediscoveredsaveyourself ciphertext:ZICVTWQNGRZGVTWAVZHCQYGLMGJ • Write the plaintext out • Write the keyword repeated above it • Eg using keyword deceptive • Use each key letter as a caesar cipher key • Encrypt the corresponding plaintext letter
Transposition Ciphers • Called as classical transposition or permutation ciphers • These hide the message by rearranging the letter order • Without altering the actual letters used • Can recognise these since have the same frequency distribution as the original text
Rail Fence cipher • Write message letters out diagonally over a number of rows • Then read off cipher row by row • Eg. Write message out as: M e m a t r h t g p r y E t e f e t e o a a t • Giving ciphertext Mematrhtgpryetefeteoaat
Row Transposition Ciphers • a more complex scheme • write letters of message out in rows over a specified number of columns • then reorder the columns according to some key before reading off the rows Key: 4 3 1 2 5 6 7 Plaintext: a t t a c k p o s t p o n e d u n t i l t w o a m x y z Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ
Product Ciphers • ciphers using substitutions or transpositions are not secure because of language characteristics • hence consider using several ciphers in succession to make harder, but: • two substitutions make a more complex substitution • two transpositions make more complex transposition • but a substitution followed by a transposition makes a new much harder cipher • this is bridge from classical to modern ciphers
Rotor Machines • Multiple-stage substitution algorithms • before modern ciphers, rotor machines were most common product cipher • were widely used in WW2 • German Enigma, Allied Hagelin, Japanese Purple • implemented a very complex, varying substitution cipher • used a series of cylinders, each giving one substitution, which rotated and changed after each letter was encrypted
Steganography • an alternative to encryption • hides existence of message • using only a subset of letters/words in a longer message marked in some way • using invisible ink • hiding graphic image or sound file • has drawbacks • high overhead to hide relatively few info bits