SlideShare uma empresa Scribd logo
1 de 26
Classical Encryption Techniques 1
BSIT-7th
Delivered by Inam ul Haq
Chapter 2 Cryptography and Network Security by William Stallings
Table of Contents
• 2 Main Types of Encryption
• Symmetric Encryption
• Basic Terminologies
• Symmetric Cipher Model
• Cryptography & Cryptanalysis
• Brute Force Search
• Ciphers [Caesar, Monoalphabetic, ]
2 Main Encryption Types
• Two main encryption types are
• Symmetric: the same key is used for
both encryption and decryption
• Asymmetric: different keys for
encryption and decryption, e.g. public-key
encryption such as RSA.
Symmetric Encryption
• Encryption and decryption keys are same
• Conventional / private-key / single-key
• Sender and recipient share a common key
• All classical encryption algorithms are private-
key
• First prior to invention of public-key in 1970’s
• Most widely used
Some Basic Terminology
• plaintext - original message
• ciphertext - coded message
• cipher - algorithm for transforming plaintext to ciphertext
• key - info used in cipher known only to sender/receiver
• encipher (encrypt) - converting plaintext to ciphertext
• decipher (decrypt) - recovering ciphertext from plaintext
• cryptography - study of encryption principles/methods
• cryptanalysis (codebreaking) - study of principles/ methods
of deciphering ciphertext without knowing key
• cryptology - field of both cryptography and cryptanalysis
Symmetric Cipher Model
Requirements
• Two requirements for secure use of
symmetric encryption:
– a strong encryption algorithm
– a secret key known only to sender / receiver
• mathematically:
Y = E(K, X)
X = D(K, Y)
• Assume encryption algorithm is known
• Implies a secure channel to distribute key
Cryptography
• Can characterize cryptographic system by:
– type of encryption operations used
• substitution
• transposition
• product
– number of keys used
• single-key or private
• two-key or public
– way in which plaintext is processed
• block
• stream
Cryptanalysis
• Objective to recover key not just message
• General approaches:
– cryptanalytic attack
– brute-force attack
• if either succeed all keys are compromised
Types of Attacks on Encrypted Messages
 ciphertext only
only know algorithm & ciphertext, is statistical, know or
can identify plaintext
 known plaintext
know/suspect plaintext & ciphertext
 chosen plaintext
select plaintext and obtain ciphertext
 chosen ciphertext
select ciphertext and obtain plaintext
 chosen text
select plaintext or ciphertext to en/decrypt
More Definitions
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
Computational security
given limited computing resources (eg time
needed for calculations is greater than age of
universe), the cipher cannot be broken
Brute Force Search
• Try every possible character (from dictionary)
• most basic attack, proportional to key size
• assume either know / recognise plaintext
4-Digits PIN < 1s
Upper+Lower+Number+Symbol <25s
6 characters 11hrs
7 characters 6 weeks
8 characters 5 months
9 characters 10 years
1-Caesar Cipher
• Earliest known substitution cipher
• By Julius Caesar
• First attested use in military affairs
• Replaces each letter by 3rd letter on
• example:
1-Caesar Cipher
1-Monoalphabetic substitution
– One table describes all substitutions
– Jump x step in the alphabet where 0 ≥ x ≥ 26
– If x = 3 then the table below could be used for
encryption and decryption
– ROT 13 another Caesar cipher
Cryptanalysis of Caesar Cipher
only have 26 possible ciphers
A maps to A,B,..Z
could simply try each in turn
a brute force search
given ciphertext, just try all shifts of letters
do need to recognize when have plaintext
eg. break ciphertext "GCUA VQ DTGCM"
1-Caesar Cipher
• 1-Monoalphabetic Cipher Security
• now have a total of 26! = 4 x 1026
keys
• with so many keys, might think is secure
• but would be !!!WRONG!!!
• problem is language characteristics
Language Redundancy and
Cryptanalysis
 human languages are redundant
 eg "th lrd s m shphrd shll nt wnt"
 letters are not equally commonly used
 in English E is by far the most common letter
followed by T, A, O, I
 other letters like Z,J,Q,X are fairly rare
 have tables of single, double & triple letter
