SlideShare une entreprise Scribd logo
1  sur  59
Network Security
Classical Encryption
Techniques
2
Outline
• Introduction
• Symmetric Cipher Model
• Substitution Techniques
• Transposition Techniques
• Rotor Machines
• Steganography
Classical encryption techniques
• As opposed to modern cryptography
• Goals:
– to introduce basic concepts & terminology of
encryption
– to prepare us for studying modern
cryptography
3
Basic terminology
• Plaintext: original message to be
encrypted
• Ciphertext: the encrypted message
• Enciphering or encryption: the process of
converting plaintext into ciphertext
• Encryption algorithm: performs encryption
– Two inputs: a plaintext and a secret key
4
• Deciphering or decryption: recovering
plaintext from ciphertext
• Decryption algorithm: performs decryption
– Two inputs: ciphertext and secret key
• Secret key: same key used for encryption
and decryption
– Also referred to as a symmetric key
5
Basic terminology
• Cipher or cryptographic system : a scheme
for encryption and decryption
• Cryptography: science of studying ciphers
• Cryptanalysis: science of studying attacks
against cryptographic systems
• Cryptology: cryptography + cryptanalysis
6
Basic terminology
Ciphers
• Symmetric cipher: same key used for
encryption and decryption
– Block cipher: encrypts a block of plaintext at a
time (typically 64 or 128 bits)
– Stream cipher: encrypts data one bit or one byte
at a time
• Asymmetric cipher: different keys used for
encryption and decryption
7
8
Symmetric Cipher ModelSymmetric Cipher Model
• A symmetric encryption scheme has five
ingredients:
– Plaintext
– Encryption algorithm
– Secret Key
– Ciphertext
– Decryption algorithm
• Security depends on the secrecy of the key, not
the secrecy of the algorithm
Symmetric Cipher Model
9
Symmetric Encryption
• or conventional / secret-key / single-key
• sender and recipient share a common key
• all classical encryption algorithms are
symmetric
• The only type of ciphers prior to the
invention of asymmetric-key ciphers in
1970’s
• by far most widely used
10
Symmetric Encryption
• Mathematically:
Y = EK(X) or Y = E(K, X)
X = DK(Y) or X = D(K, Y)
• X = plaintext
• Y = ciphertext
• K = secret key
• E = encryption algorithm
• D = decryption algorithm
• Both E and D are known to public
11
Symmetric Encryption
• two requirements for secure use of
symmetric encryption:
– a strong encryption algorithm
– a secret key known only to sender /
receiver
• assume encryption algorithm is known
• implies a secure channel to distribute
key
13
Model of ConventionalModel of Conventional
CryptosystemCryptosystem
Cryptography
• Cryptographic systems are characterized
along three independent dimensions:
– type of encryption operations used
• substitution
• Transposition
• product
– number of keys used
• single-key or private
• two-key or public
Cryptography
– way in which plaintext is processed
• block
• stream
Cryptanalysis
• Objective: to recover the plaintext of a ciphertext
or, more typically, to recover the secret key.
• Kerkhoff’s principle: the adversary knows all
details about a cryptosystem except the
secret key.
• Two general approaches:
– brute-force attack
– non-brute-force attack (cryptanalytic attack)
16
Brute-Force Attack
• Try every key to decipher the ciphertext.
• On average, need to try half of all possible keys
• Time needed proportional to size of key space
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
17
Cryptanalytic Attacks
Attack Type Knowledge Known to Cryptanalyst
Ciphertext only • Encryption algorithm
• Ciphertext to be decoded
Known Plaintext • Encryption algorithm
• Ciphertext to be decoded
• One or more plaintext-ciphertext pairs formed with the same
secret key
Chosen Plaintext • Encryption algorithm
• Ciphertext to be decoded
• Plaintext message chosen by cryptanalyst, together with its
corresponding ciphertext generated with the same secret key
Chosen Ciphertext • Encryption algorithm
• Ciphertext to be decoded
• Purported ciphertext chosen by cryptanalyst, together with
its corresponding decrypted plaintext generated with the
secret key
Chosen text • Encryption algorithm
• Ciphertext to be decoded
• Plaintext message chosen by cryptanalyst, together with its
corresponding ciphertext generated with the secret key
• Purported ciphertext chosen by cryptanalyst, together with
its corresponding decrypted plaintext generated with the
secret key
19
Cryptanalytic Attacks
• May be classified by how much
information needed by the attacker:
– Ciphertext-only attack
– Known-plaintext attack
– Chosen-plaintext attack
– Chosen-ciphertext attack
– Chosen text
20
Ciphertext-only attack
• Given: a ciphertext c
• Q: what is the plaintext m?
• An encryption scheme is completely
insecure if it cannot resist ciphertext-only
attacks.
21
Known-plaintext attack
• Given: (m1,c1), (m2,c2), …, (mk,ck) and a new
ciphertext c.
• Q: what is the plaintext of c?
• Q: what is the secret key in use?
22
Chosen-plaintext attack
• Given: (m1,c1), (m2,c2), …, (mk,ck), where
m1,m2, …, mk are chosen by the adversary;
and a new ciphertext c.
• Q: what is the plaintext of c, or what is the
secret key?
Computational Security
• An encryption scheme is computationally
secure if
– The cost of breaking the cipher exceeds the
value of information
– The time required to break the cipher exceeds
the lifetime of information
Unconditional Security
• No matter how much computer power or
time is available, the cipher cannot be
broken since the ciphertext provides
insufficient information to uniquely
determine the corresponding plaintext
• All the ciphers we have examined are not
unconditionally secure.
Classical Ciphers
• Plaintext is viewed as a sequence of
elements (e.g., bits or characters)
• Substitution cipher: replacing each element
of the plaintext with another element.
• Transposition (or permutation) cipher:
rearranging the order of the elements of the
plaintext.
• Product cipher: using multiple stages of
substitutions and transpositions
25
26
Substitution Techniques
• Caeser Cipher
• Monoalphabetic Ciphers
• Playfair Cipher
• Polyalphabetic Ciphers
• One-Time PAD
Caesar Cipher
• Earliest known substitution cipher
• Invented by Julius Caesar
• Each letter is replaced by the letter three
positions further down the alphabet.
• Plain: 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
Cipher: 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
• Example: ohio state  RKLR VWDWH
27
Caesar Cipher
• Mathematically, map letters to numbers:
a, b, c, ..., x, y, z
0, 1, 2, ..., 23, 24, 25
• Then the general Caesar cipher is:
c = EK(p) = (p + k) mod 26
p = DK(c) = (c – k) mod 26
• Can be generalized with any alphabet.
28
Cryptanalysis of Caesar Cipher
• Key space: {0, 1, ..., 25}
• Vulnerable to brute-force attacks.
• E.g., break ciphertext "UNOU YZGZK“
• Need to recognize it when have the
plaintext
29
Monoalphabetic Substitution Cipher
• Shuffle the letters and map each plaintext letter to a
different random ciphertext letter:
Plain letters: abcdefghijklmnopqrstuvwxyz
Cipher letters: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
• What does a key look like?
30
Monoalphabetic Cipher Security
• Now we have a total of 26! keys.
• With so many keys, it is secure against
brute-force attacks.
• But not secure against some cryptanalytic
attacks.
• Problem is language characteristics.
31
Language Statistics and Cryptanalysis
• Human languages are not random.
• Letters are not equally frequently 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.
• There are tables of single, double & triple letter
frequencies for various languages
32
English Letter Frequencies
33
Statistics for double & triple letters
• Double letters:
th he an in er re es on, …
• Triple letters:
the and ent ion tio for nde, …
34
Use in Cryptanalysis
• Key concept: monoalphabetic substitution does
not change relative letter frequencies
• To attack, we
– calculate letter frequencies for ciphertext
– compare this distribution against the known
one
35
Example Cryptanalysis
• Given ciphertext:
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
• Count relative letter frequencies (see next page)
• Guess {P, Z} = {e, t}
• Of double letters, ZW has highest frequency, so
guess ZW = th and hence ZWP = the
• Proceeding with trial and error finally get:
it was disclosed yesterday that several informal but
direct contacts have been made with political
representatives of the viet cong in moscow
36
Letter frequencies in ciphertext
P 13.33 H 5.83 F 3.33 B 1.67 C 0.00
Z 11.67 D 5.00 W 3.33 G 1.67 K 0.00
S 8.33 E 5.00 Q 2.50 Y 1.67 L 0.00
U 8.33 V 4.17 T 2.50 I 0.83 N 0.00
O 7.50 X 4.17 A 1.67 J 0.83 R 0.00
M 6.67
37
Playfair Cipher
• Not even the large number of keys in a
monoalphabetic cipher provides security.•
• One approach to improving security is to
encrypt multiple letters at a time.
• The Playfair Cipher is the best known
such cipher.
• Invented by Charles Wheatstone in 1854,
but named after his friend Baron Playfair.
38
Playfair Key Matrix
• Use a 5 x 5 matrix.
• Fill in letters of the key (w/o duplicates).
• Fill the rest of matrix with other letters.
• E.g., key = MONARCHY.
MM OO NN AA RR
CC HH YY BB DD
EE FF GG I/JI/J KK
LL PP QQ SS TT
UU VV WW XX ZZ
39
Encrypting and Decrypting
Plaintext is encrypted two letters at a time.
1. If a pair is a repeated letter, insert filler like 'X’.
2. If both letters fall in the same row, replace
each with the letter to its right (circularly).
3. If both letters fall in the same column, replace
each with the the letter below it (circularly).
4. Otherwise, each letter is replaced by the letter
in the same row but in the column of the other
letter of the pair.
40
Security of Playfair Cipher
• Equivalent to a monoalphabetic cipher with an
alphabet of 26 x 26 = 676 characters.
• Security is much improved over the simple
monoalphabetic cipher.
• Was widely used for many decades
– eg. by US & British military in WW1 and early WW2
• Once thought to be unbreakable.
• Actually, it can be broken, because it still leaves
some structure of plaintext intact.
41
Polyalphabetic Substitution Ciphers
• A sequence of monoalphabetic ciphers (M1, M2,
M3, ..., Mk) is used in turn to encrypt letters.
• A key determines which sequence of ciphers to
use.
• Each plaintext letter has multiple corresponding
ciphertext letters.
• This makes cryptanalysis harder since the letter
frequency distribution will be flatter.
42
Vigenère Cipher
• Simplest polyalphabetic substitution cipher
• Consider the set of all Caesar ciphers:
{ Ca, Cb, Cc, ..., Cz }
• Key: e.g. security
• Encrypt each letter using Cs, Ce, Cc, Cu,Cr,
Ci, Ct, Cy in turn.
• Repeat from start after Cy.
• Decryption simply works in reverse.
43
Example of Vigenère Cipher
• Keyword: deceptive
key: deceptivedeceptivedeceptive
plaintext: wearediscoveredsaveyourself
ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ
44
Security of Vigenère Ciphers
• There are multiple (how many?) ciphertext letters
corresponding to each plaintext letter.
• So, letter frequencies are obscured but not totally lost.
• To break Vigenere cipher:
1. Try to guess the key length. How?
2. If key length is N, the cipher consists of N Caesar
ciphers. Plaintext letters at positions k, N+k, 2N+k,
3N+k, etc., are encoded by the same cipher.
3. Attack each individual cipher as before.
45
Guessing the Key Length
• Main idea: Plaintext words separated by multiples
of the key length are encoded in the same way.
• In our example, if plaintext = “…thexxxxxxthe…”
then “the” will be encrypted to the same ciphertext
words.
• So look at the ciphertext for repeated patterns.
• E.g. repeated “VTW” in the previous example
suggests a key length of 3 or 9:
ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ
• Of course, the repetition could be a random fluke.
46
47
Transposition Ciphers
Transposition Ciphers
• Also called permutation ciphers.
• Shuffle the plaintext, without altering the
actual letters used.
• Example: Row Transposition Ciphers
48
Row Transposition Ciphers
• Plaintext is written row by row in a rectangle.
• Ciphertext: write out the columns in an order
specified by a key.
Key: 3 4 2 1 5 6 7
Plaintext:
Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ
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
49
Product Ciphers
• Uses a sequence of substitutions and
transpositions
– Harder to break than just substitutions or
transpositions
• This is a bridge from classical to modern ciphers.
50
51
Rotor Machines
Rotor Cipher Machines
• Before modern ciphers, rotor machines were most common
complex ciphers in use.
• Widely used in WW2.
• Used a series of rotating cylinders.
• Implemented a polyalphabetic substitution cipher of period K.
• With 3 cylinders, K = 263
=17,576.
• With 5 cylinders, K = 265
=12 x 106
.
• What is a key?
– If the adversary has a machine
– If the adversary doesn’t have a machine
52
53
The Rotors
54
Enigma Rotor Machine
55
Enigma Rotor Machine
56
Steganography
• Hide a message in another message.
• E.g., hide your plaintext in a graphic image
– Each pixel has 3 bytes specifying the RGB color
– The least significant bits of pixels can be
changed w/o greatly affecting the image quality
– So can hide messages in these LSBs
• Advantage: hiding existence of messages
• Drawback: high overhead
57
58
• Take a 640x480 (=30,7200) pixel image.
• Using only 1 LSB, can hide 115,200 characters
• Using 4 LSBs, can hide 460,800 characters.
Summary
• Have considered:
– classical cipher techniques and terminology
– monoalphabetic substitution ciphers
– cryptanalysis using letter frequencies
– Playfair cipher
– polyalphabetic ciphers
– transposition ciphers
– product ciphers and rotor machines
– stenography
59

