1 / 57

Cryptography

Cryptography is the art of achieving security by encoding messages to make them non-readable. This introduction explains the basics of encryption, symmetric and asymmetric encryption, and the importance of secure key management.

brockway
Download Presentation

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. Cryptography

  2. Introduction • Cryptography is the art of achieving security by encoding messages to make them non-readable. • Some cryptography algorithms are very trivial to understand, replicate, and therefore crack. • Some other cryptography algorithms are highly complicated, and therefore, difficult to crack. • The rest are somewhere in the middle. • By far the most important automated tool for network and communications security is encryption.

  3. Encryption Two forms of encryption are in common use: • Conventional, or symmetric encryption. • public-key or asymmetric encryption

  4. Symmetric cipher model • Symmetric encryption is also referred as conventional or single-key encryption. • An original message is known as plaintext • The coded message is called the ciphertext. • The process of converting from plaintext to ciphertext is known as enciphering or encryption. • Restoring the plaintext from the ciphertext is deciphering or decryption. • The many schemes used for encryption constitute the area known as cryptography. Such a scheme is known as a cryptographic system or a cipher. • Techniques used for deciphering a message without any knowledge of the enciphering details fall into the area of cryptanalysis. • Cryptanalysis is what the layperson calls “breaking the code”. The areas of cryptography and cryptanalysis together are called cryptology.

  5. Symmetric Cipher Model… A symmetric encryption scheme has five ingredients: • Plaintext • Encryption algorithm • Secret Key • Ciphertext • Decryption algorithm

  6. Plaintext • This is the original intelligible message or data that is fed into the algorithm as input. • Note that plain text also known as clear text signifies a message that can be understood by the sender, the recipient, and also by anyone else who gets an access to that message.

  7. Encryption algorithm • The encryption algorithm performs various substitutions and transformations on the plaintext

  8. Secret Key The secret key is also input to the encryption algorithm. The key is a value independent of the plain text and of the algorithm. The algorithm will produce a different output depending on the specific key being used at the time. The exact substitutions and transformations performed by the algorithm depend on the key.

  9. Ciphertext • This is scrambled message produced as output. • It depends on the plaintext and the secret key. • When a plaintext message is codified using any suitable scheme, the resulting message is called as cipher text. • It is unintelligible.

  10. Decryption algorithm This is essentially the encryption algorithm run in reverse. It takes the cipher text and the secret key and produces the original plaintext.

  11. Requirements There are two requirements for secure use of conventional encryption: • We need a strong encryption algorithm. i.e. The opponent should be unable to decrypt cipher text or discover the key even if he or she is in possession of a number of ciphertexts together with the plaintext that produced each ciphertext. • Sender and receiver must have obtained copies of the secret key in a secure fashion and must keep the key secure.

  12. Cryptography Cryptographic systems are characterized along three independent dimensions: • The type of operations used for transforming plaintext to ciphertext. There are two primary ways in which a plain text message can be codified to obtain the corresponding cipher text : Substitution and Transposition. The fundamental requirement is that no information be lost. 2. The number of keys used. 3. The way in which plain text is processed.

  13. Substitution and Transposition • In substitution each element in the plaintext is mapped into another element. • In transposition elements in the plaintext are rearranged. • When two approaches are used together , we call the technique as product cipher.

  14. Number of keys If both sender and receiver use the same key, the system is referred to as symmetric, single-key, secret-key, or conventional encryption. If the sender and receiver use different keys, the system is referred to as asymmetric, two-key, or public-key encryption.

  15. block cipher • The way in which the plaintext is processed : A block cipher processes the input one block of elements at a time, producing an output block for each input block. • A stream cipher processes the input elements continuously, producing output one element at a time, as it goes along.

  16. Cryptanalysis Typically, the objective of attacking an encryption system is to recover the key in use rather then simply to recover the plaintext of a single ciphertext. There are two general approaches to attacking a conventional encryption scheme: • Cryptanalysis : This type of attack exploits the characteristics of the algorithm to attempt to deduce a specific plaintext or to deduce the key being used. • Brute-Force attack: The attacker tries every possible key on a piece of ciphertext until an intelligible translation into plaintext is obtained.

  17. Types of cryptanalytic attacks

  18. Cryptanalytic attacks…

  19. Substitution techniques • The two basic building blocks of all encryption techniques are substitution and transposition. • A substitution technique is one in which the letters of plaintext are replaced by other letters or by symbols. • If plaintext is viewed as a sequence of bits, then substitution involves replacing plaintext bit patterns with ciphertext bit patterns.

  20. Types of substitution techniques • Caesar Cipher • Modified version of Caesar cipher • Mono-alphabetic cipher • Homophonic Substitution cipher • Polygram Substitution cipher • Polyalphabetic Substitution cipher

  21. Caesar Cipher • This scheme was first proposed by Julius Caesar, and is termed as Caesar Cipher. • Caesar cipher is a special case of substitution techniques wherein each alphabet in a message is replaced by an alphabet three places down the line. • E.g. MANASI will become cipher text PDQDVL.

  22. Algorithm to break Caesar Cipher • Read each alphabet in the cipher text message, and search for it in the second row in the following figure. • When a match is found, replace that alphabet in the cipher text message with the corresponding alphabet in the same column but the first row of the table . • Repeat the process of all alphabets in the cipher text message. • The process shown above will reveal the original plain text.

  23. Formula for Caesar Cipher For each plain text letter p, substitute the cipher text letter C: then C = E(3, p) = (p + 3) mod 26 A shift may be of any amount, so that 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

  24. Modified version of Caesar cipher • In this version of Caesar cipher the cipher text alphabets corresponding to the original plain text alphabets may not necessarily be three places down the order, but instead, can be any places down the order.

  25. Algorithm to break the modified Caesar cipher • Let k be number equal to 1 • Read the complete cipher text message • Replace each alphabet in the cipher text message with an alphabet that is k positions down the order. • Increment k by 1 • If k is less than 26, then go to step 2. Otherwise stop the process. • The original text message corresponding to the cipher text message in one of the 25 possibilities produced by the above steps. • The above algorithm uses Brute – force attack

  26. Caesar cipher… As we have noticed, even the modified version of the Caesar cipher is not very secure. After all, the cryptanalyst needs to be aware of only following points to break a cipher text message using brute-force attack: • Substitution technique was used to derive the cipher text from original plain text. • There are only 25 possibilities to try out. • The language of the plain text was English. Anyone armed with this knowledge can easily break cipher text produced by the modified version of Caesar Cipher.

  27. Monoalphabetic cipher • In this scheme rather than using a uniform scheme for all the alphabets in a given plain text message, a random substitution is used. • This means that in a given plain text message, each A can be replaced by any other alphabet (B through Z), each B can also be replaced by any other random alphabet (A or C through Z), and so on. The crucial difference being, there is no relation between the replacement of B and replacement of A. • To put it mathematically, we can now have any permutation or combination of the 26 alphabets, which means (26 * 25 * 24 * 23 * …2) or 4 * 1026 possibilities. • This type would be extremely hard to crack.

  28. Attacking monoalphabetic cipher • If the cryptanalyst knows the nature of the plaintext , then the analyst can exploit the regularities of the language. • Consider following example: The ciphertext is as follows: UZQSOVUHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ.

  29. Monoalphabetic cipher… • The relative frequency of letters can be determined and compared to standard frequency distribution for English. • The relative frequencies of the letters in the cipher text are as follows: P-13.33, Z-11.67, S-8.33, U-8.33, O-7.50, M-6.67, H-5.83, D-5.00, E-5.00, V-4.17, X-4.17, F-3.33, …..

  30. Monoalphabetic cipher… • There are number of ways to proceed at this point. • Comparing the brekdown it seems likely that cipher letters P and Z are the equivalents of letters e and t, but it is not certain which is which. • Now we would 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 most common digram is th. • In our cipher text , the most common digram is ZW.

  31. Monoalphabetic cipher… • So we make the correspondence of Z with t and W with h. • Then look for most frequent trigram. In english it is “ the”. So ZWP would be The. • In the above manner after analyzing the entire cipher text we arrive at : It was disclosed yesterday that several informal but direct contacts have been made with political representatives of the viet cong in moscow.

  32. Homophonic Substitution Cipher • In this technique one plain text alphabet can map to more tham one cipher text alphabet.

  33. Polygram Substitution cipher • In polygram substitution cipher technique, rather than replacing one plain text alphabet with one cipher text alphabet at a time, a block of alphabets is replaced with another block. • For instance, HELLO could be replaced by YUQQW, but HELL could be replaced by a totally different cipher text block TEUI • This is true in spite the first four characters of the two blocks of text being the same. This shows that in polygram substitution cipher, the replacement of plain text happens block – by – block,rather than charater – by – character.

  34. Polyalphabetic Substitution Cipher • Leon Battista invented the Polyalphabetic substitution Cipher in 1568. • This cipher has been broken many times, yet it has been used extensively. • The Vigenere cipher and the Beaufort Cipher are examples of Polyalphabetic Substitution Cipher. • This cipher uses multiple-one character keys. Each of the keys encrypts one plain text character.

  35. Vigenere cipher • It is the best known and one of the simplest polyalphbetic cipher • In this scheme, the set of related monoalphabetic substitution rules consists of the 26 Caesar ciphers, with shifts of 0 through 25. • Each cipher is denoted by a key letter, which is the ciphertext letter that substitutes for the plain text letter a. • Thus, a Caesar cipher with a shift of 3 is denoted by the key value d.

  36. Vigenere cipher… • A matrix known as Vigenere tableau is constructed. • Each of the 26 ciphers is laid out horizontally, with the key letter for each cipher to its left. • A normal alphabet for the plaintext runs across the top. • The process of encryption is simple:

  37. Vigenere cipher… • Given a key letter x and a plaintext letter y, the cipher text letter is at the intersection of the row labeled x and the column labeled y; in this case the ciphertext is V. • To encrypt a message, a key is needed that is as long as the message. • Usually the key is a repeating keyword.

  38. Vigenere Example • For example, if the keyword is deceptive, the message “we are discovered save yourself” is encrypted as follows: Key : deceptivedeceptivedeceptive plaintext : wearediscoveredsaveyourself ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ

  39. Vigenere cipher decryption • Decreption is equally simple: • The key letter again identifies the row. • The position of the cipher text letter in that row determines the column, and the plain text letter is at the top of that column. • The strength of this cipher is that there are multiple ciphertext letters for each plaintext letter, one for each unique letter of the keyword.

  40. Principal methods in substitution ciphers. Two principal methods are used in substitution ciphers to lessen the extent to which the structure of the plain text survives in the ciphertext: • To encrypt multiple letters of plaintext • To use multiple cipher alphabets Examples of multiple-letter encrytion cipher: Playfair Cipher, Hill Cipher.

  41. Playfair cipher • The best-known multiple-letter encryption cipher is the Playfair, which treats digrams in the plaintext as single units and translates these units into cipher text digrams. • The Playfair algorithm is based on the use of a 5 * 5 matrix of letters constructed using a keyword. • The matrix is constructed by filling in the letters of the keyword (minus duplicates) from left to right and from top to bottom, and then filling in the remainder of the matrix with the remaining letters in alphabetic order.

  42. Playfair … • The letters I and J count as one letter. • Plaintext is encrypted two letters at a time, according to the following rules : • Repeating plaintext letters that are in the same pair are separated with the filler letter, such as x, so that balloon would be treated as ba lx lo on. • Two plaintext letters that fall in the same row of the matrix are each replaced by the letter to the right, with the first element of the row circularly following the last.

  43. Playfair… 3. Two plaintext letters that fall in the same column are each replaced by the letter beneath, with the top element of the column circularly following the last. 4. Otherwise, each plaintext letter in a pair is replaced by the letter that lies in its own row and column occupied by the other plaintext letter.

  44. Advantages of Playfair over monoalphabetic • The Playfair cipher is a great advance over simple monoalphabetic ciphers. For one thing, whereas there are only 26 letters, there are 26 * 26 = 676 digrams, so that identification of individual digrams is more difficult. • Furthermore, the relative frequencies of individual letters exhibit a much greater range than that of digrams, making frequency analysis much more difficult. • For these reasons, the Playfair cipher was for a long time considered unbreakable.

  45. Hill Cipher • Another interesting multiletter cipher is the Hill cipher, developed by the mathematician Lester Hill in 1929. • The encryption algorithm takes m successive plaintext letters and substitutes for them m ciphertext letters. • The substitution is determined by m linear equations in which each character is assigned a numerical value ( a = 0, b = 1, …, z = 25).

  46. Hill Cipher … • For m = 3, the system can be described as follows: c1 = (k11p1 + k12p2 + k13p3) mod 26 c2 = (k21p1 + k22p2 + k23p3) mod 26 c3 = (k31p1 + k32p2 + k33p3) mod 26 This can be expressed in term of column vectors and matrices:

  47. Transposition techniques • Transposition techniques differ from substitution techniques in the way that they do not simply replace one alphabet with another: they also perform some permutation over the plain text alphabets. • 4 techniques: • Rail Fence Technique • Simple Columnar Transposition Technique • One-Time Pad (Vernam cipher) • Book cipher / Running key cipher

  48. Rail Fence Technique • Rail Fence technique involves writing plain text as sequence of diagonals and then reading it row-by-row to produce cipher text. • Algorithm is as follows: 1. Write down the plain text message as a sequence of diagonals. 2. Read the plain text written in step 1 as a sequence of rows. • It should be quite clear that the Rail Fence technique is quite simple for a cryptanalyst to break into.

  49. Simple columnar transposition technique The algorithm is as follows: • Write the plain text message row-by-row in a rectangle of a pre-defined size. • Read the message column-by-column. However, it need not be in the order of columns 1,2,3,etc. It can be any random order such as 2,3,1,etc. • The message thus obtained is the cipher text message. In short The Simple Columnar Transposition Technique simply arranges the plain text as a sequence of rows of a rectangle that are read in columns randomly.

  50. Simple columnar transposition technique with multiple rounds • The idea is to use the same basic procedure as used by the simple columnar transposition technique, but do it more than once. • Cipher text produced by the Simple Columnar Transposition Technique with multiple rounds is much more complex to crack as compared to the basic technique.

More Related