frequencies for various languages
English Letter Frequencies
2-Polyalphabetic Cipher
• Also substitution cipher
• Vigenère cipher is probably the best-known example
• Polyalphabetic cipher that uses a tableau of 26 alphabets
! Invented by  Blaise de Vigenère in the 16th century
• Encrypting a plaintext character:
! Lookup the column that corresponds to the current character in 
the key
! Use the row that begins with the current plaintext character 
! Replace the plaintext character with the one highlighted by the 
current column and row
! To decrypt, just reverse the procedure 
2-Polyalphabetic Cipher (Vigenère cipher)
2-Polyalphabetic Cipher (Vigenère cipher)
• ! Key phrase = ”Boldtbol dtb oldtboldt” 
! Plaintext = ”Overhead the albatross” 
! Ciphertext = ”Pjpuafoo waf owetufzvl” 
! So, which keyword was used? 
3-Playfair Cipher
not even the large number of keys in a
monoalphabetic cipher provides security
one approach to improving security was to
encrypt multiple letters
the Playfair Cipher is an example
invented by Charles Wheatstone in 1854, but
named after his friend Baron Playfair
Playfair Key Matrix
a 5X5 matrix of letters based on a keyword
fill in letters of keyword (filter duplicates)
fill rest of matrix with other letters
eg. using the keyword 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
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 letter to right (wrapping back to start from
end)
3. if both letters fall in the same column, replace
each with the letter below it (wrapping to top
from bottom)
4. otherwise each letter is replaced by the letter in
the same row and in the column of the other letter
of the pair
Security of Playfair Cipher
 Security much improved over monoalphabetic
 Better than Vigenere cipher
 Widely used for many years
eg. by US & British military in WW1
 How to decipher?
 Since still has much of plaintext structure
Exercise
– Can you make your cipher?
– How to decipher Playfair?
– How many times Caesar Cipher has been broken?

Mais conteúdo relacionado

Mais procurados

Cipher techniques
Cipher techniquesCipher techniques
Cipher techniques
Mohd Arif
 

Mais procurados (20)

Kerberos
KerberosKerberos
Kerberos
 
Message authentication
Message authenticationMessage authentication
Message authentication
 
Symmetric and asymmetric key
Symmetric and asymmetric keySymmetric and asymmetric key
Symmetric and asymmetric key
 
Security services and mechanisms
Security services and mechanismsSecurity services and mechanisms
Security services and mechanisms
 
Transposition Cipher
Transposition CipherTransposition Cipher
Transposition Cipher
 
Cipher techniques
Cipher techniquesCipher techniques
Cipher techniques
 
Transport Layer Security (TLS)
Transport Layer Security (TLS)Transport Layer Security (TLS)
Transport Layer Security (TLS)
 
Network security & cryptography full notes
Network security & cryptography full notesNetwork security & cryptography full notes
Network security & cryptography full notes
 
Cryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipherCryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipher
 
X.509 Certificates
X.509 CertificatesX.509 Certificates
X.509 Certificates
 
IP Security
IP SecurityIP Security
IP Security
 
Pgp pretty good privacy
Pgp pretty good privacyPgp pretty good privacy
Pgp pretty good privacy
 
MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication Codes
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Data Encryption Standard (DES)
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)
 
Cryptography
CryptographyCryptography
Cryptography
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation
 
Cryptography and applications
Cryptography and applicationsCryptography and applications
Cryptography and applications
 
Chapter 1 Introduction of Cryptography and Network security
Chapter 1 Introduction of Cryptography and Network security Chapter 1 Introduction of Cryptography and Network security
Chapter 1 Introduction of Cryptography and Network security
 

Destaque

02 introduction to network security
02 introduction to network security02 introduction to network security
02 introduction to network security
Joe McCarthy
 
Aes (advance encryption standard)
Aes (advance encryption standard) Aes (advance encryption standard)
Aes (advance encryption standard)
Sina Manavi
 

Destaque (15)

Types of attacks and threads
Types of attacks and threadsTypes of attacks and threads
Types of attacks and threads
 
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
 
OSI Security Architecture
OSI Security ArchitectureOSI Security Architecture
OSI Security Architecture
 
Network Security 1st Lecture
Network Security 1st LectureNetwork Security 1st Lecture
Network Security 1st Lecture
 
02 introduction to network security
02 introduction to network security02 introduction to network security
02 introduction to network security
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
 
Computer security threats & prevention
Computer security threats & preventionComputer security threats & prevention
Computer security threats & prevention
 
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
 
Network Security & Attacks
Network Security & AttacksNetwork Security & Attacks
Network Security & Attacks
 
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)
 
