Cryptography.

Slides:



Advertisements
Similar presentations
CLASSICAL ENCRYPTION TECHNIQUES
Advertisements

Classical Encryption Techniques Week 6-wend. One-Time Pad if a truly random key as long as the message is used, the cipher will be secure called a One-Time.
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.
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.
Hill Cipher Developed by the mathematician Lester Hill in The encryption algorithm takes m successive plain text and substitute for them m cipher.
Network Security (Course Details) By ASIM SHAHZAD Assistant Professor University Of Engineering And Technology Taxila.
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.
Network Security Lecture 12 Presented by: Dr. Munam Ali Shah.
 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.
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,
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.
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.
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
Cryptography and Network Security Chapter 1
Cryptography and Network Security Chapter 2
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
Cryptography and Network Security Chapter 2
“Classical Encryption Techniques”
Cryptographic Algorithms and Protocols
Information Security IT423
Cryptography and Network Security
Cryptography and Network Security
Presentation transcript:

Cryptography

Cryptography Secret (crypto) Writing (graphy) [Greek word] Practice and study of hiding information Concerned with developing algorithms for: Conceal the context of some message from all except the sender & recipient and/or Verify the correctness of a msg. to the recipient(authentication) Form basis of many technological solutions to computer & communications security problems

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 All traditional schemes are symmetric / single key / private-key encryption algorithms, with a single key, used for both encryption and decryption, since both sender and receiver are equivalent, either can encrypt or decrypt messages using that common key.

Basic Terminology plaintext - the original message ciphertext - the 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 cryptography - study of encryption principles/methods cryptanalysis (codebreaking) - the study of principles/ methods of deciphering ciphertext without knowing key cryptology - the field of both cryptography and cryptanalysis

Basic Encryption/Decryption

Symmetric Cipher Model Detail 5 ingredients of the symmetric cipher model: plaintext encryption algorithm – performs substitutions/transformations on plaintext secret key – control exact substitutions/transformations used in encryption algorithm ciphertext decryption algorithm – inverse of encryption algorithm

5 Basic Ingredients for Symmetric Encryption plaintext encryption algorithm – performs substitutions/transformations on plaintext secret key – output depend on specific key used; control exact substitutions/transformations used in encryption algorithm ciphertext decryption algorithm – inverse of encryption algorithm

Requirements two requirements for secure use of symmetric encryption: a strong encryption algorithm a secret key known only to sender / receiver C = EK(P) P = DK(C) assume encryption algorithm is known; keep key secret. implies a secure channel to distribute key Generally assume that the algorithm is known. This allows easy distribution of s/w and h/w implementations. Hence assume just keeping key secret is sufficient to secure encrypted messages. Have plaintext X, ciphertext Y, key K, encryption alg Ek, decryption alg Dk.

Symmetric algorithm encryption, decryption keys are the same

Notation denote plaintext P = <p1,p2, … , pm> denote ciphertext C = <c1,c2, … , cn> Key k of form k = <k1,k2, … , kj> Example: plaintext “Hello how are you” P = <H,E,L,L,O,H,O,W,A,R,E,Y,O,U> ciphertext “KHOOR KRHZ DUH BRX” C = < K,H,O,O,R,K,R,H,Z,D,U,H,B,R,X > More formally: C=Ek(P) P=Dk (C) P=Dk (Ek (P))

Cryptography Can be characterized on 3 independent dimensions: type of encryption operations used substitution / transposition / product number of keys used single-key or private / two-key or public way in which plaintext is processed block / stream

Cryptanalysis 2 approaches for attacking a conventional encryption scheme: Cryptanalysis Nature of algorithm Some knowledge of general characteristics of plaintext Or some sample plaintext - ciphertext pairs Deduce a specific plaintext or key Brute-force attack Try every possible key on a ciphertext On the average,half the keys must be tried for success

Types of Cryptanalytic Attacks ciphertext only only know algorithm / ciphertext, statistical, can identify plaintext known plaintext know/suspect plaintext & ciphertext to attack cipher chosen plaintext select plaintext and obtain ciphertext to attack cipher chosen ciphertext select ciphertext and obtain plaintext to attack cipher chosen text select either plaintext or ciphertext to en/decrypt to attack cipher

Brute Force Search always possible to simply try every key most basic attack, proportional to key size assume either know / recognise plaintext

