Lecture Classical Encryption Techniques Dr. Nermin Hamza

Slides:



Advertisements
Similar presentations
CLASSICAL ENCRYPTION TECHNIQUES
Advertisements

Cryptography and Network Security Chapter 2
Cryptography and Network Security Chapter 2. Chapter 2 – Classical Encryption Techniques Many savages at the present day regard their names as vital parts.
Announcement Grading adjusted –10% participation and two exams 20% each Newsgroup up Assignment upload webpage up Homework 1 will be released over the.
CSCE 790G: Computer Network Security
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Chapter 2 – Classical Encryption Techniques. Classical Encryption Techniques Symmetric Encryption Or conventional / private-key / single-key sender and.
Classical Encryption Techniques
Review What is security: history and definition Security policy, mechanisms and services Security models.
Classical Encryption Techniques
Overview of Cryptographic Techniques Hector M Lugo-Cordero CIS 4361 Secure Operating System Administration 1.
Chapter 2 – Classical Encryption Techniques
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Classical Encryption Techniques
Cryptography. Secret (crypto) Writing (graphy) –[Greek word] Practice and study of hiding information Concerned with developing algorithms for: –Conceal.
Cryptography and Network Security Chapter 2. Chapter 2 – Classical Encryption Techniques Many savages at the present day regard their names as vital parts.
Dr. Lo’ai Tawalbeh 2007 Chapter 2: Classical Encryption Techniques Dr. Lo’ai Tawalbeh New York Institute of Technology (NYIT) Jordan’s Campus INCS.
1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester
Chapter 2 Classical Encryption Techniques. Symmetric Encryption n conventional / private-key / single-key n sender and recipient share a common key n.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Computer Science&Technology School of Shandong University Instructor: Hou Mengbo houmb AT sdu.edu.cn Office: Information Security Research Group.
Cryptography and Network Security Chapter 2. Symmetric Encryption  or conventional / private-key / single-key  sender and recipient share a common key.
Cryptography and Network Security (CS435) Part Two (Classic Encryption Techniques)
Cryptography and Network Security Chapter 2 Fourth Edition by William Stallings Lecture slides by Lawrie Brown.
Symmetric Encryption or conventional / private-key / single-key sender and recipient share a common key all classical encryption algorithms are private-key.
 Classic Crypto  Slides based on those developed by Dr. Lawrie Brown at the Australian Defence Force Academy, University College, UNSW  See
1 Chapter 2-1 Conventional Encryption Message Confidentiality.
Network Security Lecture 11 Presented by: Dr. Munam Ali Shah.
Rather than just shifting the alphabet Could shuffle (jumble) the letters arbitrarily Each plaintext letter maps to a different random cipher text letter.
Module :MA3036NI Cryptography and Number Theory Lecture Week 3 Symmetric Encryption-2.
1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami.
Data Security and Encryption (CSE348) 1. Lecture # 4 2.
Data Security and Encryption (CSE348) 1. Lecture # 3 2.
1 Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown [Changed by Somesh Jha]
1 Cryptography and Network Security Fourth Edition by William Stallings Lecture slides by Lawrie Brown [Changed by Somesh Jha]
Information Systems Security 3. Chapter 2 – Classical Encryption Techniques Many savages at the present day regard their names as vital parts of themselves,
Symmetric Cipher Model Plaintext input 1- encryption algorithm 2- secret key Encryption Cipher text output Cipher text input 1- Decryption algorithm 2-
Chapter 2 – Classical Encryption Techniques. Symmetric Encryption or conventional / private-key / single-key sender and recipient share a common key all.
Cryptography and Network Security Chapter 2
Chapter 2 – Classical Encryption Techniques Many savages at the present day regard their names as vital parts of themselves, and therefore take great pains.
Instructor: Dania Alomar
Network Security Lecture 13 Presented by: Dr. Munam Ali Shah.
1 Cryptography and Network Security Fourth Edition by William Stallings Lecture slides by Lawrie Brown [Changed by Somesh Jha]
Cryptography and Network Security Chapter 2 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
1 Classical Encryption Techniques. 2 Symmetric cipher model –Cryptography –Cryptanalysis Substitution techniques –Caesar cipher –Monoalphabetic cipher.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
By Marwan Al-Namari & Hafezah Ben Othman Author: William Stallings College of Computer Science at Al-Qunfudah Umm Al-Qura University, KSA, Makkah 1.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Prof. Wenguo Wang Network Information Security Prof. Wenguo Wang Tel College of Computer Science QUFU NORMAL UNIVERSITY.
Cryptography and Network Security Chapter 2 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Lecture 2 Cryptology.  Network Security( )  user name for students :guestnws  pwd : guestnws2012 E-learning.
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 ”
Conventional Encryption Message Confidentiality
Communication Security
Cryptography and Network Security
Lecture Classical Encryption Techniques Dr. Nermin Hamza
Introduction Of System Security
CS4780 Cryptography and Information Security
Cryptography.
Part 1 By Dr. Shadi Masadeh
CSCI-235 Micro-Computer Applications
Outline Some Basic Terminology Symmetric Encryption
Computer and Network Security
Conventional Encryption Message Confidentiality
“Classical Encryption Techniques”
Information Security IT423
Running Key Cipher The security of polyalphabetic substitution cipher reside in key length. In running-key cipher, the length of key must be equal the.
Presentation transcript:

Lecture 2 2012 Classical Encryption Techniques Dr. Nermin Hamza

Introduction Cryptography Cryptography is the science of writing in- secret code and is an ancient art . The first documented use of cryptography in writing dates back to circa 1900 B.C. by Egyptian.

Introduction (cont’d) Cryptography DAVID KAHN at 1976 said at “coder breaker” : Cryptology was born among the Arabs. They were the first to discover and write down the methods of cryptanalysis وقد نشر مجمع اللغة العربية ، بدمشق الجزء الأول من الكتاب ”علم التعمية و استخراج المعمى ”، سنة ١٩٨٧ ونشر الجزء الثاني سنة ١٩٩7 للدكتور : محمد مراياتي ويحيى ميرعلم و محمد حسان الطيان

Requirements two requirements for secure use of symmetric encryption: a strong encryption algorithm a secret key known only to sender / receiver mathematically have: Y = EK(X) X = DK(Y) assume encryption algorithm is known implies a secure channel to distribute key

Some Basic Terminology plaintext - original message ciphertext - coded message cipher-algorithm : for transforming plaintext to ciphertext key - info used in cipher known only to sender/receiver encipher (encrypt) - converting plaintext to ciphertext decipher (decrypt) - recovering ciphertext from plaintext

Encryption Diagram Encryption algorithm Decryption algorithm Plain Text Cipher Text Plain Text Key Key

Cryptography characterize cryptographic system by: number of keys used single-key or private / two-key or public type of encryption operations used substitution / transposition / product way in which plaintext is processed block / stream

Cryptography types: Symmetric cipher Asymmetric cipher

Also called Secret Key Cryptography (SKC): Symmetric cryptography : Also called Secret Key Cryptography (SKC): Uses a single key for both encryption and decryption Plain Text Plain Text Cipher Text

Also called Public Key Cryptography (PKC): Asymmetric Cryptography : Also called Public Key Cryptography (PKC): Uses one key for encryption and another for decryption Plain Text Cipher Text Plain Text

Symmetric Encryption or conventional / private-key / single-key sender and recipient share a common key all classical encryption algorithms are private-key was only type prior to invention of public- key in 1970’s and by far most widely used

Some Basic Terminology cryptography - study of encryption principles/methods cryptanalysis (codebreaking) - study of principles/ methods of deciphering ciphertext without knowing key cryptology - field of both cryptography and cryptanalysis

Cryptanalysis objective to recover key not just message general approaches: cryptanalytic attack rely on the nature of the algorithm plus perhaps some knowledge of the general characteristics of the plaintext or even some sample plaintext- ciphertext pairs. Brute-force attack try every possible key on a piece of cipher text until an intelligible translation into plaintext is obtained. Typically objective is to recover the key in use rather then simply to recover the plaintext of a single ciphertext. There are two general approaches: Cryptanalytic attacks rely on the nature of the algorithm plus perhaps some knowledge of the general characteristics of the plaintext or even some sample plaintext-ciphertext pairs. Brute-force attacks try every possible key on a piece of ciphertext until an intelligible translation into plaintext is obtained. On average,half of all possible keys must be tried to achieve success.

Cryptanalytic Attacks ciphertext only only knows algorithm & ciphertext known plaintext know/suspect plaintext & ciphertext chosen plaintext select plaintext and obtain ciphertext chosen ciphertext select ciphertext and obtain plaintext chosen text select plaintext or ciphertext to en/decrypt