AES-Advanced Encryption Standard
AES-Advanced Encryption StandardAES-Advanced Encryption Standard
AES-Advanced Encryption Standard
 
Network security
Network securityNetwork security
Network security
 

Semelhante a Classical Encryption Techniques

Information security powerpoint presentation
Information security powerpoint presentationInformation security powerpoint presentation
Information security powerpoint presentation
MuneebZahid10
 
detailed presentation on cryptography analysis
detailed presentation on cryptography analysisdetailed presentation on cryptography analysis
detailed presentation on cryptography analysis
BARATH800940
 

Semelhante a Classical Encryption Techniques (20)

Ch02
Ch02Ch02
Ch02
 
ch02.ppt
ch02.pptch02.ppt
ch02.ppt
 
Symmetric Encryption Techniques
Symmetric Encryption Techniques Symmetric Encryption Techniques
Symmetric Encryption Techniques
 
UNIT 2.ppt
UNIT 2.pptUNIT 2.ppt
UNIT 2.ppt
 
Cryptography and Network Security
Cryptography and Network SecurityCryptography and Network Security
Cryptography and Network Security
 
History of Cipher System
History of Cipher SystemHistory of Cipher System
History of Cipher System
 
Cipher techniques
Cipher techniquesCipher techniques
Cipher techniques
 
Elementary cryptography
Elementary cryptographyElementary cryptography
Elementary cryptography
 
Information security powerpoint presentation
Information security powerpoint presentationInformation security powerpoint presentation
Information security powerpoint presentation
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
 
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
 
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
 
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
 
detailed presentation on cryptography analysis
detailed presentation on cryptography analysisdetailed presentation on cryptography analysis
detailed presentation on cryptography analysis
 

Mais de university of education,Lahore

Mais de university of education,Lahore (20)

Activites and Time Planning
 Activites and Time Planning Activites and Time Planning
Activites and Time Planning
 
Steganography
SteganographySteganography
Steganography
 
Activites and Time Planning
Activites and Time PlanningActivites and Time Planning
Activites and Time Planning
 
Network Security Terminologies
Network Security TerminologiesNetwork Security Terminologies
Network Security Terminologies
 
Project Scheduling, Planning and Risk Management
Project Scheduling, Planning and Risk ManagementProject Scheduling, Planning and Risk Management
Project Scheduling, Planning and Risk Management
 
Software Testing and Debugging
Software Testing and DebuggingSoftware Testing and Debugging
Software Testing and Debugging
 
ePayment Methods
ePayment MethodsePayment Methods
ePayment Methods
 
SEO
SEOSEO
SEO
 
A Star Search
A Star SearchA Star Search
A Star Search
 
Enterprise Application Integration
Enterprise Application IntegrationEnterprise Application Integration
Enterprise Application Integration
 
Uml Diagrams
Uml DiagramsUml Diagrams
Uml Diagrams
 
eDras Max
eDras MaxeDras Max
eDras Max
 
RAD Model
RAD ModelRAD Model
RAD Model
 
Microsoft Project
Microsoft ProjectMicrosoft Project
Microsoft Project
 
Itertaive Process Development
Itertaive Process DevelopmentItertaive Process Development
Itertaive Process Development
 
Computer Aided Software Engineering Nayab Awan
Computer Aided Software Engineering Nayab AwanComputer Aided Software Engineering Nayab Awan
Computer Aided Software Engineering Nayab Awan
 
Lect 2 assessing the technology landscape
Lect 2 assessing the technology landscapeLect 2 assessing the technology landscape
Lect 2 assessing the technology landscape
 
system level requirements gathering and analysis
system level requirements gathering and analysissystem level requirements gathering and analysis
system level requirements gathering and analysis
 
Java Script
Java ScriptJava Script
Java Script
 
Group 10 flip flop and rs latch 1
Group 10 flip flop and rs latch 1Group 10 flip flop and rs latch 1
Group 10 flip flop and rs latch 1
 

Último

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 

Último (20)

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 

