SlideShare a Scribd company logo
CS526 Topic 2: Classical Cryptography 1
Information Security
CS 526
Topic 2
Cryptography: Terminology & Classic
Ciphers
CS526 Topic 2: Classical Cryptography 2
Readings for This Lecture
Required readings:
– Cryptography on Wikipedia
Interesting reading
– The Code Book by Simon
Singh
CS526 Topic 2: Classical Cryptography 3
Goals of Cryptography
• The most fundamental problem cryptography
addresses: ensure security of communication
over insecure medium
• What does secure communication mean?
– confidentiality (secrecy)
• only the intended recipient can see the communication
– integrity (authenticity)
• the communication is generated by the alleged sender
• What does insecure medium mean?
– Two basic possibilities:
• Passive attacker: the adversary can eavesdrop
• Active attacker: the adversary has full control over the
communication channel
CS526 Topic 2: Classical Cryptography 4
Approaches to Secure Communication
• Steganography
– “covered writing”
– hides the existence of a message
– depends on secrecy of method
• Cryptography
– “hidden writing”
– hide the meaning of a message
– depends on secrecy of a short key, not method
CS526 Topic 2: Classical Cryptography 5
Basic Terminology for Encryption
• Plaintext original message
• Ciphertext transformed message
• Key secret used in transformation
• Encryption
• Decryption
• Cipher algorithm for encryption/decryption
CS526 Topic 2: Classical Cryptography 6
Shift Cipher
• The Key Space:
– [0 .. 25]
• Encryption given a key K:
– each letter in the plaintext P is
replaced with the K’th letter
following corresponding number
(shift right)
• Decryption given K:
– shift left
History: K = 3, Caesar’s cipher
CS526 Topic 2: Classical Cryptography 7
Shift Cipher: Cryptanalysis
• Can an attacker find K?
– YES: by a bruteforce attack through
exhaustive key search.
• key space is small (<= 26 possible keys).
– How much ciphertext is needed?
• Lessons:
– Key space needs to be large enough.
– Exhaustive key search can be effective.
CS526 Topic 2: Classical Cryptography 8
Mono-alphabetic Substitution Cipher
• The key space: all permutations of  = {A, B, C, …, Z}
• Encryption given a key :
– each letter X in the plaintext P is replaced with (X)
• Decryption given a key :
– each letter Y in the cipherext P is replaced with -1(Y)
Example:
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
= B A D C Z H W Y G O Q X S V T R N M L K J I P F E U
BECAUSE  AZDBJSZ
CS526 Topic 2: Classical Cryptography 9
Strength of the Mono-alphabetic
Substitution Cipher
• Exhaustive search is difficult
– key space size is 26!  4×1026  288
• Dominates the art of secret writing throughout
the first millennium A.D.
• Thought to be unbreakable by many back then
• How to break it?
CS526 Topic 2: Classical Cryptography 10
Cryptanalysis of Substitution Ciphers:
Frequency Analysis
• Basic ideas:
– Each language has certain features:
frequency of letters, or of groups of two or
more letters.
– Substitution ciphers preserve the language
features.
– Substitution ciphers are vulnerable to
frequency analysis attacks.
– How much ciphertext is required?
CS526 Topic 2: Classical Cryptography 11
Frequency of Letters in English
0
2
4
6
8
10
12
14
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
Series1
How to Defeat Frequency
Analysis?
• Use larger blocks as the basis of substitution.
Rather than substituting one letter at a time,
substitute 64 bits at a time, or 128 bits.
– Leads to block ciphers such as DES & AES.
• Use different substitutions to get rid of frequency
features.
– Leads to polyalphabetical substituion ciphers, and to
stream ciphers such as RC4
CS526 Topic 2: Classical Cryptography 12
CS526 Topic 2: Classical Cryptography 13
Towards the Polyalphabetic
Substitution Ciphers
• Main weaknesses of monoalphabetic substitution
ciphers
– In ciphertext, different letters have different frequency
• each letter in the ciphertext corresponds to only one
letter in the plaintext letter
• Idea for a stronger cipher (1460’s by Alberti)
– Use more than one substitutions, and switch between
them when encrypting different letters
• As result, frequencies of letters in ciphertext are similar
• Developed into an easy-to-use cipher by
Vigenère (published in 1586)
CS526 Topic 2: Classical Cryptography 14
The Vigenère Cipher
Treat letters as numbers: [A=0, B=1, C=2, …, Z=25]
Number Theory Notation: Zn= {0, 1, …, n-1}
Definition:
Given m, a positive integer, P = C = (Z26)n, and K =
(k1, k2, … , km) a key, we define:
Encryption:
ek(p1, p2… pm) = (p1+k1, p2+k2…pm+km) (mod 26)
Decryption:
dk(c1, c2… cm) = (c1-k1, c2-k2 … cm- km) (mod 26)
Example:
Plaintext: C R Y P T O G R A P H Y
Key: L U C K L U C K L U C K
Ciphertext: N L A Z E I I B L J J I
CS526 Topic 2: Classical Cryptography 15
Security of Vigenere Cipher
• Vigenere masks the frequency with which a
character appears in a language: one letter in
the ciphertext corresponds to multiple letters
in the plaintext. Makes the use of frequency
analysis more difficult.
• Any message encrypted
by a Vigenere cipher is a
collection of as many shift ciphers as there
are letters in the key.
CS526 Topic 2: Classical Cryptography 16
Vigenere Cipher: Cryptanalysis
• Find the length of the key.
– Kasisky test
– Index of coincidence (we
won’t cover here)
• Divide the message into
that many shift cipher
encryptions.
• Use frequency analysis to
solve the resulting shift
ciphers.
– How?
CS526 Topic 2: Classical Cryptography 17
Kasisky Test for Finding Key Length
• Observation: two identical segments of plaintext,
will be encrypted to the same ciphertext, if they
occur in the text at a distance  such that  is a
multiple of m, the key length.
• Algorithm:
– Search for pairs of identical
segments of length at least 3
– Record distances between
the two segments: 1, 2, …
– m divides gcd(1, 2, …)
CS526 Topic 2: Classical Cryptography 18
Example of the Kasisky Test
Key K I N G K I N G K I N G K I N G K I N G K I N G
PT t h e s u n a n d t h e m a n i n t h e m o o n
CT D P R Y E V N T N B U K W I A O X B U K W W B T
Repeating patterns (strings of length 3 or more) in ciphertext are
likely due to repeating plaintext strings encrypted under
repeating key strings; thus the location difference should be
multiples of key lengths.
CS526 Topic 3: One-time Pad and Perfect
Secrecy
19
One-Time Pad
• Fix the vulnerability of the Vigenere cipher by
using very long keys
• Key is a random string that is at least as long as
the plaintext
• Encryption is similar to shift cipher
• Invented by Vernam in the 1920s
CS526 Topic 3: One-time Pad and Perfect
Secrecy
20
One-Time Pad
Let Zm ={0,1,…,m-1} be
the alphabet.
Plaintext space = Ciphtertext space = Key space =
(Zm)n
The key is chosen uniformly randomly
Plaintext X = (x1 x2 … xn)
Key K = (k1 k2 … kn)
Ciphertext Y = (y1 y2 … yn)
ek(X) = (x1+k1 x2+k2 … xn+kn) mod m
dk(Y) = (y1-k1 y2-k2 … yn-kn) mod m
CS526 Topic 3: One-time Pad and Perfect
Secrecy
21
The Binary Version of One-Time Pad
Plaintext space = Ciphtertext space =
Keyspace = {0,1}n
Key is chosen randomly
For example:
• Plaintext is 11011011
• Key is 01101001
• Then ciphertext is 10110010
CS526 Topic 3: One-time Pad and Perfect
Secrecy
22
Bit Operators
• Bit AND
0  0 = 0 0  1 = 0 1  0 = 0 1  1 = 1
• Bit OR
0  0 = 0 0  1 = 1 1  0 = 1 1  1 = 1
• Addition mod 2 (also known as Bit XOR)
0  0 = 0 0  1 = 1 1  0 = 1 1  1 = 0
• Can we use operators other than Bit XOR for binary
version of One-Time Pad?
CS526 Topic 3: One-time Pad and Perfect
Secrecy
24
Key Randomness in One-Time Pad
• One-Time Pad uses a very long key, what if the
key is not chosen randomly, instead, texts from,
e.g., a book are used as keys.
– this is not One-Time Pad anymore
– this can be broken
– How?
• Corrolary: The key in One-Time Pad should
never be reused.
– If it is reused, it is Two-Time Pad, and is insecure!
– Why?
Usage of One-Time Pad
• To use one-time pad, one must have keys as long as the
messages.
• To send messages totaling certain size, sender and
receiver must agree on a shared secret key of that size.
– typically by sending the key over a secure channel
• Key agreement is difficult to do in practice.
• Can’t one use the channel for sending the key to send
the messages instead?
• Why is OTP still useful, even though difficult to use?
CS526 Topic 3: One-time Pad and Perfect
Secrecy
25
Usage of One-Time Pad
• The channel for distributing keys may exist at a
different time from when one has messages to
send.
• The channel for distributing keys may have the
property that keys can be leaked, but such
leakage will be detected
– Such as in Quantum cryptography
CS526 Topic 3: One-time Pad and Perfect
Secrecy
26
CS526 Topic 2: Classical Cryptography 27
Adversarial Models for Ciphers
• The language of the plaintext and the nature of the
cipher are assumed to be known to the adversary.
• Ciphertext-only attack: The adversary knows only a
number of ciphertexts.
• Known-plaintext attack: The adversary knows some
pairs of ciphertext and corresponding plaintext.
• Chosen-plaintext attack: The adversary can choose
a number of messages and obtain the ciphertexts
• Chosen-ciphertext attack: The adversary can
choose a number of ciphertexts and obtain the
plaintexts.
What kinds of attacks have we considered so far?
When would these attacks be relevant in wireless communications?
CS526 Topic 2: Classical Cryptography 28
The Open Design Security Principle
• Kerckhoffs's Principle:
– A cryptosystem should be secure even if everything
about the system, except the key, is public knowledge.
• Shannon's maxim:
– "The enemy knows the system."
• Security by obscurity doesn’t work
• Should assume that the adversary knows the
algorithm; the only secret the adversary is
assumed to not know is the key
• What is the difference between the algorithm and
the key?
CS526 Topic 2: Classical Cryptography 29
Coming Attractions …
• Cryptography: Informational
Theoretical Security, Stream
Ciphers