Brute Force Search always possible to simply try every key most basic attack, proportional to key size assume either know / recognise plaintext Key Size (bits) Number of Alternative Keys Time required at 1 decryption/µs Time required at 106 decryptions/µs 32 232 = 4.3  109 231 µs = 35.8 minutes 2.15 milliseconds 56 256 = 7.2  1016 255 µs = 1142 years 10.01 hours 128 2128 = 3.4  1038 2127 µs = 5.4  1024 years 5.4  1018 years 168 2168 = 3.7  1050 2167 µs = 5.9  1036 years 5.9  1030 years 26 characters (permutation) 26! = 4  1026 2  1026 µs = 6.4  1012 years 6.4  106 years A brute-force attack involves trying every possible key until an intelligible translation of the ciphertext into plaintext is obtained. On average, half of all possible keys must be tried to achieve success. Stallings Table 2.2 shows how much time is required to conduct a brute-force attack, for various common key sizes (DES is 56, AES is 128, Triple-DES is 168, plus general mono-alphabetic cipher), where either a single system or a million parallel systems, are used.

The main two basic techniques Substitution Transposition

Substitution Ciphers

Classical 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 earliest known substitution cipher by Julius Caesar first attested use in military affairs replaces each letter by 3rd letter on example: M e e t m e a f t e r t h e t o g a p a r t y P H H W P H D I W H U W K H W R J D S D U W B

Caesar Cipher then have Caesar cipher as: c = E(p) = (p + k) mod (26) p = D(c) = (c – k) mod (26)

Caesar Cipher can define transformation as: 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 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 mathematically give each letter a number 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 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 then have Caesar cipher as: c = E(p) = (p + 3) mod (26) If p= a= 0 , E(a) = (0+3) mod 26 = 3 = D

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 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 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 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Caesar Example Let k= 10 Encrypt the following “Hello”

Caesar Example Let k= 10 Encrypt the following “Hello” H E L L O 7 4 11 11 14 17 14 21 21 24 -----------------------(MOD 26) 17 14 21 21 24 R O V V Y

Caesar Example Let k= 9 Encrypt the following “SUN”

Caesar Example Let k= 9 Encrypt the following “SUN” S U N 18 20 13 18 20 13 27 29 22 -----------------------(MOD 26) 1 3 22 B D W

Caesar Example Let the cipher text = “IFMMP” and k =1 What is the plain text? P= (C-1) mod 26 P = Hello

Cryptanalysis of Caesar Cipher only have 26 possible ciphers A maps to A,B,..Z could simply try each in turn a brute force search given ciphertext, just try all shifts of letters do need to recognize when have plaintext eg. break ciphertext "GCUA VQ DTGCM"

Example for fun G C U A V Q D T M W O P K X N B L Y H R Z I S J E F  

Monoalphabetic Cipher rather than just shifting the alphabet could shuffle (jumble) the letters arbitrarily each plaintext letter maps to a different random ciphertext letter hence key is 26 letters long Plain: abcdefghijklmnopqrstuvwxyz Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN Plaintext: ifwewishtoreplaceletters Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA 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, where the translation alphabet can be any permutation of the 26 alphabetic characters. See example translation alphabet, and an encrypted message using it.

Monoalphabetic Cipher Security Could be another equation : (a.i +b ) mod 26

Monoalphabetic Cipher Security now have a total of 26! = 4 x 1026 keys with so many keys, might think is secure but would be !!!WRONG!!! problem is language characteristics

Language Redundancy and Cryptanalysis human languages are redundant eg "th lrd s m shphrd shll nt wnt" letters are not equally commonly used in English E is by far the most common letter followed by T,R,N,I,O,A,S other letters like Z,J,K,Q,X are fairly rare have tables of single, double & triple letter frequencies for various languages

English Letter Frequencies Note that all human languages have varying letter frequencies, though the number of letters and their frequencies varies. Stallings Figure 2.5 shows English letter frequencies. Seberry & Pieprzyk, "Cryptography - An Introduction to Computer Security", Prentice-Hall 1989, Appendix A has letter frequency graphs for 20 languages (most European & Japanese & Malay).

Use in Cryptanalysis compare counts/plots against known values if caesar cipher look for common peaks/troughs peaks at: A-E-I triple, NO pair, RST triple troughs at: JK, X-Z for monoalphabetic must identify each letter tables of common double/triple letters help

Polyalphabetic Ciphers polyalphabetic substitution ciphers improve security using multiple cipher alphabets make 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