Classical Substitution Ciphers where letters of plaintext are replaced by other letters or symbols by numbers or if plaintext is viewed as a sequence of bits, then substitution involves replacing plaintext bit patterns with ciphertext bit patterns Simple systems In this section and the next, we examine a sampling of what might be called classical encryption techniques. A study of these techniques enables us to illustrate the basic approaches to symmetric encryption used today and the types of cryptanalytic attacks that must be anticipated. The two basic building blocks of all encryption techniques: substitution and transposition. We examine these in the next two sections. Finally, we discuss a system that combine both substitution and transposition.

Caesar Cipher earliest known substitution cipher by Julius Caesar first attested use in military affairs replaces each letter by 3rd letter on example: meet me after the toga party PHHW PH DIWHU WKH WRJD SDUWB Substitution ciphers form the first of the fundamental building blocks. The core idea is to replace one basic unit (letter/byte) with another. Whilst the early Greeks described several substitution ciphers, the first attested use in military affairs of one was by Julius Caesar, described by him in Gallic Wars (cf. Kahn pp83-84). Still call any cipher using a simple letter shift a caesar cipher, not just those with shift 3. Note: when letters are involved, the following conventions are used in this course: Plaintext is always in lowercase; ciphertext is in uppercase; key values are in italicized lowercase.

Caesar Cipher Shift plaintext chars. three characters P: a b c d e f g h i j k l m C: D E F G H I J K L M N O P P: n o p q r s t u v w x y z C: Q R S T U V W X Y Z A B C meet me after the toga party PHHW PH DIWHU WKH WRJD SDUWB

Caesar Cipher mathematically give each letter a number a b c d e f g h i j k l m 0 1 2 3 4 5 6 7 8 9 10 11 12 n o p q r s t u v w x y Z 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) p = D(C) = (C – 3) mod (26) Shift cipher C = E(p) = (p + k) mod (26) p = D(C) = (C – k) mod (26) This mathematical description uses modulo arithmetic (ie clock arithmetic). Here, when you reach Z you go back to A and start again. Mod 26 implies that when you reach 26, you use 0 instead (ie the letter after Z, or 25 + 1 goes to A or 0). Example: howdy (7,14,22,3,24) encrypted using key f (5) is MTBID

k => 1 to 25 example: k=5 A: 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 C: F G H I J K L M N O P Q R S T U V W X Y Z A B C D E “summer vacation was too short” encrypts to XZRR JWAF HFYN TSBF XYTT XMTW Y

Problem

Breaking Shift Ciphers How difficult? How many possibilities?

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 3 characteristics: Encryption & decryption algorithms are known Only 25 keys to try Language of plaintext is known & easily recognizable With a caesar cipher, there are only 26 possible keys, of which only 25 are of any use, since mapping A to A etc doesn't really obscure the message! cf. basic rule of cryptanalysis "check to ensure the cipher operator hasn't goofed and sent a plaintext message by mistake"! Can try each of the keys (shifts) in turn, until can recognise the original message. See Stallings Fig 2.3 for example of search. Note: as mentioned before, do need to be able to recognise when have an original message (ie is it English or whatever). Usually easy for humans, hard for computers. Though if using say compressed data could be much harder. Example "GCUA VQ DTGCM" when broken gives "easy to break", with a shift of 2 (key C).

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

Monoalphabetic Cipher how many possible substitution alphabets? can we try all permutations? how would you try to break them?

Monoalphabetic – Brute force how many possible substitution alphabets? 26! ≈ 4 * 1026 possible keys can we try all permutations? sure. have some time? at 1 encryption/μsec 2* 1026 μsec = 6.4* 1012 years how would you try to break them? use what you know to reduce the possibilities

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

Language Redundancy and Cryptanalysis human languages are redundant letters are not equally commonly used Eg. in English e is by far the most common letter look at common letters (E, T, O, A, N, ...) single-letter words (I, and A) two-letter words (of, to, in, ...) three-letter words (the, and, ...) double letters (ll, ee, oo, tt, ff, rr, nn, ...) other tricks? As the example shows, we don't actually need all the letters in order to understand written English text. Here vowels were removed, but they're not the only redundancy. cf written Hebrew has no vowels for same reason. Are usually familiar with "party conversations", can hear one person speaking out of hubbub of many, again because of redundancy in aural language also. This redundancy is also the reason we can compress text files, the computer can derive a more compact encoding without losing any information. Basic idea is to count the relative frequencies of letters, and note the resulting pattern.

Language Redundancy and Cryptanalysis Basic idea is to count the relative frequencies of letters have tables of single, double & triple letter frequencies calculate letter frequencies for ciphertext compare counts/plots against known values