More Related Content

Similar to 15_526_topic02.ppt

Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & Steganography
Animesh Shaw
 
Introduction to cryptography part2-final
Introduction to cryptography  part2-finalIntroduction to cryptography  part2-final
Introduction to cryptography part2-final
Taymoor Nazmy
 
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
RobertCarreonBula
 
Elementary cryptography
Elementary cryptographyElementary cryptography
Elementary cryptography
G Prachi
 
Cryptography
CryptographyCryptography
Cryptography
subodh pawar
 
UNIT 2.ppt
UNIT 2.pptUNIT 2.ppt
UNIT 2.ppt
Manoj R. Kharde
 
Cryptography and network security Nit701
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701
Amit Pathak
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.ppt
Ghamdan5
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.ppt
akamkhalidmohammed
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.ppt
RaghavRathi40
 
detailed presentation on cryptography analysis
detailed presentation on cryptography analysisdetailed presentation on cryptography analysis
detailed presentation on cryptography analysis
BARATH800940
 
7-cryptography.pptfffffffffffffffffffffffffffffffffff
7-cryptography.pptfffffffffffffffffffffffffffffffffff7-cryptography.pptfffffffffffffffffffffffffffffffffff
7-cryptography.pptfffffffffffffffffffffffffffffffffff
maninthemirrorrror
 