Contenu connexe

Tendances

Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key CryptosystemDevakumar Kp
 
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere CipherCaesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere CipherMona Rajput
 
Security Mechanisms
Security MechanismsSecurity Mechanisms
Security Mechanismspriya_trehan
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniquesDr.Florence Dayana
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network securitypatisa
 
Network security & cryptography full notes
Network security & cryptography full notesNetwork security & cryptography full notes
Network security & cryptography full notesgangadhar9989166446
 
Network security - OSI Security Architecture
Network security - OSI Security ArchitectureNetwork security - OSI Security Architecture
Network security - OSI Security ArchitectureBharathiKrishna6
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSADr.Florence Dayana
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithmSunita Kharayat
 
Encryption And Decryption
Encryption And DecryptionEncryption And Decryption
Encryption And DecryptionNA
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 
Transposition cipher
Transposition cipherTransposition cipher
Transposition cipherAntony Alex
 
Advanced encryption standard (aes)
Advanced encryption standard (aes)Advanced encryption standard (aes)
Advanced encryption standard (aes)farazvirk554
 
AES-Advanced Encryption Standard
AES-Advanced Encryption StandardAES-Advanced Encryption Standard
AES-Advanced Encryption StandardPrince Rachit
 
Principles of public key cryptography and its Uses
Principles of  public key cryptography and its UsesPrinciples of  public key cryptography and its Uses
Principles of public key cryptography and its UsesMohsin Ali
 