Classical Encryption Techniques

  • 1. Classical Encryption Techniques 1 BSIT-7th Delivered by Inam ul Haq Chapter 2 Cryptography and Network Security by William Stallings
  • 2. Table of Contents • 2 Main Types of Encryption • Symmetric Encryption • Basic Terminologies • Symmetric Cipher Model • Cryptography & Cryptanalysis • Brute Force Search • Ciphers [Caesar, Monoalphabetic, ]
  • 3. 2 Main Encryption Types • Two main encryption types are • Symmetric: the same key is used for both encryption and decryption • Asymmetric: different keys for encryption and decryption, e.g. public-key encryption such as RSA.
  • 4. Symmetric Encryption • Encryption and decryption keys are same • Conventional / private-key / single-key • Sender and recipient share a common key • All classical encryption algorithms are private- key • First prior to invention of public-key in 1970’s • Most widely used
  • 5. Some Basic Terminology • plaintext - original message • ciphertext - coded message • cipher - algorithm for transforming plaintext to ciphertext • key - info used in cipher known only to sender/receiver • encipher (encrypt) - converting plaintext to ciphertext • decipher (decrypt) - recovering ciphertext from plaintext • cryptography - study of encryption principles/methods • cryptanalysis (codebreaking) - study of principles/ methods of deciphering ciphertext without knowing key • cryptology - field of both cryptography and cryptanalysis
  • 7. Requirements • Two requirements for secure use of symmetric encryption: – a strong encryption algorithm – a secret key known only to sender / receiver • mathematically: Y = E(K, X) X = D(K, Y) • Assume encryption algorithm is known • Implies a secure channel to distribute key
  • 8. Cryptography • Can characterize cryptographic system by: – type of encryption operations used • substitution • transposition • product – number of keys used • single-key or private • two-key or public – way in which plaintext is processed • block • stream
  • 9. Cryptanalysis • Objective to recover key not just message • General approaches: – cryptanalytic attack – brute-force attack • if either succeed all keys are compromised
  • 10. Types of Attacks on Encrypted Messages  ciphertext only only know algorithm & ciphertext, is statistical, know or can identify plaintext  known plaintext know/suspect plaintext & ciphertext  chosen plaintext select plaintext and obtain ciphertext  chosen ciphertext select ciphertext and obtain plaintext  chosen text select plaintext or ciphertext to en/decrypt
  • 11. More Definitions 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 Computational security given limited computing resources (eg time needed for calculations is greater than age of universe), the cipher cannot be broken
  • 12. Brute Force Search • Try every possible character (from dictionary) • most basic attack, proportional to key size • assume either know / recognise plaintext 4-Digits PIN < 1s Upper+Lower+Number+Symbol <25s 6 characters 11hrs 7 characters 6 weeks 8 characters 5 months 9 characters 10 years
  • 13. 1-Caesar Cipher • Earliest known substitution cipher • By Julius Caesar • First attested use in military affairs • Replaces each letter by 3rd letter on • example:
  • 14. 1-Caesar Cipher 1-Monoalphabetic substitution – One table describes all substitutions – Jump x step in the alphabet where 0 ≥ x ≥ 26 – If x = 3 then the table below could be used for encryption and decryption – ROT 13 another Caesar cipher
  • 15. Cryptanalysis of Caesar Cipher only have 26 possible ciphers A maps to A,B,..Z could simply try each in turn a brute force search given ciphertext, just try all shifts of letters do need to recognize when have plaintext eg. break ciphertext "GCUA VQ DTGCM"
  • 16. 1-Caesar Cipher • 1-Monoalphabetic Cipher Security • now have a total of 26! = 4 x 1026 keys • with so many keys, might think is secure • but would be !!!WRONG!!! • problem is language characteristics
  • 17. Language Redundancy and Cryptanalysis  human languages are redundant  eg "th lrd s m shphrd shll nt wnt"  letters are not equally commonly used  in English E is by far the most common letter followed by T, A, O, I  other letters like Z,J,Q,X are fairly rare  have tables of single, double & triple letter frequencies for various languages
  • 19. 2-Polyalphabetic Cipher • Also substitution cipher • Vigenère cipher is probably the best-known example • Polyalphabetic cipher that uses a tableau of 26 alphabets ! Invented by  Blaise de Vigenère in the 16th century • Encrypting a plaintext character: ! Lookup the column that corresponds to the current character in  the key ! Use the row that begins with the current plaintext character  ! Replace the plaintext character with the one highlighted by the  current column and row ! To decrypt, just reverse the procedure 
  • 21. 2-Polyalphabetic Cipher (Vigenère cipher) • ! Key phrase = ”Boldtbol dtb oldtboldt”  ! Plaintext = ”Overhead the albatross”  ! Ciphertext = ”Pjpuafoo waf owetufzvl”  ! So, which keyword was used? 
  • 22. 3-Playfair Cipher not even the large number of keys in a monoalphabetic cipher provides security one approach to improving security was to encrypt multiple letters the Playfair Cipher is an example invented by Charles Wheatstone in 1854, but named after his friend Baron Playfair
  • 23. Playfair Key Matrix a 5X5 matrix of letters based on a keyword fill in letters of keyword (filter duplicates) fill rest of matrix with other letters eg. using the keyword 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
  • 24. 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 letter to right (wrapping back to start from end) 3. if both letters fall in the same column, replace each with the letter below it (wrapping to top from bottom) 4. otherwise each letter is replaced by the letter in the same row and in the column of the other letter of the pair
  • 25. Security of Playfair Cipher  Security much improved over monoalphabetic  Better than Vigenere cipher  Widely used for many years eg. by US & British military in WW1  How to decipher?  Since still has much of plaintext structure
  • 26. Exercise – Can you make your cipher? – How to decipher Playfair? – How many times Caesar Cipher has been broken?