Best book for the cryptography doctor.ppt
Best book for the cryptography doctor.pptBest book for the cryptography doctor.ppt
Best book for the cryptography doctor.ppt
nicolausalex722
 
RSA.ppt
RSA.pptRSA.ppt
the art of the fking dum crypto_basic.ppt
the art of the fking dum crypto_basic.pptthe art of the fking dum crypto_basic.ppt
the art of the fking dum crypto_basic.ppt
jamkhan10
 
This is the presentation ofcryptography.ppt
This is the presentation ofcryptography.pptThis is the presentation ofcryptography.ppt
This is the presentation ofcryptography.ppt
vimalguptaofficial
 
7 cryptography
7 cryptography7 cryptography
7 cryptography
Upinder Kaur
 
Crytography CertCourse Module 1 & 2.ppt
Crytography CertCourse Module 1 & 2.pptCrytography CertCourse Module 1 & 2.ppt
Crytography CertCourse Module 1 & 2.ppt
MuhammadShajid1
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
Dr.Florence Dayana
 
Classical Encryption Techniques.pdf
Classical Encryption Techniques.pdfClassical Encryption Techniques.pdf
Classical Encryption Techniques.pdf
DevangShukla10
 

Similar to 15_526_topic02.ppt (20)

Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & Steganography
 