Tendances (20)

Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key Cryptosystem
 
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere CipherCaesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher
 
Security Mechanisms
Security MechanismsSecurity Mechanisms
Security Mechanisms
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
S/MIME
S/MIMES/MIME
S/MIME
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
 
Network security & cryptography full notes
Network security & cryptography full notesNetwork security & cryptography full notes
Network security & cryptography full notes
 
Network security - OSI Security Architecture
Network security - OSI Security ArchitectureNetwork security - OSI Security Architecture
Network security - OSI Security Architecture
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithm
 
Encryption And Decryption
Encryption And DecryptionEncryption And Decryption
Encryption And Decryption
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITY
 
OSI Security Architecture
OSI Security ArchitectureOSI Security Architecture
OSI Security Architecture
 
Transposition cipher
Transposition cipherTransposition cipher
Transposition cipher
 
Key management
Key managementKey management
Key management
 
Advanced encryption standard (aes)
Advanced encryption standard (aes)Advanced encryption standard (aes)
Advanced encryption standard (aes)
 
Elliptic curve cryptography
Elliptic curve cryptographyElliptic curve cryptography
Elliptic curve cryptography
 
AES-Advanced Encryption Standard
AES-Advanced Encryption StandardAES-Advanced Encryption Standard
AES-Advanced Encryption Standard
 
