Chapter Two: Classic Cryptography

Slides:



Advertisements
Similar presentations
CLASSICAL ENCRYPTION TECHNIQUES
Advertisements

Using Cryptography to Secure Information. Overview Introduction to Cryptography Using Symmetric Encryption Using Hash Functions Using Public Key Encryption.
Making “Good” Encryption Algorithms
Cryptology Terminology and Early History. Cryptology Terms Cryptology –The science of concealing the meaning of messages and the discovery of the meaning.
Cryptology  Terminology  plaintext - text that is not encrypted.  ciphertext - the output of the encryption process.  key - the information required.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering.
EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
EEC 688/788 Secure and Dependable Computing Lecture 3 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
McGraw-Hill©The McGraw-Hill Companies, Inc., Security PART VII.
1 Day 04- Cryptography Acknowledgements to Dr. Ola Flygt of Växjö University, Sweden for providing the original slides.
Chapter 2 Basic Encryption and Decryption (part B)
Lecture 23 Symmetric Encryption
Lecture 1 Overview.
Chapter 2 – Classical Encryption Techniques
3.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 3 Traditional Symmetric-Key Ciphers.
Cryptography Week-6.
Chapter 2 Basic Encryption and Decryption. csci5233 computer security & integrity 2 Encryption / Decryption encrypted transmission AB plaintext ciphertext.
Lecture 2 Overview.
Security in Computing Cryptography (Introduction) Derived from Greek words: ‘Kruptos’ (hidden) and ‘graphein’ (writing.
1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester
Computer System Security CSE 5339/7339
Chapter 2 – Elementary Cryptography  Concepts of encryption  Cryptanalysis  Symmetric (secret key) Encryption (DES & AES)(DES & AES)  Asymmetric (public.
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (1) Information Security.
Chapter 20 Symmetric Encryption and Message Confidentiality.
Cryptography and Network Security (CS435) Part Two (Classic Encryption Techniques)
Day 18. Concepts Plaintext: the original message Ciphertext: the transformed message Encryption: transformation of plaintext into ciphertext Decryption:
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Classical Cryptography.
ITMS – 3153 Information Systems Security
1 Chapter 2-1 Conventional Encryption Message Confidentiality.
Network Security Lecture 11 Presented by: Dr. Munam Ali Shah.
Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3.
Symmetric-Key Cryptography
Module :MA3036NI Cryptography and Number Theory Lecture Week 3 Symmetric Encryption-2.
9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.1 CSE565: Computer Security Lecture 2 Basic Encryption & Decryption Shambhu Upadhyaya Computer Science &
Elementary Cryptography  Concepts of encryption  Symmetric (secret key) Encryption (DES & AES)(DES & AES)  Asymmetric (public key) Encryption (RSA)(RSA)
Cryptography (Traditional Ciphers)
Lecture 3 Page 1 Advanced Network Security Review of Cryptography Advanced Network Security Peter Reiher August, 2014.
Traditional Symmetric-Key Ciphers
Security in Computing Cryptography (Traditional Ciphers)
Data Security and Encryption (CSE348) 1. Lecture # 3 2.
Lecture 23 Symmetric Encryption
K. Salah1 Cryptography Module I. K. Salah2 Cryptographic Protocols  Messages should be transmitted to destination  Only the recipient should see it.
DATA & COMPUTER SECURITY (CSNB414) MODULE 3 MODERN SYMMETRIC ENCRYPTION.
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (2) Information Security.
Symmetric Cipher Model Plaintext input 1- encryption algorithm 2- secret key Encryption Cipher text output Cipher text input 1- Decryption algorithm 2-
EEC 688/788 Secure and Dependable Computing Lecture 3 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Lecture 2 Overview. Cryptography Secret writing – Disguised data cannot be read, modified, or fabricated easily – Feasibility of complexity for communicating.
1 Classical Encryption Techniques. 2 Symmetric cipher model –Cryptography –Cryptanalysis Substitution techniques –Caesar cipher –Monoalphabetic cipher.
CPIS 312 Chapter Two: Classic Cryptography By Dr. Daniyal Alghazzawi 2011 Term 2.
Prof. Wenguo Wang Network Information Security Prof. Wenguo Wang Tel College of Computer Science QUFU NORMAL UNIVERSITY.
Computer Security By Rubel Biswas. Introduction History Terms & Definitions Symmetric and Asymmetric Attacks on Cryptosystems Outline.
Department of Computer Science Chapter 5 Introduction to Cryptography Semester 1.
1 Introduction to Cryptography Chapter-4. Definitions  Cryptography = the science (art) of encryption  Cryptanalysis = the science (art) of breaking.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 4. Traditional and Modern.
@Yuan Xue Quick Review.
CRYPTOGRAPHY G REEK WORD MEANING “ SECRET WRITING ”
Substitution Ciphers.
CSE565: Computer Security Lecture 2 Basic Encryption & Decryption
Chapter 2 Basic Encryption and Decryption
Cryptography and Network Security
Cryptography.
Outline Some Basic Terminology Symmetric Encryption
EEC 688/788 Secure and Dependable Computing
Traditional Symmetric-Key Ciphers
Presentation transcript:

Chapter Two: Classic Cryptography

Index Introduction A.1 Cryptosystems A.2 Terminology B. Classic Cipher (Substitution Cipher) B.1 Caesar Cipher B 2 Tap Code B.3 Pigpen Cipher B 4 Vigenere Cipher B 5 Book Cipher C. Cryptanalysis of Substitution Cipher C.1 Brute force cryptanalysis C.2 Frequency Distribution Analysis D. Calculation of Modulo operation E. One-Time Pad F. Classic Cipher( Transposition Cipher) F.1 Route Cipher F.2 Rail Fence Cipher F.3 Column Cipher

Cryptosystems A. Ciphers B. Classic B.1 Substitution e.g., Caesar Cipher B.2 Transposition e.g., Route Cipher B.3 Hybrid C. Modern C.1 Symmetric (Private Key) Stream Cipher e.g., RC4, A5/1 Block Cipher e.g., DES, AES C.2 Asymmetric (Public Key) e.g., RSA C.3 Hybrid

A. Terminology Cryptology is the art and science of making and breaking “secret codes.” Cryptography is the making of “secret codes.” Cryptanalysis is the breaking of “secret codes.” Crypto is a synonym for any or all of the above (and more). Cipher (صفر) is an algorithm for performing encryption and decryption — a series of well-defined steps that can be followed as a procedure.

Terminology Encryption is the process of encoding a message so that its meaning is not obvious Equivalent terms: encode, encipher Decryption is the reverse process, transforming an encrypted message back into its normal, original form Equivalent terms: decode, decipher Encrypt Plaintext Ciphertext Decrypt

Terminology Encryption/decryptions algorithms often use a device called a key, so that the resulting ciphertext depends on the original plaintext message, the algorithm, and the key value An encryption scheme that does not require the use of a key is called a keyless cipher The cryptosystem involves a set of rules for how to encrypt the plaintext and how to decrypt the ciphertext Encrypt Plaintext Ciphertext Decrypt

Terminology Plaintext: message to be encrypted Ciphertext: encrypted message DK(EK(P)) = P

Terminology Symmetric uses same key for encryption and decryption process. To encrypt: C = E(K, P) To decrypt: P = D (K, E(K,P)) Asymmetric uses different key for encryption and decryption process. To encrypt: C = E (KE,P) To decrypt: P = D (KD, E (KE,P))

B. Classic Cipher Substitution Ciphers: exchange one letter (or more) with another letter/number/symbol/sound/art A mono-alphabetic cipher uses fixed substitution over the entire message, A poly-alphabetic cipher uses a number of substitutions at different times in the message Transposition Ciphers: re-arrange the order of the letters

B.1. Substitution Ciphers 1. Caesar Cipher Idea: each letter or group of letters is replaced by another letter or group of letters Caesar cipher – circularly shift by 3 letters a -> D, b -> E, … z -> C More generally, shift by k letters, k is the key

B.1. Substitution Ciphers 1. Caesar Cipher It is monoalphabetic cipher uses addition modulo 26 The message must be a sequence of letters, each letter is identified with a number: The key k is a number in the range 1 … 25. Advantages and Disadvantages: The Caesar cipher is quite simple The ability of predict the entire algorithm using small piece of ciphertext

B.1. Substitution Ciphers 1. Caesar Cipher (Algorithms) Encryption/decryption involve ± k to each letter (mod 26). So the general Caesar algorithm is Ci= Ek(Mi) = E(Mi, k) = (Mi+k) mod 26 Mi= Dk(Ci) = D(Ci, k) = (Ci-k) mod 26 For example, Plaintext : treaty impossible Key : ± 3 Ciphertext: wuhdwb lpsrvvleoh That is, Ci=E[Mi , 3] = Mi+3 mod 26

B.1. Substitution Ciphers 1. Caesar Cipher It is the simplest monoalphabetic cipher. Caesar cipher using the shift parameter as the key:

Example: Caeser Cipher (Encryption)

Example: Caesar Cipher (Decryption)

Example: Caesar cipher (Encryption) Use the Caesar cipher with key=15 to encrypt the message “hello” Ciphertext: WTAAD

Example: Caesar Cipher (Decryption) Use the Caesar cipher with key=15 to decrypt the message “WTAAD” Ciphertext: hello

Questions Review Q1. Use the Caesar cipher to find the plaintext and the key from the ciphertext: Ciphertext : ugehmlwj kwumjalq Q2. Use the Caesar cipher with key=3 to encrypt the next message: Plaintext: the quick brown fox jumps over the lazy dog

B.1. Substitution Ciphers 2. Tap Code Each letter is replaced by a number of beeps

Substitution Cipher Pigpen Cipher Each letter is replaced by an art

B.1. Substitution Ciphers 3. Vigenère Cipher Polyalphabetic ciphers flatten the frequency distribution of the plaintext considerably. Vigenère Cipher is an example of polyalphabetic ciphers - use different monoalphabetic substitutions as one proceeds through the plaintext message. For example: Plaintext (M) meet me at ten Key (K) badb ad ba dba Ciphertext(C) nehu mh bt wfn where C = M+K mod 26

B.1. Substitution Ciphers 3. Vigenère Cipher Vigenère Tableau

B.1. Substitution 3.Vigenere algorithm This is a Polyalphabetic Cipher that uses Caesar Cipher with more than one key.

B.1. Substitution 3.Vigenere algorithm - We can notice from the above example that four keys are used for encryption and decryption. - Keys range from 1 to 25. - Four keys are used in the above example (5,9,18 and 24) - Encryption is done by using first key ( i.e. 5) to encrypt first letter A, Second letter B is encrypted using key =9 and C is encrypted using key 18 and a letter D is encrypted using key= 24. - When we used all keys the process is repeated and a second round is made. So when we reach letter E, we encrypt it again using key = 5 and letter F is encrypted using key=9 and etc… - To decrypt the cipher, we should know what the letters that each key encrypts is. This is can be done by using array of letter indexes (i.e. Key = 5 encrypts letter in indexes 0, 4,8,12 …. - The Excel sheet will spread to the students and they should try it by adjusting some parameters keys.

Question Review Q1:Use the Vigenere cipher with key=lemon to encrypt the message “attackatdawn”

B.1. Substitution Ciphers 4. Book Cipher Any book can provide a key The key is formed from the letter of the text Steps: select a passage (Key) “the page cannot be found” match the plaintext with selected text. Plaintext  “MACHINES CANNOT THINK” encode plaintext using Vigenere table

B.1. Substitution Ciphers Cryptanalysis Brute force cryptanalysis: would have to try 26! permutations of a particular ciphertext message. Students can guess the key by using brute force technique. - For example in the above program, the key was set to 3.

Brute force cryptanalysis (cont) Try key = 0, the decrypted cipher will be: Try key = 1, the decrypted cipher will be: Try key = 2, the decrypted cipher will be: Try key = 3, the decrypted cipher will be: Matched!! So key =3

B.1. Substitution Ciphers Cryptanalysis (cont) 2. Frequency Distribution Analysis: In practice, it is not difficult to determine the key using frequencies of letters, pairs of letter etc., or by guessing a probable word or phrase Most frequently occurred Letters: e, t, o, a, n, … Digrams: th, in, er, re, an, … Trigrams: the, ing, and, ion, ent Words: the, of, and, to, a, in, that,

B.1. Substitution Ciphers 7. One-Time Pads

B.1. Substitution Ciphers 7. One-Time Pads (using Bits) One-time pad: construct an unbreakable cipher Choose a random bit string as the key Convert the plaintext into a bit string Compute the XOR of these two strings, bit by bit The resulting ciphertext cannot be broken, because in a sufficiently large sample of ciphertext, each letter will occur equally often, as will every diagram, every trigram, and so on => There is simply no information in the message because all possible plaintexts of the given length are equally likely The Vernam Cipher is a type of one-time pad devised by Gilbert Vernam for AT&T

Calculation of MOD operation Calculate the following mod: E.g., (5) mod 21 =5 (30) mod 21 = (9) mod 21 =9

Calculation Negative MOD Modula always return non-negative number: Calculate the following mod E.g., (-57) mod 21 = (-36) mod 21 = (-15) mod 21 = (6) mod 21 =6

B.1. Substitution Ciphers 7. One-Time Pads (using ASCII Code) Plaintext V E R N A M C I P H Numeric Equivalent 21 4 17 13 12 2 8 15 7 + Random Number 76 48 16 82 44 3 58 11 60 5 47 88 = Sum 97 52 33 95 19 75 51 105 = mod 26 18 23 25 1 Ciphertext t a h r s p i x m z b To decrypt: (Ci – Ki) mod 26 Note on rules of mod on negative number: “The mod function is defined as the amount by which a number exceeds the largest integer multiple of the divisor that is not greater than that number” (http://mathforum.org/library/drmath/view/52343.html) Modula op always return non-negative number E.g., (19-76) mod 26 = (-57) mod 26 = (-78+21) mod 26 = 21 Ciphertext t a h r s p i x m z b Numeric Equivalent 19 7 17 18 15 8 23 12 25 1 - One-time pad 76 48 16 82 44 3 58 11 60 5 47 88 = Difference -57 -48 -9 -65 -26 -50 -37 -22 -87 = mod 26 21 4 13 2 Plaintext V E R N A M C I P H

B.1. Substitution Ciphers 7. One-Time Pads Observations: The repeated letter comes from different plaintext letters Duplicate ciphertext letters are generally unrelated when this encryption algorithm is used => there is no information in the message to be exploited Disadvantages The key cannot be memorized, both sender and receiver must carry a written copy with them Total amount of data can be transmitted is limited by the amount of key available Aabsolute synchronisation is between sender and receiver, otherwise, it fails completely to protect message integrity)

B.2. Transposition Ciphers Transposition cipher – reorders (rearrange) symbols but does not disguise them. It is also called permutation With transposition, the cryptography aims for diffusion Widely spreading the information from the message or the key across the ciphertext Transpositions try to break established patterns

B.2. Transposition Ciphers 1. Route Cipher

B.2. Transposition Ciphers 2. Rail Fence Cipher

B.2. Transposition Ciphers 3. Columnar Transposition Plaintext written in rows Number of columns = key length Key is used to number the columns Ciphertext reads out by columns, starting with column whose key letter is lowest

B.2. Transposition Ciphers 3. Columnar Transposition For example: Plaintext (M): WE ARE DISCOVERED FLEE AT ONCE Key (K): 6 3 2 4 1 5 Ciphertext(C): EVLNE ACDTK ESEAQ ROFOJ DEECU WIREE

Example:Columnar cipher Ciphertext(C): EVLNX ACDTX ESEAX ROFOX DEECX WIREE Key: 632415 Plaintext (M): WE ARE DISCOVERED FLEE AT ONCE

Question review Q1. Encrypt the following plaintext using Columnar transposition: We are going to university every day Use your Last name as keyword Q2.use the rail fence Cipher (3 rails) to encode the following plaintext Plaintext: We are going to university every day

Question review Q3. They are 4! = 24 possible combinations for the substations. Here some sample: Q4 . By using brute force we must try all 24 choices until we break the cipher.

Terms and Concepts Encryption & Decryption Plaintext & Ciphertext Algorithm & Cipher Cryptology Cryptography & Cryptanalysis Key Substitution & Transposition Monoalphabetic Ciphers & Polyalphabetic Ciphers