Introduction to cryptography part2-final
Introduction to cryptography  part2-finalIntroduction to cryptography  part2-final
Introduction to cryptography part2-final
 
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
 
Cryptography
CryptographyCryptography
Cryptography
 
UNIT 2.ppt
UNIT 2.pptUNIT 2.ppt
UNIT 2.ppt
 
Cryptography and network security Nit701
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.ppt
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.ppt
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.ppt
 
detailed presentation on cryptography analysis
detailed presentation on cryptography analysisdetailed presentation on cryptography analysis
detailed presentation on cryptography analysis
 
7-cryptography.pptfffffffffffffffffffffffffffffffffff
7-cryptography.pptfffffffffffffffffffffffffffffffffff7-cryptography.pptfffffffffffffffffffffffffffffffffff
7-cryptography.pptfffffffffffffffffffffffffffffffffff
 
Best book for the cryptography doctor.ppt
Best book for the cryptography doctor.pptBest book for the cryptography doctor.ppt
Best book for the cryptography doctor.ppt
 
RSA.ppt
RSA.pptRSA.ppt
RSA.ppt
 
the art of the fking dum crypto_basic.ppt
the art of the fking dum crypto_basic.pptthe art of the fking dum crypto_basic.ppt
the art of the fking dum crypto_basic.ppt
 
This is the presentation ofcryptography.ppt
This is the presentation ofcryptography.pptThis is the presentation ofcryptography.ppt
This is the presentation ofcryptography.ppt
 
7 cryptography
7 cryptography7 cryptography
7 cryptography
 
Crytography CertCourse Module 1 & 2.ppt
Crytography CertCourse Module 1 & 2.pptCrytography CertCourse Module 1 & 2.ppt
Crytography CertCourse Module 1 & 2.ppt
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
Classical Encryption Techniques.pdf
Classical Encryption Techniques.pdfClassical Encryption Techniques.pdf
Classical Encryption Techniques.pdf
 

Recently uploaded

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 

Recently uploaded (20)

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 