Principles of public key cryptography and its Uses
Principles of  public key cryptography and its UsesPrinciples of  public key cryptography and its Uses
Principles of public key cryptography and its Uses
 

En vedette

Cipher techniques
Cipher techniquesCipher techniques
Cipher techniquesMohd Arif
 
Network Security 1st Lecture
Network Security 1st LectureNetwork Security 1st Lecture
Network Security 1st Lecturebabak danyal
 
Chapter 3: Block Ciphers and the Data Encryption Standard
Chapter 3: Block Ciphers and the Data Encryption StandardChapter 3: Block Ciphers and the Data Encryption Standard
Chapter 3: Block Ciphers and the Data Encryption StandardShafaan Khaliq Bhatti
 
Types of attacks and threads
Types of attacks and threadsTypes of attacks and threads
Types of attacks and threadssrivijaymanickam
 
02 introduction to network security
02 introduction to network security02 introduction to network security
02 introduction to network securityJoe McCarthy
 
Computer security threats & prevention
Computer security threats & preventionComputer security threats & prevention
Computer security threats & preventionPriSim
 
Network Security & Attacks
Network Security & AttacksNetwork Security & Attacks
Network Security & AttacksNetwax Lab
 
Different types of attacks in internet
Different types of attacks in internetDifferent types of attacks in internet
Different types of attacks in internetRohan Bharadwaj
 
Aes (advance encryption standard)
Aes (advance encryption standard) Aes (advance encryption standard)
Aes (advance encryption standard) Sina Manavi
 
Data Encryption Standard (DES)
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)Haris Ahmed
 

En vedette (16)

Chapter 01
Chapter 01Chapter 01
Chapter 01
 
Cipher techniques
Cipher techniquesCipher techniques
Cipher techniques
 
Network Security 1st Lecture
Network Security 1st LectureNetwork Security 1st Lecture
Network Security 1st Lecture
 
Classical Encryption Techniques
Classical Encryption TechniquesClassical Encryption Techniques
Classical Encryption Techniques
 
Chapter 3: Block Ciphers and the Data Encryption Standard
Chapter 3: Block Ciphers and the Data Encryption StandardChapter 3: Block Ciphers and the Data Encryption Standard
Chapter 3: Block Ciphers and the Data Encryption Standard
 
Types of attacks and threads
Types of attacks and threadsTypes of attacks and threads
Types of attacks and threads
 
02 introduction to network security
02 introduction to network security02 introduction to network security
02 introduction to network security
 
Computer security threats & prevention
Computer security threats & preventionComputer security threats & prevention
Computer security threats & prevention
 
Network Security & Attacks
Network Security & AttacksNetwork Security & Attacks
Network Security & Attacks
 
Network Attacks
Network AttacksNetwork Attacks
Network Attacks
 
Different types of attacks in internet
Different types of attacks in internetDifferent types of attacks in internet
Different types of attacks in internet
 
Computer Security Threats
Computer Security ThreatsComputer Security Threats
Computer Security Threats
 
Computer Security
Computer SecurityComputer Security
Computer Security
 
Aes (advance encryption standard)
Aes (advance encryption standard) Aes (advance encryption standard)
Aes (advance encryption standard)
 
Data Encryption Standard (DES)
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)
 
Network security
Network securityNetwork security
Network security
 

Similaire à Classical Encryption Techniques in Network Security