English Letter Frequencies This graph is based on counts done at ADFA in the late 1980's, and used to develop the tables published in Seberry & Pieprzyk [SEBE89]. Note that all human languages have varying letter frequencies, though the number of letters and their frequencies varies. Seberry & Pieprzyk [SEBE89] Appendix A has graphs for 20 languages (most European & Japanese & Malay).

Example Cryptanalysis given ciphertext: UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ count relative letter frequencies P Z S U O M 13.11 11.67 8.33 7.50 6.67 H D E V X 5.83 5.00 4.17 F W Q T A 3.33 2.50 1.67 B G Y I J 0.83 C K L N R 0.00

Example Cryptanalysis given ciphertext: UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ

Example Cryptanalysis guess P & Z are e and t Relatively high frequency letters S,U,O,M,H => { a,h,i,n,o,r,s } Letters with lowest frequency A,B,G,Y,I,J => { b,j,k,q,v,x,z } guess ZW is th hence ZWP is the ZWSZ if a complete word =>th_t So S equates with a

Example Cryptanalysis So far t a e e te a that e e a a t e t ta t ha e ee a e th t a e e e tat e the et proceeding with trial and error,we finally get: it was disclosed yesterday that several informal but direct contacts have been made with political representatives of the viet cong in moscow

Problem

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 One approach to reducing the "spikyness" of natural language text is used the Playfair cipher which encrypts more than one letter at once. We now consider the other alternative, using multiple cipher alphabets in turn. This gives the attacker more work, since many alphabets need to be guessed, and because the frequency distribution is more complex, since the same plaintext letter could be replaced by several ciphertext letters, depending on which alphabet is used.

Vigenère Cipher simplest polyalphabetic substitution cipher is the Vigenère Cipher multiple caesar ciphers Vigenère tableau Each of 26 ciphers arranged horizontally Key letter for each on its left Plaintext letters arranged on top row Ciphertext occurs in intersection of key letter in row x and plaintext in coloumn y decryption simply works in reverse Simply create a set of caesar cipher translation alphabets, then use each in turn, as shown next.

Modern Vigenère Tableau

Example write the plaintext out write the keyword repeated above it use each key letter as a caesar cipher key encrypt the corresponding plaintext letter eg using keyword deceptive key: deceptivedeceptivedeceptive plaintext: wearediscoveredsaveyourself ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ

Security of Vigenère Ciphers have multiple ciphertext letters for each plaintext letter hence letter frequencies are obscured but not totally lost start with letter frequencies see if monoalphabetic or not if not, then need to determine length of keyword

Autokey Cipher Ideally - a key as long as the message Vigenère proposed the autokey cipher keyword is prefixed to message as key eg. given key deceptive Key: deceptivewearediscoveredsav plaintext:wearediscoveredsaveyourself ciphertext:ZICVTWQNGKZEIIGASXSTSLVVWLA See that the key used is the keyword "DECEPTIVE" prefixed to as much of the message "WEAREDISCOVEREDSAV" as is needed. When deciphering, recover the first 9 letters using the keyword "DECEPTIVE". Then instead of repeating the keyword, start using the recovered letters from the message "WEAREDISC". As recover more letters, have more of key to recover later letters. Problem is that the same language characteristics are used by the key as the message. ie. a key of 'E' will be used more often than a 'T' etc hence an 'E' encrypted with a key of 'E' occurs with probability (0.1275)2 = 0.01663, about twice as often as a 'T' encrypted with a key of 'T' have to use a larger frequency table, but it exists given sufficient ciphertext this can be broken.

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 Transposition Ciphers form the second basic building block of ciphers. The core idea is to rearrange the order of basic units (letters/bytes/bits) without altering their actual values.

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 Example message is: "meet me after the toga party" with a rail fence of depth 2.

Problem Create Rail Fence DLTAOAHCNYEKTOTSPNR

Columnar Transposition Ciphers a more complex scheme write letters of message out in rows over a specified number of columns then reorder the columns(permute) according to some key before reading off column by column. 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

Double Transposition Key: 4 3 1 2 5 6 7 Plaintext: t t n a a p t m t s u o a o d w c o i x k n l y p e t z Ciphertext: NSCYAUOPTTWLTMDNAOIEPAXTTOKZ

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 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 with 3 cylinders have 263=17576 alphabets

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 in LSB in graphic image or sound file has drawbacks high overhead to hide relatively few info bits

Summary have considered: classical cipher techniques and terminology Caesar substitution ciphers monoalphabetic substitution ciphers cryptanalysis using letter frequencies polyalphabetic ciphers transposition ciphers product ciphers