15_526_topic02.ppt

  • 1. CS526 Topic 2: Classical Cryptography 1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers
  • 2. CS526 Topic 2: Classical Cryptography 2 Readings for This Lecture Required readings: – Cryptography on Wikipedia Interesting reading – The Code Book by Simon Singh
  • 3. CS526 Topic 2: Classical Cryptography 3 Goals of Cryptography • The most fundamental problem cryptography addresses: ensure security of communication over insecure medium • What does secure communication mean? – confidentiality (secrecy) • only the intended recipient can see the communication – integrity (authenticity) • the communication is generated by the alleged sender • What does insecure medium mean? – Two basic possibilities: • Passive attacker: the adversary can eavesdrop • Active attacker: the adversary has full control over the communication channel
  • 4. CS526 Topic 2: Classical Cryptography 4 Approaches to Secure Communication • Steganography – “covered writing” – hides the existence of a message – depends on secrecy of method • Cryptography – “hidden writing” – hide the meaning of a message – depends on secrecy of a short key, not method
  • 5. CS526 Topic 2: Classical Cryptography 5 Basic Terminology for Encryption • Plaintext original message • Ciphertext transformed message • Key secret used in transformation • Encryption • Decryption • Cipher algorithm for encryption/decryption
  • 6. CS526 Topic 2: Classical Cryptography 6 Shift Cipher • The Key Space: – [0 .. 25] • Encryption given a key K: – each letter in the plaintext P is replaced with the K’th letter following corresponding number (shift right) • Decryption given K: – shift left History: K = 3, Caesar’s cipher
  • 7. CS526 Topic 2: Classical Cryptography 7 Shift Cipher: Cryptanalysis • Can an attacker find K? – YES: by a bruteforce attack through exhaustive key search. • key space is small (<= 26 possible keys). – How much ciphertext is needed? • Lessons: – Key space needs to be large enough. – Exhaustive key search can be effective.
  • 8. CS526 Topic 2: Classical Cryptography 8 Mono-alphabetic Substitution Cipher • The key space: all permutations of  = {A, B, C, …, Z} • Encryption given a key : – each letter X in the plaintext P is replaced with (X) • Decryption given a key : – each letter Y in the cipherext P is replaced with -1(Y) Example: 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 = B A D C Z H W Y G O Q X S V T R N M L K J I P F E U BECAUSE  AZDBJSZ
  • 9. CS526 Topic 2: Classical Cryptography 9 Strength of the Mono-alphabetic Substitution Cipher • Exhaustive search is difficult – key space size is 26!  4×1026  288 • Dominates the art of secret writing throughout the first millennium A.D. • Thought to be unbreakable by many back then • How to break it?
  • 10. CS526 Topic 2: Classical Cryptography 10 Cryptanalysis of Substitution Ciphers: Frequency Analysis • Basic ideas: – Each language has certain features: frequency of letters, or of groups of two or more letters. – Substitution ciphers preserve the language features. – Substitution ciphers are vulnerable to frequency analysis attacks. – How much ciphertext is required?
  • 11. CS526 Topic 2: Classical Cryptography 11 Frequency of Letters in English 0 2 4 6 8 10 12 14 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 Series1
  • 12. How to Defeat Frequency Analysis? • Use larger blocks as the basis of substitution. Rather than substituting one letter at a time, substitute 64 bits at a time, or 128 bits. – Leads to block ciphers such as DES & AES. • Use different substitutions to get rid of frequency features. – Leads to polyalphabetical substituion ciphers, and to stream ciphers such as RC4 CS526 Topic 2: Classical Cryptography 12
  • 13. CS526 Topic 2: Classical Cryptography 13 Towards the Polyalphabetic Substitution Ciphers • Main weaknesses of monoalphabetic substitution ciphers – In ciphertext, different letters have different frequency • each letter in the ciphertext corresponds to only one letter in the plaintext letter • Idea for a stronger cipher (1460’s by Alberti) – Use more than one substitutions, and switch between them when encrypting different letters • As result, frequencies of letters in ciphertext are similar • Developed into an easy-to-use cipher by Vigenère (published in 1586)
  • 14. CS526 Topic 2: Classical Cryptography 14 The Vigenère Cipher Treat letters as numbers: [A=0, B=1, C=2, …, Z=25] Number Theory Notation: Zn= {0, 1, …, n-1} Definition: Given m, a positive integer, P = C = (Z26)n, and K = (k1, k2, … , km) a key, we define: Encryption: ek(p1, p2… pm) = (p1+k1, p2+k2…pm+km) (mod 26) Decryption: dk(c1, c2… cm) = (c1-k1, c2-k2 … cm- km) (mod 26) Example: Plaintext: C R Y P T O G R A P H Y Key: L U C K L U C K L U C K Ciphertext: N L A Z E I I B L J J I
  • 15. CS526 Topic 2: Classical Cryptography 15 Security of Vigenere Cipher • Vigenere masks the frequency with which a character appears in a language: one letter in the ciphertext corresponds to multiple letters in the plaintext. Makes the use of frequency analysis more difficult. • Any message encrypted by a Vigenere cipher is a collection of as many shift ciphers as there are letters in the key.
  • 16. CS526 Topic 2: Classical Cryptography 16 Vigenere Cipher: Cryptanalysis • Find the length of the key. – Kasisky test – Index of coincidence (we won’t cover here) • Divide the message into that many shift cipher encryptions. • Use frequency analysis to solve the resulting shift ciphers. – How?
  • 17. CS526 Topic 2: Classical Cryptography 17 Kasisky Test for Finding Key Length • Observation: two identical segments of plaintext, will be encrypted to the same ciphertext, if they occur in the text at a distance  such that  is a multiple of m, the key length. • Algorithm: – Search for pairs of identical segments of length at least 3 – Record distances between the two segments: 1, 2, … – m divides gcd(1, 2, …)
  • 18. CS526 Topic 2: Classical Cryptography 18 Example of the Kasisky Test Key K I N G K I N G K I N G K I N G K I N G K I N G PT t h e s u n a n d t h e m a n i n t h e m o o n CT D P R Y E V N T N B U K W I A O X B U K W W B T Repeating patterns (strings of length 3 or more) in ciphertext are likely due to repeating plaintext strings encrypted under repeating key strings; thus the location difference should be multiples of key lengths.
  • 19. CS526 Topic 3: One-time Pad and Perfect Secrecy 19 One-Time Pad • Fix the vulnerability of the Vigenere cipher by using very long keys • Key is a random string that is at least as long as the plaintext • Encryption is similar to shift cipher • Invented by Vernam in the 1920s
  • 20. CS526 Topic 3: One-time Pad and Perfect Secrecy 20 One-Time Pad Let Zm ={0,1,…,m-1} be the alphabet. Plaintext space = Ciphtertext space = Key space = (Zm)n The key is chosen uniformly randomly Plaintext X = (x1 x2 … xn) Key K = (k1 k2 … kn) Ciphertext Y = (y1 y2 … yn) ek(X) = (x1+k1 x2+k2 … xn+kn) mod m dk(Y) = (y1-k1 y2-k2 … yn-kn) mod m
  • 21. CS526 Topic 3: One-time Pad and Perfect Secrecy 21 The Binary Version of One-Time Pad Plaintext space = Ciphtertext space = Keyspace = {0,1}n Key is chosen randomly For example: • Plaintext is 11011011 • Key is 01101001 • Then ciphertext is 10110010
  • 22. CS526 Topic 3: One-time Pad and Perfect Secrecy 22 Bit Operators • Bit AND 0  0 = 0 0  1 = 0 1  0 = 0 1  1 = 1 • Bit OR 0  0 = 0 0  1 = 1 1  0 = 1 1  1 = 1 • Addition mod 2 (also known as Bit XOR) 0  0 = 0 0  1 = 1 1  0 = 1 1  1 = 0 • Can we use operators other than Bit XOR for binary version of One-Time Pad?
  • 23. CS526 Topic 3: One-time Pad and Perfect Secrecy 24 Key Randomness in One-Time Pad • One-Time Pad uses a very long key, what if the key is not chosen randomly, instead, texts from, e.g., a book are used as keys. – this is not One-Time Pad anymore – this can be broken – How? • Corrolary: The key in One-Time Pad should never be reused. – If it is reused, it is Two-Time Pad, and is insecure! – Why?
  • 24. Usage of One-Time Pad • To use one-time pad, one must have keys as long as the messages. • To send messages totaling certain size, sender and receiver must agree on a shared secret key of that size. – typically by sending the key over a secure channel • Key agreement is difficult to do in practice. • Can’t one use the channel for sending the key to send the messages instead? • Why is OTP still useful, even though difficult to use? CS526 Topic 3: One-time Pad and Perfect Secrecy 25
  • 25. Usage of One-Time Pad • The channel for distributing keys may exist at a different time from when one has messages to send. • The channel for distributing keys may have the property that keys can be leaked, but such leakage will be detected – Such as in Quantum cryptography CS526 Topic 3: One-time Pad and Perfect Secrecy 26
  • 26. CS526 Topic 2: Classical Cryptography 27 Adversarial Models for Ciphers • The language of the plaintext and the nature of the cipher are assumed to be known to the adversary. • Ciphertext-only attack: The adversary knows only a number of ciphertexts. • Known-plaintext attack: The adversary knows some pairs of ciphertext and corresponding plaintext. • Chosen-plaintext attack: The adversary can choose a number of messages and obtain the ciphertexts • Chosen-ciphertext attack: The adversary can choose a number of ciphertexts and obtain the plaintexts. What kinds of attacks have we considered so far? When would these attacks be relevant in wireless communications?
  • 27. CS526 Topic 2: Classical Cryptography 28 The Open Design Security Principle • Kerckhoffs's Principle: – A cryptosystem should be secure even if everything about the system, except the key, is public knowledge. • Shannon's maxim: – "The enemy knows the system." • Security by obscurity doesn’t work • Should assume that the adversary knows the algorithm; the only secret the adversary is assumed to not know is the key • What is the difference between the algorithm and the key?
  • 28. CS526 Topic 2: Classical Cryptography 29 Coming Attractions … • Cryptography: Informational Theoretical Security, Stream Ciphers