overview of cryptographic techniques
overview of cryptographic techniquesoverview of cryptographic techniques
overview of cryptographic techniquesShubham Jain
 
Symmetric Encryption Techniques
Symmetric Encryption Techniques Symmetric Encryption Techniques
Symmetric Encryption Techniques Dr. Kapil Gupta
 
Cipher techniques
Cipher techniquesCipher techniques
Cipher techniquessaqib1611
 
Cryptography and network security Nit701
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701Amit Pathak
 
Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & SteganographyAnimesh Shaw
 
Cryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptxCryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptxRobertCarreonBula
 
Elementary cryptography
Elementary cryptographyElementary cryptography
Elementary cryptographyG Prachi
 
EncryptionTechChap2.ppt
EncryptionTechChap2.pptEncryptionTechChap2.ppt
EncryptionTechChap2.pptrajirajesh8
 
Information security powerpoint presentation
Information security powerpoint presentationInformation security powerpoint presentation
Information security powerpoint presentationMuneebZahid10
 
Cryptography Introduction
Cryptography IntroductionCryptography Introduction
Cryptography Introductionindupps
 
Symmetric ciphermodel
Symmetric ciphermodelSymmetric ciphermodel
Symmetric ciphermodelpriyapavi96
 
Introduction to cryptography part2-final
Introduction to cryptography  part2-finalIntroduction to cryptography  part2-final
Introduction to cryptography part2-finalTaymoor Nazmy
 

Similaire à Classical Encryption Techniques in Network Security (20)

overview of cryptographic techniques
overview of cryptographic techniquesoverview of cryptographic techniques
overview of cryptographic techniques
 
Symmetric Encryption Techniques
Symmetric Encryption Techniques Symmetric Encryption Techniques
Symmetric Encryption Techniques
 
Cipher techniques
Cipher techniquesCipher techniques
Cipher techniques
 
Cryptography and network security Nit701
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701
 
Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & Steganography
 
Module-1.pptx
Module-1.pptxModule-1.pptx
Module-1.pptx
 
Cryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptxCryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptx
 
Elementary cryptography
Elementary cryptographyElementary cryptography
Elementary cryptography
 
EncryptionTechChap2.ppt
EncryptionTechChap2.pptEncryptionTechChap2.ppt
EncryptionTechChap2.ppt
 
Information security powerpoint presentation
Information security powerpoint presentationInformation security powerpoint presentation
Information security powerpoint presentation
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Ch02
Ch02Ch02
Ch02
 
Symmetric
SymmetricSymmetric
Symmetric
 
Cryptography Introduction
Cryptography IntroductionCryptography Introduction
Cryptography Introduction
 
Symmetric ciphermodel
Symmetric ciphermodelSymmetric ciphermodel
Symmetric ciphermodel
 
Introduction to cryptography part2-final
Introduction to cryptography  part2-finalIntroduction to cryptography  part2-final
Introduction to cryptography part2-final
 
ch02.ppt
ch02.pptch02.ppt
ch02.ppt
 
Unit 1
Unit 1Unit 1
Unit 1
 
Cryptography
CryptographyCryptography
Cryptography
 
cryptography.ppt
cryptography.pptcryptography.ppt
cryptography.ppt
 

Plus de babak danyal

Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Socketsbabak danyal
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streamsbabak danyal
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Javababak danyal
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the desbabak danyal
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network securitybabak danyal
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systemsbabak danyal
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systemsbabak danyal
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systemsbabak danyal
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systemsbabak danyal
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systemsbabak danyal
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systemsbabak danyal
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systemsbabak danyal
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systemsbabak danyal
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signababak danyal
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systemsbabak danyal
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniquesbabak danyal
 
Problems at independence
Problems at independenceProblems at independence
Problems at independencebabak danyal
 

Plus de babak danyal (20)

applist
applistapplist
applist
 
Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Sockets
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Java
 
Tcp sockets
Tcp socketsTcp sockets
Tcp sockets
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the des
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systems
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systems
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systems
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systems
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systems
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systems
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systems
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systems
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signa
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systems
 
Lecture9
Lecture9Lecture9
Lecture9
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
 
Problems at independence
Problems at independenceProblems at independence
Problems at independence
 