Vigenère Cipher simplest polyalphabetic substitution cipher effectively multiple caesar ciphers key is multiple letters long K = k1 k2 ... kd ith letter specifies ith alphabet to use use each alphabet in turn repeat from start after d letters in message decryption simply works in reverse The best known, and one of the simplest, such algorithms is referred to as the Vigenère cipher, where 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 plaintext letter ‘a’, and which are each used in turn, as shown next.

Steps of Vigenère Cipher 1- write the plaintext out 2- Write your keyword across the top of the text you want to encipher, repeating it as many times as necessary. 3- encrypt the corresponding plaintext letter 4- eg using keyword deceptive key: deceptivedeceptivedeceptive plaintext: wearediscoveredsaveyourself ciphertext:ZICVTWQNGRZGVTWAVZHCQYGLMG J Discuss this simple example from text Stallings section 2.2.

5- For each letter, look at the letter of the keyword above it ,and find that row in the Vigenere table. 6- Then find the column of your plaintext letter 7- Finally, trace down that column until you reach the row you found before and write down the letter in the cell where they intersect

Example D and W  Z key: d e c e p t ivedeceptivedeceptive plaintext: w e a r e d iscoveredsaveyourself ciphertext: Z I C V T W QNGRZGVTWAVZHCQYGLMGJ

Let key = MEC Plain text : We need more supplies fast

We need more supplies fast Let key = MEC Plain text : We need more supplies fast Keyword: M E C M E C M E C M E C M E C M E C M E C M Plaintext: w e n e e d m o r e s u p p l i e s f a s t

  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

We need more supplies fast Let key = MEC Plain text : We need more supplies fast Keyword: M E C M E C M E C M E C M E C M E C M E C M Plaintext: w e n e e d m o r e s u p p l i e s f a s t Ciphertext: I I P Q I F Y S T Q W W B T N U I U R E U F

Security of Vigenère Ciphers have multiple ciphertext letters for each plaintext letter hence letter frequencies are obscured but not totally lost

Play Fair The keyword written into five-by-five square , omitting repeated letters and combining I and J in one cell. Key: MANCHESTER

Example of play fair M A N C H E S T R B D F G I/J K L O P Q U V W X Y Z

Example of play fair matrix “playfair example" as the key

Example of play fair matrix “Monarchy” R A N O M D B Y H C K I/J G F E T S Q P L Z X W V U

Play Fair Break the message into two-letter group. If both letters are the same : insert X between them. If only one letter add X letter PLAIN: “THIS SECRET MESSAGE IS ENCRYPTED”

Steps IF The letters in the same row, replace them with the letters to their immediate right respectively Ex: AR => RM R A N O M D B Y H C K I/J G F E T S Q P L Z X W V U

Steps IF The letters in the same column take the below letters MU => CM R A N O M D B Y H C K I/J G F E T S Q P L Z X W V U

Steps If the two letters are located at opposite corner of the rectangle., is replaced by the letter that lies in its own row and the column occupied by the other plain text. HS=> BP R A N O M D B Y H C K I/J G F E T S Q P L Z X W V U

SOLVE Key is “playfair Example” Encrypt: “Hide the gold in the tree stump”

P L A Y F I R E X M B C D G H K N O Q S T U V W Z HI DE TH EG OL DI NT HE TR EX ES TU MP BM OD ZB XD NA BE KU DM UI XM MO UV IF

Play Fair And then : take 2 letter from the plain text two by two and locate the letter at opposite corner of the rectangle: TH BN M A N C H E S T R B D F G I/J K L O P Q U V W X Y Z M A N C H E S T R B D F G I/J K L O P Q U V W X Y Z

IF The letters in the same row, replace them with the letters to their immediate right respectively SE TS M A N C H E S T R B D F G I/J K L O P Q U V W X Y Z

IF The letters in the same column take the below letters CR RI D F G I/J K L O P Q U V W X Y Z

Solution Solve

One-Time Pad if a truly random key as long as the message is used, the cipher will be secure called a One-Time pad is unbreakable since ciphertext bears no statistical relationship to the plaintext since for any plaintext & any ciphertext there exists a key mapping one to other can only use the key once though problems in generation & safe distribution of key

Transposition Ciphers

Transposition Ciphers now consider 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 The simplest such cipher is the rail fence technique, in which the plaintext is written down as a sequence of diagonals and then read off as a sequence of rows. The example message is: "meet me after the toga party" with a rail fence of depth 2. This sort of thing would be trivial to cryptanalyze.

Reverse cipher Write the message backwards Ex: Plain: I came I saw I conq uered Cipher: d ereu q noci w asie maci