Notas do Editor

  1. Lecture slides by Lawrie Brown for “Cryptography and Network Security”, 5/e, by William Stallings, Chapter 2 – “Classical Encryption Techniques”.
  2. Symmetric encryption, also referred to as conventional encryption or single-key encryption, was the only type of encryption in use prior to the development of public-key encryption in the 1970s. It remains by far the most widely used of the two types of encryption. All traditional schemes are symmetric / single key / private-key encryption algorithms, with a single key, used for both encryption and decryption. Since both sender and receiver are equivalent, either can encrypt or decrypt messages using that common key.
  3. Briefly review some terminology used throughout the course.
  4. Detail the five ingredients of the symmetric cipher model, shown in Stallings Figure 2.1: plaintext - original message encryption algorithm – performs substitutions/transformations on plaintext secret key – control exact substitutions/transformations used in encryption algorithm ciphertext - scrambled message decryption algorithm – inverse of encryption algorithm
  5. 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.
  6. 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.
  7. Typically objective is to recover the key in use rather then simply to recover the plaintext of a single ciphertext. There are two general approaches: Cryptanalysis: relies on the nature of the algorithm plus perhaps some knowledge of the general characteristics of the plaintext or even some sample plaintext- ciphertext pairs. This type of attack exploits the characteristics of the algorithm to attempt to deduce a specific plaintext or to deduce the key being used. Brute-force attacks try every possible key on a piece of ciphertext until an intelligible translation into plaintext is obtained. On average,half of all possible keys must be tried to achieve success. If either type of attack succeeds in deducing the key, the effect is catastrophic: All future and past messages encrypted with that key are compromised.
  8. 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.
  9. Two more definitions are worthy of note. An encryption scheme is unconditionally secure if the ciphertext generated by the scheme does not contain enough information to determine uniquely the corresponding plaintext, no matter how much ciphertext is available. An encryption scheme is said to be computationally secure if either the cost of breaking the cipher exceeds the value of the encrypted information, or the time required to break the cipher exceeds the useful lifetime of the information. Unconditional security would be nice, but the only known such cipher is the one-time pad (later). For all reasonable encryption algorithms, we have to assume computational security where it either takes too long, or is too expensive, to bother breaking the cipher.
  10. A brute-force attack involves trying every possible key until an intelligible translation of the ciphertext into plaintext is obtained. On average, half of all possible keys must be tried to achieve success. Stallings Table 2.2 shows how much time is required to conduct a brute-force attack, for various common key sizes (DES is 56, AES is 128, Triple-DES is 168, plus general mono-alphabetic cipher), where either a single system or a million parallel systems, are used.
  11. Substitution ciphers form the first of the fundamental building blocks. The core idea is to replace one basic unit (letter/byte) with another. Whilst the early Greeks described several substitution ciphers, the first attested use in military affairs of one was by Julius Caesar, described by him in Gallic Wars (cf. Kahn pp83-84). Still call any cipher using a simple letter shift a caesar cipher, not just those with shift 3.
  12. This mathematical description uses modulo (clock) arithmetic. Here, when you reach Z you go back to A and start again. Mod 26 implies that when you reach 26, you use 0 instead (ie the letter after Z, or 25 + 1 goes to A or 0). Example: howdy (7,14,22,3,24) encrypted using key f (ie a shift of 5) is MTBID
  13. With a caesar cipher, there are only 26 possible keys, of which only 25 are of any use, since mapping A to A etc doesn&amp;apos;t really obscure the message! Note this basic rule of cryptanalysis &amp;quot;check to ensure the cipher operator hasn&amp;apos;t goofed and sent a plaintext message by mistake&amp;quot;! Can try each of the keys (shifts) in turn, until can recognise the original message. See Stallings Fig 2.3 for example of search. Note: as mentioned before, do need to be able to recognise when have an original message (ie is it English or whatever). Usually easy for humans, hard for computers. Though if using say compressed data could be much harder. Example &amp;quot;GCUA VQ DTGCM&amp;quot; when broken gives &amp;quot;easy to break&amp;quot;, with a shift of 2 (key C).
  14. Note that even given the very large number of keys, being 10 orders of magnitude greater than the key space for DES, the monoalphabetic substitution cipher is not secure, because it does not sufficiently obscure the underlying language characteristics.
  15. As the example shows, we don&amp;apos;t actually need all the letters in order to understand written English text. Here vowels were removed, but they&amp;apos;re not the only redundancy. cf written Hebrew has no vowels for same reason. Are usually familiar with &amp;quot;party conversations&amp;quot;, can hear one person speaking out of hubbub of many, again because of redundancy in aural language also. This redundancy is also the reason we can compress text files, the computer can derive a more compact encoding without losing any information. Basic idea is to count the relative frequencies of letters, and note the resulting pattern.
  16. Note that all human languages have varying letter frequencies, though the number of letters and their frequencies varies. Stallings Figure 2.5 shows English letter frequencies. Seberry &amp; Pieprzyk, &amp;quot;Cryptography - An Introduction to Computer Security&amp;quot;, Prentice-Hall 1989, Appendix A has letter frequency graphs for 20 languages (most European &amp; Japanese &amp; Malay). Also useful are tables of common two-letter combinations, known as digrams, and three-letter combinations, known as trigrams.
  17. Consider ways to reduce the &amp;quot;spikyness&amp;quot; of natural language text, since if just map one letter always to another, the frequency distribution is just shuffled. One approach is to encrypt more than one letter at once. The Playfair cipher is an example of doing this, treats digrams in the plaintext as single units and translates these units into ciphertext digrams.
  18. The best-known multiple-letter encryption cipher is the Playfair, which treats digrams in the plaintext as single units and translates these units into ciphertext digrams. The Playfair algorithm is based on the use of a 5x5 matrix of letters constructed using a keyword. The rules for filling in this 5x5 matrix are: L to R, top to bottom, first with keyword after duplicate letters have been removed, and then with the remain letters, with I/J used as a single letter. This example comes from Dorothy Sayer&amp;apos;s book &amp;quot;Have His Carcase&amp;quot;, in which Lord Peter Wimsey solves it, and describes the use of a probably word attack.
  19. Plaintext is encrypted two letters at a time,according to the rules as shown. Note how you wrap from right side back to left, or from bottom back to top. if a pair is a repeated letter, insert a filler like &amp;apos;X&amp;apos;, eg. &amp;quot;balloon&amp;quot; encrypts as &amp;quot;ba lx lo on&amp;quot; if both letters fall in the same row, replace each with letter to right (wrapping back to start from end), eg. “ar&amp;quot; encrypts as &amp;quot;RM&amp;quot; if both letters fall in the same column, replace each with the letter below it (again wrapping to top from bottom), eg. “mu&amp;quot; encrypts to &amp;quot;CM&amp;quot; otherwise each letter is replaced by the one in its row in the column of the other letter of the pair, eg. “hs&amp;quot; encrypts to &amp;quot;BP&amp;quot;, and “ea&amp;quot; to &amp;quot;IM&amp;quot; or &amp;quot;JM&amp;quot; (as desired) Decrypting of course works exactly in reverse. Can see this by working the example pairs shown, backwards.
  20. The Playfair cipher is a great advance over simple monoalphabetic ciphers, since there are 26*26=676 digrams (vs 26 letters), so that identification of individual digrams is more difficult. Also,the relative frequencies of individual letters exhibit a much greater range than that of digrams, making frequency analysis much more difficult. The Playfair cipher was for a long time considered unbreakable. It was used as the standard field system by the British Army in World War I and still enjoyed considerable use by the U.S.Army and other Allied forces during World War II. Despite this level of confidence in its security, the Playfair cipher is relatively easy to break because it still leaves much of the structure of the plaintext language intact. A few hundred letters of ciphertext are generally sufficient.
  21. Chapter 2 summary.