Dernier

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Dernier (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

Classical Encryption Techniques in Network Security

  • 2. 2 Outline • Introduction • Symmetric Cipher Model • Substitution Techniques • Transposition Techniques • Rotor Machines • Steganography
  • 3. Classical encryption techniques • As opposed to modern cryptography • Goals: – to introduce basic concepts & terminology of encryption – to prepare us for studying modern cryptography 3
  • 4. Basic terminology • Plaintext: original message to be encrypted • Ciphertext: the encrypted message • Enciphering or encryption: the process of converting plaintext into ciphertext • Encryption algorithm: performs encryption – Two inputs: a plaintext and a secret key 4
  • 5. • Deciphering or decryption: recovering plaintext from ciphertext • Decryption algorithm: performs decryption – Two inputs: ciphertext and secret key • Secret key: same key used for encryption and decryption – Also referred to as a symmetric key 5 Basic terminology
  • 6. • Cipher or cryptographic system : a scheme for encryption and decryption • Cryptography: science of studying ciphers • Cryptanalysis: science of studying attacks against cryptographic systems • Cryptology: cryptography + cryptanalysis 6 Basic terminology
  • 7. Ciphers • Symmetric cipher: same key used for encryption and decryption – Block cipher: encrypts a block of plaintext at a time (typically 64 or 128 bits) – Stream cipher: encrypts data one bit or one byte at a time • Asymmetric cipher: different keys used for encryption and decryption 7
  • 8. 8 Symmetric Cipher ModelSymmetric Cipher Model • A symmetric encryption scheme has five ingredients: – Plaintext – Encryption algorithm – Secret Key – Ciphertext – Decryption algorithm • Security depends on the secrecy of the key, not the secrecy of the algorithm
  • 10. Symmetric Encryption • or conventional / secret-key / single-key • sender and recipient share a common key • all classical encryption algorithms are symmetric • The only type of ciphers prior to the invention of asymmetric-key ciphers in 1970’s • by far most widely used 10
  • 11. Symmetric Encryption • Mathematically: Y = EK(X) or Y = E(K, X) X = DK(Y) or X = D(K, Y) • X = plaintext • Y = ciphertext • K = secret key • E = encryption algorithm • D = decryption algorithm • Both E and D are known to public 11
  • 12. Symmetric Encryption • two requirements for secure use of symmetric encryption: – a strong encryption algorithm – a secret key known only to sender / receiver • assume encryption algorithm is known • implies a secure channel to distribute key
  • 13. 13 Model of ConventionalModel of Conventional CryptosystemCryptosystem
  • 14. Cryptography • Cryptographic systems are characterized along three independent dimensions: – type of encryption operations used • substitution • Transposition • product – number of keys used • single-key or private • two-key or public
  • 15. Cryptography – way in which plaintext is processed • block • stream
  • 16. Cryptanalysis • Objective: to recover the plaintext of a ciphertext or, more typically, to recover the secret key. • Kerkhoff’s principle: the adversary knows all details about a cryptosystem except the secret key. • Two general approaches: – brute-force attack – non-brute-force attack (cryptanalytic attack) 16
  • 17. Brute-Force Attack • Try every key to decipher the ciphertext. • On average, need to try half of all possible keys • Time needed proportional to size of key space 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 17
  • 18. Cryptanalytic Attacks Attack Type Knowledge Known to Cryptanalyst Ciphertext only • Encryption algorithm • Ciphertext to be decoded Known Plaintext • Encryption algorithm • Ciphertext to be decoded • One or more plaintext-ciphertext pairs formed with the same secret key Chosen Plaintext • Encryption algorithm • Ciphertext to be decoded • Plaintext message chosen by cryptanalyst, together with its corresponding ciphertext generated with the same secret key Chosen Ciphertext • Encryption algorithm • Ciphertext to be decoded • Purported ciphertext chosen by cryptanalyst, together with its corresponding decrypted plaintext generated with the secret key Chosen text • Encryption algorithm • Ciphertext to be decoded • Plaintext message chosen by cryptanalyst, together with its corresponding ciphertext generated with the secret key • Purported ciphertext chosen by cryptanalyst, together with its corresponding decrypted plaintext generated with the secret key
  • 19. 19 Cryptanalytic Attacks • May be classified by how much information needed by the attacker: – Ciphertext-only attack – Known-plaintext attack – Chosen-plaintext attack – Chosen-ciphertext attack – Chosen text
  • 20. 20 Ciphertext-only attack • Given: a ciphertext c • Q: what is the plaintext m? • An encryption scheme is completely insecure if it cannot resist ciphertext-only attacks.
  • 21. 21 Known-plaintext attack • Given: (m1,c1), (m2,c2), …, (mk,ck) and a new ciphertext c. • Q: what is the plaintext of c? • Q: what is the secret key in use?
  • 22. 22 Chosen-plaintext attack • Given: (m1,c1), (m2,c2), …, (mk,ck), where m1,m2, …, mk are chosen by the adversary; and a new ciphertext c. • Q: what is the plaintext of c, or what is the secret key?
  • 23. Computational Security • An encryption scheme is computationally secure if – The cost of breaking the cipher exceeds the value of information – The time required to break the cipher exceeds the lifetime of information
  • 24. Unconditional Security • No matter how much computer power or time is available, the cipher cannot be broken since the ciphertext provides insufficient information to uniquely determine the corresponding plaintext • All the ciphers we have examined are not unconditionally secure.
  • 25. Classical Ciphers • Plaintext is viewed as a sequence of elements (e.g., bits or characters) • Substitution cipher: replacing each element of the plaintext with another element. • Transposition (or permutation) cipher: rearranging the order of the elements of the plaintext. • Product cipher: using multiple stages of substitutions and transpositions 25
  • 26. 26 Substitution Techniques • Caeser Cipher • Monoalphabetic Ciphers • Playfair Cipher • Polyalphabetic Ciphers • One-Time PAD
  • 27. Caesar Cipher • Earliest known substitution cipher • Invented by Julius Caesar • Each letter is replaced by the letter three positions further down the alphabet. • Plain: 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 Cipher: 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 • Example: ohio state  RKLR VWDWH 27
  • 28. Caesar Cipher • Mathematically, map letters to numbers: a, b, c, ..., x, y, z 0, 1, 2, ..., 23, 24, 25 • Then the general Caesar cipher is: c = EK(p) = (p + k) mod 26 p = DK(c) = (c – k) mod 26 • Can be generalized with any alphabet. 28
  • 29. Cryptanalysis of Caesar Cipher • Key space: {0, 1, ..., 25} • Vulnerable to brute-force attacks. • E.g., break ciphertext "UNOU YZGZK“ • Need to recognize it when have the plaintext 29
  • 30. Monoalphabetic Substitution Cipher • Shuffle the letters and map each plaintext letter to a different random ciphertext letter: Plain letters: abcdefghijklmnopqrstuvwxyz Cipher letters: DKVQFIBJWPESCXHTMYAUOLRGZN Plaintext: ifwewishtoreplaceletters Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA • What does a key look like? 30
  • 31. Monoalphabetic Cipher Security • Now we have a total of 26! keys. • With so many keys, it is secure against brute-force attacks. • But not secure against some cryptanalytic attacks. • Problem is language characteristics. 31
  • 32. Language Statistics and Cryptanalysis • Human languages are not random. • Letters are not equally frequently 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. • There are tables of single, double & triple letter frequencies for various languages 32
  • 34. Statistics for double & triple letters • Double letters: th he an in er re es on, … • Triple letters: the and ent ion tio for nde, … 34
  • 35. Use in Cryptanalysis • Key concept: monoalphabetic substitution does not change relative letter frequencies • To attack, we – calculate letter frequencies for ciphertext – compare this distribution against the known one 35
  • 36. Example Cryptanalysis • Given ciphertext: UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ • Count relative letter frequencies (see next page) • Guess {P, Z} = {e, t} • Of double letters, ZW has highest frequency, so guess ZW = th and hence ZWP = the • Proceeding with trial and error finally get: it was disclosed yesterday that several informal but direct contacts have been made with political representatives of the viet cong in moscow 36
  • 37. Letter frequencies in ciphertext P 13.33 H 5.83 F 3.33 B 1.67 C 0.00 Z 11.67 D 5.00 W 3.33 G 1.67 K 0.00 S 8.33 E 5.00 Q 2.50 Y 1.67 L 0.00 U 8.33 V 4.17 T 2.50 I 0.83 N 0.00 O 7.50 X 4.17 A 1.67 J 0.83 R 0.00 M 6.67 37
  • 38. Playfair Cipher • Not even the large number of keys in a monoalphabetic cipher provides security.• • One approach to improving security is to encrypt multiple letters at a time. • The Playfair Cipher is the best known such cipher. • Invented by Charles Wheatstone in 1854, but named after his friend Baron Playfair. 38
  • 39. Playfair Key Matrix • Use a 5 x 5 matrix. • Fill in letters of the key (w/o duplicates). • Fill the rest of matrix with other letters. • E.g., key = MONARCHY. MM OO NN AA RR CC HH YY BB DD EE FF GG I/JI/J KK LL PP QQ SS TT UU VV WW XX ZZ 39
  • 40. Encrypting and Decrypting Plaintext is encrypted two letters at a time. 1. If a pair is a repeated letter, insert filler like 'X’. 2. If both letters fall in the same row, replace each with the letter to its right (circularly). 3. If both letters fall in the same column, replace each with the the letter below it (circularly). 4. Otherwise, each letter is replaced by the letter in the same row but in the column of the other letter of the pair. 40
  • 41. Security of Playfair Cipher • Equivalent to a monoalphabetic cipher with an alphabet of 26 x 26 = 676 characters. • Security is much improved over the simple monoalphabetic cipher. • Was widely used for many decades – eg. by US & British military in WW1 and early WW2 • Once thought to be unbreakable. • Actually, it can be broken, because it still leaves some structure of plaintext intact. 41
  • 42. Polyalphabetic Substitution Ciphers • A sequence of monoalphabetic ciphers (M1, M2, M3, ..., Mk) is used in turn to encrypt letters. • A key determines which sequence of ciphers to use. • Each plaintext letter has multiple corresponding ciphertext letters. • This makes cryptanalysis harder since the letter frequency distribution will be flatter. 42
  • 43. Vigenère Cipher • Simplest polyalphabetic substitution cipher • Consider the set of all Caesar ciphers: { Ca, Cb, Cc, ..., Cz } • Key: e.g. security • Encrypt each letter using Cs, Ce, Cc, Cu,Cr, Ci, Ct, Cy in turn. • Repeat from start after Cy. • Decryption simply works in reverse. 43
  • 44. Example of Vigenère Cipher • Keyword: deceptive key: deceptivedeceptivedeceptive plaintext: wearediscoveredsaveyourself ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ 44
  • 45. Security of Vigenère Ciphers • There are multiple (how many?) ciphertext letters corresponding to each plaintext letter. • So, letter frequencies are obscured but not totally lost. • To break Vigenere cipher: 1. Try to guess the key length. How? 2. If key length is N, the cipher consists of N Caesar ciphers. Plaintext letters at positions k, N+k, 2N+k, 3N+k, etc., are encoded by the same cipher. 3. Attack each individual cipher as before. 45
  • 46. Guessing the Key Length • Main idea: Plaintext words separated by multiples of the key length are encoded in the same way. • In our example, if plaintext = “…thexxxxxxthe…” then “the” will be encrypted to the same ciphertext words. • So look at the ciphertext for repeated patterns. • E.g. repeated “VTW” in the previous example suggests a key length of 3 or 9: ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ • Of course, the repetition could be a random fluke. 46
  • 48. Transposition Ciphers • Also called permutation ciphers. • Shuffle the plaintext, without altering the actual letters used. • Example: Row Transposition Ciphers 48
  • 49. Row Transposition Ciphers • Plaintext is written row by row in a rectangle. • Ciphertext: write out the columns in an order specified by a key. Key: 3 4 2 1 5 6 7 Plaintext: Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ 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 49
  • 50. Product Ciphers • Uses a sequence of substitutions and transpositions – Harder to break than just substitutions or transpositions • This is a bridge from classical to modern ciphers. 50
  • 52. Rotor Cipher Machines • Before modern ciphers, rotor machines were most common complex ciphers in use. • Widely used in WW2. • Used a series of rotating cylinders. • Implemented a polyalphabetic substitution cipher of period K. • With 3 cylinders, K = 263 =17,576. • With 5 cylinders, K = 265 =12 x 106 . • What is a key? – If the adversary has a machine – If the adversary doesn’t have a machine 52
  • 53. 53
  • 57. Steganography • Hide a message in another message. • E.g., hide your plaintext in a graphic image – Each pixel has 3 bytes specifying the RGB color – The least significant bits of pixels can be changed w/o greatly affecting the image quality – So can hide messages in these LSBs • Advantage: hiding existence of messages • Drawback: high overhead 57
  • 58. 58 • Take a 640x480 (=30,7200) pixel image. • Using only 1 LSB, can hide 115,200 characters • Using 4 LSBs, can hide 460,800 characters.
  • 59. Summary • Have considered: – classical cipher techniques and terminology – monoalphabetic substitution ciphers – cryptanalysis using letter frequencies – Playfair cipher – polyalphabetic ciphers – transposition ciphers – product ciphers and rotor machines – stenography 59

Notes de l'éditeur

  1. There are two requirements for secure use of conventional encryption that mean we assume that it is impractical to decrypt a message on the basis of the cipher- text plus knowledge of the encryption/decryption algorithm, and hence do not need to keep the algorithm secret; rather we only need to keep the key secret. This feature of symmetric encryption is what makes it feasible for widespread use. It allows easy distribution of s/w and h/w implementations. Can take a closer look at the essential elements of a symmetric encryption scheme: mathematically it can be considered a pair of functions with: plaintext X, ciphertext Y, key K, encryption algorithm E, decryption algorithm D. The intended receiver, in possession of the key, is able to invert the transformation. An opponent, observing Y but not having access to K or X, may attempt to recover X or K.
  2. Cryptographic systems can be characterized along these three independent dimensions. The type of operations used for transforming plaintext to ciphertext . All encryption algorithms are based on two general principles: substitution, in which each element in the plaintext (bit, letter, group of bits or letters) is mapped into another element, and transposition, in which elements in the plaintext are rearranged. The fundamental requirement is that no information be lost (that is, that all operations are reversible). Most systems, referred to as product systems, involve multiple stages of substitutions and transpositions. The number of keys used . 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. 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.
  3. Cryptographic systems can be characterized along these three independent dimensions. The type of operations used for transforming plaintext to ciphertext . All encryption algorithms are based on two general principles: substitution, in which each element in the plaintext (bit, letter, group of bits or letters) is mapped into another element, and transposition, in which elements in the plaintext are rearranged. The fundamental requirement is that no information be lost (that is, that all operations are reversible). Most systems, referred to as product systems, involve multiple stages of substitutions and transpositions. The number of keys used . 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. 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.
  4. Stallings Table 2.1 summarizes the various types of cryptanalytic attacks, based on the amount of information known to the cryptanalyst, from least to most. The most difficult problem is presented when all that is available is the ciphertext only. In some cases, not even the encryption algorithm is known, but in general we can assume that the opponent does know the algorithm used for encryption. Then with increasing information have the other attacks. Generally, an encryption algorithm is designed to withstand a known-plaintext attack.