CS8792 - Cryptography and
Network Security
vkp
Unit – I INTRODUCTION
• Security trends - Legal, Ethical and
Professional Aspects of Security, Need for
Security at Multiple levels, Security Policies -
Model of network security – Security attacks,
services and mechanisms – OSI security
architecture – Classical encryption techniques:
substitution techniques, transposition
techniques, steganography- Foundations of
modern cryptography: perfect security –
information theory – product cryptosystem –
Model for Network Security
Some Basic Terminology
• Plaintext - original message
• Ciphertext - coded message
• Cipher - algorithm for transforming plaintext to ciphertext
• Key - information 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
Data Transmission Steps
PT
PT
CT
CT
Encryption
Transmission
DecryptionX – Plain text
Y – Cipher text
K – Key
Y = Ek (X)
X = Dk (Y)
Cryptography
• 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
• Knowledge of algorithm and some part of plaintext
– Brute-force attack
• Try every possible key on cipher text to get a meaningful
plain text
3-1 INTRODUCTION
Figure 3.1 shows the general idea behind a symmetric-key
cipher. The original message from Alice to Bob is called
plaintext; the message that is sent through the channel is
called the ciphertext. To create the ciphertext from the
plaintext, Alice uses an encryption algorithm and a shared
secret key. To create the plaintext from ciphertext, Bob
uses a decryption algorithm and the same secret key.
3.1.1 Kerckhoff’s Principle
3.1.2 Cryptanalysis
3.1.3 Categories of Traditional Ciphers
Topics discussed in this section:
Figure 3.1 General idea of symmetric-key cipher
3.1 Continued
3.1 Continued
If P is the plaintext, C is the ciphertext, and K is the key,
We assume that Bob creates P1; we prove that P1 = P:
Figure 3.2 Locking and unlocking with the same key
3.1 Continued
3.1.1 Kerckhoff’s Principle
Based on Kerckhoff’s principle, one should always
assume that the adversary, Eve, knows the
encryption/decryption algorithm. The resistance of the
cipher to attack must be based only on the secrecy of the
key.
3.1.2 Cryptanalysis
As cryptography is the science and art of creating secret
codes, cryptanalysis is the science and art of breaking
those codes.
Figure 3.3 Cryptanalysis attacks
3.1.2 Continued
Figure 3.4 Ciphertext-only attack
Ciphertext-Only Attack
3.1.2 Continued
Figure 3.5 Known-plaintext attack
Known-Plaintext Attack
3.1.2 Continued
Figure 3.6 Chosen-plaintext attack
Chosen-Plaintext Attack
3.1.2 Continued
Figure 3.7 Chosen-ciphertext attack
Chosen-Ciphertext Attack
Classical Encryption
Techniques
1. Substitution Techniques
2. Transposition Techniques
Substitution Techniques
• Caesar cipher
• Monoalphabetic cipher
• Play fair cipher
• Hill cipher
• Polyalphabetic cipher
• One time pad
Classical Substitution Ciphers
• Letters of plaintext are replaced by other
letters or by numbers or symbols
• If plaintext is viewed as a sequence of bits,
then substitution involves replacing plaintext
bit patterns with cipher text bit patterns
3-2 SUBSTITUTION CIPHERS
A substitution cipher replaces one symbol with another.
Substitution ciphers can be categorized as either
monoalphabetic ciphers or polyalphabetic ciphers.
3.2.1 Monoalphabetic Ciphres
3.2.2 Polyalphabetic Ciphers
Topics discussed in this section:
A substitution cipher replaces one
symbol with another.
Note
3.2.1 Monoalphabetic Ciphers
In monoalphabetic substitution, the
relationship between a symbol in the
plaintext to a symbol in the ciphertext is
always one-to-one.
Note
3.2.1 Continued
The following shows a plaintext and its corresponding ciphertext.
The cipher is probably monoalphabetic because both l’s (els) are
encrypted as O’s.
Example 3.1
3.2.1 Continued
The simplest monoalphabetic cipher is the additive cipher. This
cipher is sometimes called a shift cipher and sometimes a Caesar
cipher, but the term additive cipher better reveals its
mathematical nature.
Additive Cipher
Figure 3.8 Plaintext and ciphertext in Z26
Figure 3.9 Additive cipher
3.2.1 Continued
When the cipher is additive, the
plaintext, ciphertext, and key are
integers in Z26.
Note
3.2.1 Continued
Use the additive cipher with key = 15 to encrypt the message
“hello”.
Example 3.3
We apply the encryption algorithm to the plaintext, character by
character:
Solution
3.2.1 Continued
Use the additive cipher with key = 15 to decrypt the message
“WTAAD”.
Example 3.4
We apply the decryption algorithm to the plaintext character by
character:
Solution
3.2.1 Continued
Historically, additive ciphers are called shift ciphers. Julius Caesar
used an additive cipher to communicate with his officers. For this
reason, additive ciphers are sometimes referred to as the Caesar
cipher. Caesar used a key of 3 for his communications.
Shift Cipher and Caesar Cipher
Additive ciphers are sometimes referred
to as shift ciphers or Caesar cipher.
Note
3.2.1 Continued
Eve has intercepted the ciphertext “UVACLYFZLJBYL”. Show
how she can use a brute-force attack to break the cipher.
Example 3.5
Eve tries keys from 1 to 7. With a key of 7, the plaintext is “not
very secure”, which makes sense.
Solution
3.2.1 Continued
Table 3.1 Frequency of characters in English
Table 3.2 Frequency of diagrams and trigrams
3.2.1 Continued
Multiplicative Ciphers
In a multiplicative cipher, the plaintext
and ciphertext are integers in Z26; the
key is an integer in Z26*.
Note
Figure 3.10 Multiplicative cipher
3.2.1 Continued
What is the key domain for any multiplicative cipher?
Example 3.7
The key needs to be in Z26*. This set has only 12 members: 1, 3, 5,
7, 9, 11, 15, 17, 19, 21, 23, 25.
Solution
We use a multiplicative cipher to encrypt the message “hello” with
a key of 7. The ciphertext is “XCZZU”.
Example 3.8
3.2.1 Continued
Affine Ciphers
Figure 3.11 Affine cipher
3.2.1 Continued
The affine cipher uses a pair of keys in which the first key is from
Z26* and the second is from Z26. The size of the key domain is
26 × 12 = 312.
Example 3.09
Use an affine cipher to encrypt the message “hello” with the key
pair (7, 2).
Example 3.10
3.2.1 Continued
Use the affine cipher to decrypt the message “ZEBBW” with the
key pair (7, 2) in modulus 26.
Example 3.11
Solution
The additive cipher is a special case of an affine cipher in which
k1 = 1. The multiplicative cipher is a special case of affine cipher in
which k2 = 0.
Example 3.12
3.2.1 Continued
Because additive, multiplicative, and affine ciphers have small key
domains, they are very vulnerable to brute-force attack.
Monoalphabetic Substitution Cipher
A better solution is to create a mapping between each plaintext
character and the corresponding ciphertext character. Alice and
Bob can agree on a table showing the mapping for each character.
Figure 3.12 An example key for monoalphabetic substitution cipher
3.2.1 Continued
We can use the key in Figure 3.12 to encrypt the message
Example 3.13
The ciphertext is
3.2.2 Polyalphabetic Ciphers
In polyalphabetic substitution, each occurrence of a
character may have a different substitute. The
relationship between a character in the plaintext to a
character in the ciphertext is one-to-many.
Autokey Cipher
3.2.2 Continued
Assume that Alice and Bob agreed to use an autokey cipher with
initial key value k1 = 12. Now Alice wants to send Bob the message
“Attack is today”. Enciphering is done character by character.
Example 3.14
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
• Playfair Cipher is an example
Playfair Key Matrix
• 5X5 matrix of letters based on a keyword
• Fill in letters of keyword (sans duplicates)
• Fill rest of matrix with other letters
• Eg. using the keyword MONARCHY
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 (again wrapping to top from
bottom)
4. Otherwise each letter is replaced by the letter in the
Playfair Key Matrix
• Eg. Using the keyword MONARCHY
• Encrypt: Ballon -> Ba lx lo nx
• Cipher: IB SU PM AW
M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
3.2.2 Continued
Playfair Cipher
Figure 3.13 An example of a secret key in the Playfair cipher
Let us encrypt the plaintext “hello” using the key in Figure 3.13.
Example 3.15
Security of Playfair Cipher
• Much improved over monoalphabetic
• Since have 26 x 26 = 676 digrams
• Would need a 676 entry frequency table to analyse
(verses 26 for a monoalphabetic)
• Correspondingly more ciphertext
• Was widely used for many years
– eg. by US & British military in WW1
• It can be broken, given a few hundred letters
Vigenère Cipher
• Simplest polyalphabetic substitution cipher
• Effectively multiple caesar ciphers
• Key is multiple letters long K = k1 k2 ... kd
• ith letter specifies ith alphabet to use
• Use each alphabet in turn
• Repeat from start after d letters in message
• Decryption simply works in reverse
3.2.2 Continued
Vigenere Cipher
We can encrypt the message “She is listening” using the 6-
character keyword “PASCAL”.
Example 3.16
3.2.2 Continued
Using Example 3.18, we can say that the additive cipher is a
special case of Vigenere cipher in which m = 1.
Example 3.18
Table 3.3
A Vigenere Tableau
CS8792 - Cryptography and Network Security
3.2.2 Continued
Hill Cipher
Figure 3.15 Key in the Hill cipher
The key matrix in the Hill cipher needs to
have a multiplicative inverse.
Note
CS8792 - Cryptography and Network Security
CS8792 - Cryptography and Network Security
CS8792 - Cryptography and Network Security
CS8792 - Cryptography and Network Security
CS8792 - Cryptography and Network Security
CS8792 - Cryptography and Network Security
3.2.2 Continued
One of the goals of cryptography is perfect secrecy. A
study by Shannon has shown that perfect secrecy can be
achieved if each plaintext symbol is encrypted with a key
randomly chosen from a key domain. This idea is used in
a cipher called one-time pad, invented by Vernam.
One-Time Pad
3.2.2 Continued
Rotor Cipher
Figure 3.19 A rotor cipher
3.2.2 Continued
Enigma Machine
Figure 3.20 A schematic of the Enigma machine
3-3 TRANSPOSITION CIPHERS
A transposition cipher does not substitute one symbol for
another, instead it changes the location of the symbols.
3.3.1 Keyless Transposition Ciphers
3.3.2 Keyed Transposition Ciphers
3.3.3 Combining Two Approaches
Topics discussed in this section:
A transposition cipher reorders symbols.
Note
3.3.1 Keyless Transposition Ciphers
Simple transposition ciphers, which were used in the
past, are keyless.
A good example of a keyless cipher using the first method is the
rail fence cipher. The ciphertext is created reading the pattern row
by row. For example, to send the message “Meet me at the park”
to Bob, Alice writes
Example 3.22
She then creates the ciphertext “MEMATEAKETETHPR”.
3.3.1 Continued
Alice and Bob can agree on the number of columns and use the
second method. Alice writes the same plaintext, row by row, in a
table of four columns.
Example 3.23
She then creates the ciphertext “MMTAEEHREAEKTTP”.
3.3.1 Continued
The cipher in Example 3.23 is actually a transposition cipher. The
following shows the permutation of each character in the plaintext
into the ciphertext based on the positions.
Example 3.24
The second character in the plaintext has moved to the fifth
position in the ciphertext; the third character has moved to the
ninth position; and so on. Although the characters are permuted,
there is a pattern in the permutation: (01, 05, 09, 13), (02, 06, 10,
13), (03, 07, 11, 15), and (08, 12). In each section, the difference
between the two adjacent numbers is 4.
3.3.2 Keyed Transposition Ciphers
The keyless ciphers permute the characters by using
writing plaintext in one way and reading it in another
way The permutation is done on the whole plaintext to
create the whole ciphertext. Another method is to divide
the plaintext into groups of predetermined size, called
blocks, and then use a key to permute the characters in
each block separately.
3.3.2 Continued
Alice needs to send the message “Enemy attacks tonight” to Bob..
Example 3.25
The key used for encryption and decryption is a permutation key,
which shows how the character are permuted.
The permutation yields
3.3.3 Combining Two Approaches
Example 3.26
Figure 3.21
Figure 3.22 Encryption/decryption keys in transpositional ciphers
3.3.3 Continued
Keys
In Example 3.27, a single key was used in two directions for the
column exchange: downward for encryption, upward for
decryption. It is customary to create two keys.
Figure 3.23 Key inversion in a transposition cipher
3.3.3 Continued
3.3.3 Continued
Using Matrices
We can use matrices to show the encryption/decryption process for
a transposition cipher.
Figure 3.24 Representation of the key as a matrix in the transposition cipher
Example 3.27
Figure 3.24 Representation of the key as a matrix in the transposition cipher
3.3.3 Continued
Figure 3.24 shows the encryption process. Multiplying the 4 × 5
plaintext matrix by the 5 × 5 encryption key gives the 4 × 5
ciphertext matrix.
Example 3.27
3.3.3 Continued
Double Transposition Ciphers
Figure 3.25 Double transposition cipher
CS8792 - Cryptography and Network Security

More Related Content

PPT
Fundamentals of cryptography
PPTX
Hash Function
PPTX
Substitution techniques
PDF
Asymmetric Cryptography
PDF
Chapter 1 Introduction of Cryptography and Network security
PDF
PPTX
Block Cipher and Operation Modes
PDF
symmetric key encryption algorithms
Fundamentals of cryptography
Hash Function
Substitution techniques
Asymmetric Cryptography
Chapter 1 Introduction of Cryptography and Network security
Block Cipher and Operation Modes
symmetric key encryption algorithms

What's hot (20)

PPTX
Detecting Fake News Through NLP
PPTX
Hash function
PPT
Classical Encryption Techniques in Network Security
PPTX
Data encryption
PPT
Email security
PPTX
RSA Algorithm
PPTX
Keymanagement of ipsec
PDF
Block Ciphers and the Data Encryption Standard
PPT
Message authentication
 
PPTX
SHA- Secure hashing algorithm
PPTX
Secure Hash Algorithm
PPT
Message Authentication Code & HMAC
PPT
Block Cipher and its Design Principles
PPTX
TCP IP Model | Computer Science
PPTX
Chapter_1.pptx
PPTX
Unit-3.pptx
PPTX
Image encryption and decryption
PPTX
PDF
2. Stream Ciphers
PPTX
MD5 ALGORITHM.pptx
Detecting Fake News Through NLP
Hash function
Classical Encryption Techniques in Network Security
Data encryption
Email security
RSA Algorithm
Keymanagement of ipsec
Block Ciphers and the Data Encryption Standard
Message authentication
 
SHA- Secure hashing algorithm
Secure Hash Algorithm
Message Authentication Code & HMAC
Block Cipher and its Design Principles
TCP IP Model | Computer Science
Chapter_1.pptx
Unit-3.pptx
Image encryption and decryption
2. Stream Ciphers
MD5 ALGORITHM.pptx
Ad

Similar to CS8792 - Cryptography and Network Security (20)

PDF
2 Unit 1. Traditional Symmetric Ciphers.pdf
PPT
ch_03 Traditional ciphering (1).ppt.xxxxxxxxx
PPTX
Traditional Symmetric Key method Cryptography.pptx
PPT
traditional cliphers 7-11-12.ppt
PPT
Chapter_02-1.ppt
PPT
ch-03.ppt
PDF
Network security
PPT
Traditional symmetric-key cipher
PDF
Computer Network Unit-5 (Part-1).pdf
DOCX
Cryptography
PPT
Ch02...1
PPTX
4.Cryptography handout 2.pptx
PPT
02 Information System Security
PPT
Crypt
PDF
Enhancing security of caesar cipher using different
PDF
Enhancing security of caesar cipher using different
PPT
classicalencryptiontechniques.ppt
PPT
unit 2.ppt
PPTX
forth lecture of the information retrieval and management partB_2025.pptx
PPT
Jaimin chp-8 - network security-new -use this - 2011 batch
2 Unit 1. Traditional Symmetric Ciphers.pdf
ch_03 Traditional ciphering (1).ppt.xxxxxxxxx
Traditional Symmetric Key method Cryptography.pptx
traditional cliphers 7-11-12.ppt
Chapter_02-1.ppt
ch-03.ppt
Network security
Traditional symmetric-key cipher
Computer Network Unit-5 (Part-1).pdf
Cryptography
Ch02...1
4.Cryptography handout 2.pptx
02 Information System Security
Crypt
Enhancing security of caesar cipher using different
Enhancing security of caesar cipher using different
classicalencryptiontechniques.ppt
unit 2.ppt
forth lecture of the information retrieval and management partB_2025.pptx
Jaimin chp-8 - network security-new -use this - 2011 batch
Ad

Recently uploaded (20)

PDF
ST MNCWANGO P2 WIL (MEPR302) FINAL REPORT.pdf
PDF
Principles of operation, construction, theory, advantages and disadvantages, ...
PDF
B461227.pdf American Journal of Multidisciplinary Research and Review
PPTX
SC Robotics Team Safety Training Presentation
PPTX
Wireless sensor networks (WSN) SRM unit 2
PDF
Engineering Solutions for Ethical Dilemmas in Healthcare (www.kiu.ac.ug)
PPTX
Research Writing, Mechanical Engineering
PDF
Artificial Intelligence_ Basics .Artificial Intelligence_ Basics .
PPT
Comprehensive Java Training Deck - Advanced topics
PDF
ECT443_instrumentation_Engg_mod-1.pdf indroduction to instrumentation
PPTX
Design ,Art Across Digital Realities and eXtended Reality
PDF
Software defined netwoks is useful to learn NFV and virtual Lans
PDF
Performance, energy consumption and costs: a comparative analysis of automati...
PPTX
Software-Development-Life-Cycle-SDLC.pptx
PDF
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
PDF
IAE-V2500 Engine for Airbus Family 319/320
PPTX
Solar energy pdf of gitam songa hemant k
DOCX
ENVIRONMENTAL PROTECTION AND MANAGEMENT (18CVL756)
PPTX
chapter 1.pptx dotnet technology introduction
PPT
Basics Of Pump types, Details, and working principles.
ST MNCWANGO P2 WIL (MEPR302) FINAL REPORT.pdf
Principles of operation, construction, theory, advantages and disadvantages, ...
B461227.pdf American Journal of Multidisciplinary Research and Review
SC Robotics Team Safety Training Presentation
Wireless sensor networks (WSN) SRM unit 2
Engineering Solutions for Ethical Dilemmas in Healthcare (www.kiu.ac.ug)
Research Writing, Mechanical Engineering
Artificial Intelligence_ Basics .Artificial Intelligence_ Basics .
Comprehensive Java Training Deck - Advanced topics
ECT443_instrumentation_Engg_mod-1.pdf indroduction to instrumentation
Design ,Art Across Digital Realities and eXtended Reality
Software defined netwoks is useful to learn NFV and virtual Lans
Performance, energy consumption and costs: a comparative analysis of automati...
Software-Development-Life-Cycle-SDLC.pptx
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
IAE-V2500 Engine for Airbus Family 319/320
Solar energy pdf of gitam songa hemant k
ENVIRONMENTAL PROTECTION AND MANAGEMENT (18CVL756)
chapter 1.pptx dotnet technology introduction
Basics Of Pump types, Details, and working principles.

CS8792 - Cryptography and Network Security

  • 1. CS8792 - Cryptography and Network Security vkp
  • 2. Unit – I INTRODUCTION • Security trends - Legal, Ethical and Professional Aspects of Security, Need for Security at Multiple levels, Security Policies - Model of network security – Security attacks, services and mechanisms – OSI security architecture – Classical encryption techniques: substitution techniques, transposition techniques, steganography- Foundations of modern cryptography: perfect security – information theory – product cryptosystem –
  • 3. Model for Network Security
  • 4. Some Basic Terminology • Plaintext - original message • Ciphertext - coded message • Cipher - algorithm for transforming plaintext to ciphertext • Key - information 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
  • 5. Data Transmission Steps PT PT CT CT Encryption Transmission DecryptionX – Plain text Y – Cipher text K – Key Y = Ek (X) X = Dk (Y)
  • 6. Cryptography • 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
  • 7. Cryptanalysis • Objective to recover key not just message • General approaches: – Cryptanalytic attack • Knowledge of algorithm and some part of plaintext – Brute-force attack • Try every possible key on cipher text to get a meaningful plain text
  • 8. 3-1 INTRODUCTION Figure 3.1 shows the general idea behind a symmetric-key cipher. The original message from Alice to Bob is called plaintext; the message that is sent through the channel is called the ciphertext. To create the ciphertext from the plaintext, Alice uses an encryption algorithm and a shared secret key. To create the plaintext from ciphertext, Bob uses a decryption algorithm and the same secret key. 3.1.1 Kerckhoff’s Principle 3.1.2 Cryptanalysis 3.1.3 Categories of Traditional Ciphers Topics discussed in this section:
  • 9. Figure 3.1 General idea of symmetric-key cipher 3.1 Continued
  • 10. 3.1 Continued If P is the plaintext, C is the ciphertext, and K is the key, We assume that Bob creates P1; we prove that P1 = P:
  • 11. Figure 3.2 Locking and unlocking with the same key 3.1 Continued
  • 12. 3.1.1 Kerckhoff’s Principle Based on Kerckhoff’s principle, one should always assume that the adversary, Eve, knows the encryption/decryption algorithm. The resistance of the cipher to attack must be based only on the secrecy of the key.
  • 13. 3.1.2 Cryptanalysis As cryptography is the science and art of creating secret codes, cryptanalysis is the science and art of breaking those codes. Figure 3.3 Cryptanalysis attacks
  • 14. 3.1.2 Continued Figure 3.4 Ciphertext-only attack Ciphertext-Only Attack
  • 15. 3.1.2 Continued Figure 3.5 Known-plaintext attack Known-Plaintext Attack
  • 16. 3.1.2 Continued Figure 3.6 Chosen-plaintext attack Chosen-Plaintext Attack
  • 17. 3.1.2 Continued Figure 3.7 Chosen-ciphertext attack Chosen-Ciphertext Attack
  • 18. Classical Encryption Techniques 1. Substitution Techniques 2. Transposition Techniques
  • 19. Substitution Techniques • Caesar cipher • Monoalphabetic cipher • Play fair cipher • Hill cipher • Polyalphabetic cipher • One time pad
  • 20. Classical Substitution Ciphers • Letters of plaintext are replaced by other letters or by numbers or symbols • If plaintext is viewed as a sequence of bits, then substitution involves replacing plaintext bit patterns with cipher text bit patterns
  • 21. 3-2 SUBSTITUTION CIPHERS A substitution cipher replaces one symbol with another. Substitution ciphers can be categorized as either monoalphabetic ciphers or polyalphabetic ciphers. 3.2.1 Monoalphabetic Ciphres 3.2.2 Polyalphabetic Ciphers Topics discussed in this section: A substitution cipher replaces one symbol with another. Note
  • 22. 3.2.1 Monoalphabetic Ciphers In monoalphabetic substitution, the relationship between a symbol in the plaintext to a symbol in the ciphertext is always one-to-one. Note
  • 23. 3.2.1 Continued The following shows a plaintext and its corresponding ciphertext. The cipher is probably monoalphabetic because both l’s (els) are encrypted as O’s. Example 3.1
  • 24. 3.2.1 Continued The simplest monoalphabetic cipher is the additive cipher. This cipher is sometimes called a shift cipher and sometimes a Caesar cipher, but the term additive cipher better reveals its mathematical nature. Additive Cipher Figure 3.8 Plaintext and ciphertext in Z26
  • 25. Figure 3.9 Additive cipher 3.2.1 Continued When the cipher is additive, the plaintext, ciphertext, and key are integers in Z26. Note
  • 26. 3.2.1 Continued Use the additive cipher with key = 15 to encrypt the message “hello”. Example 3.3 We apply the encryption algorithm to the plaintext, character by character: Solution
  • 27. 3.2.1 Continued Use the additive cipher with key = 15 to decrypt the message “WTAAD”. Example 3.4 We apply the decryption algorithm to the plaintext character by character: Solution
  • 28. 3.2.1 Continued Historically, additive ciphers are called shift ciphers. Julius Caesar used an additive cipher to communicate with his officers. For this reason, additive ciphers are sometimes referred to as the Caesar cipher. Caesar used a key of 3 for his communications. Shift Cipher and Caesar Cipher Additive ciphers are sometimes referred to as shift ciphers or Caesar cipher. Note
  • 29. 3.2.1 Continued Eve has intercepted the ciphertext “UVACLYFZLJBYL”. Show how she can use a brute-force attack to break the cipher. Example 3.5 Eve tries keys from 1 to 7. With a key of 7, the plaintext is “not very secure”, which makes sense. Solution
  • 30. 3.2.1 Continued Table 3.1 Frequency of characters in English Table 3.2 Frequency of diagrams and trigrams
  • 31. 3.2.1 Continued Multiplicative Ciphers In a multiplicative cipher, the plaintext and ciphertext are integers in Z26; the key is an integer in Z26*. Note Figure 3.10 Multiplicative cipher
  • 32. 3.2.1 Continued What is the key domain for any multiplicative cipher? Example 3.7 The key needs to be in Z26*. This set has only 12 members: 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25. Solution We use a multiplicative cipher to encrypt the message “hello” with a key of 7. The ciphertext is “XCZZU”. Example 3.8
  • 34. 3.2.1 Continued The affine cipher uses a pair of keys in which the first key is from Z26* and the second is from Z26. The size of the key domain is 26 × 12 = 312. Example 3.09 Use an affine cipher to encrypt the message “hello” with the key pair (7, 2). Example 3.10
  • 35. 3.2.1 Continued Use the affine cipher to decrypt the message “ZEBBW” with the key pair (7, 2) in modulus 26. Example 3.11 Solution The additive cipher is a special case of an affine cipher in which k1 = 1. The multiplicative cipher is a special case of affine cipher in which k2 = 0. Example 3.12
  • 36. 3.2.1 Continued Because additive, multiplicative, and affine ciphers have small key domains, they are very vulnerable to brute-force attack. Monoalphabetic Substitution Cipher A better solution is to create a mapping between each plaintext character and the corresponding ciphertext character. Alice and Bob can agree on a table showing the mapping for each character. Figure 3.12 An example key for monoalphabetic substitution cipher
  • 37. 3.2.1 Continued We can use the key in Figure 3.12 to encrypt the message Example 3.13 The ciphertext is
  • 38. 3.2.2 Polyalphabetic Ciphers In polyalphabetic substitution, each occurrence of a character may have a different substitute. The relationship between a character in the plaintext to a character in the ciphertext is one-to-many. Autokey Cipher
  • 39. 3.2.2 Continued Assume that Alice and Bob agreed to use an autokey cipher with initial key value k1 = 12. Now Alice wants to send Bob the message “Attack is today”. Enciphering is done character by character. Example 3.14
  • 40. 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 • Playfair Cipher is an example
  • 41. Playfair Key Matrix • 5X5 matrix of letters based on a keyword • Fill in letters of keyword (sans duplicates) • Fill rest of matrix with other letters • Eg. using the keyword MONARCHY
  • 42. 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 (again wrapping to top from bottom) 4. Otherwise each letter is replaced by the letter in the
  • 43. Playfair Key Matrix • Eg. Using the keyword MONARCHY • Encrypt: Ballon -> Ba lx lo nx • Cipher: IB SU PM AW M O N A R C H Y B D E F G I/J K L P Q S T U V W X Z
  • 44. 3.2.2 Continued Playfair Cipher Figure 3.13 An example of a secret key in the Playfair cipher Let us encrypt the plaintext “hello” using the key in Figure 3.13. Example 3.15
  • 45. Security of Playfair Cipher • Much improved over monoalphabetic • Since have 26 x 26 = 676 digrams • Would need a 676 entry frequency table to analyse (verses 26 for a monoalphabetic) • Correspondingly more ciphertext • Was widely used for many years – eg. by US & British military in WW1 • It can be broken, given a few hundred letters
  • 46. Vigenère Cipher • Simplest polyalphabetic substitution cipher • Effectively multiple caesar ciphers • Key is multiple letters long K = k1 k2 ... kd • ith letter specifies ith alphabet to use • Use each alphabet in turn • Repeat from start after d letters in message • Decryption simply works in reverse
  • 47. 3.2.2 Continued Vigenere Cipher We can encrypt the message “She is listening” using the 6- character keyword “PASCAL”. Example 3.16
  • 48. 3.2.2 Continued Using Example 3.18, we can say that the additive cipher is a special case of Vigenere cipher in which m = 1. Example 3.18 Table 3.3 A Vigenere Tableau
  • 50. 3.2.2 Continued Hill Cipher Figure 3.15 Key in the Hill cipher The key matrix in the Hill cipher needs to have a multiplicative inverse. Note
  • 57. 3.2.2 Continued One of the goals of cryptography is perfect secrecy. A study by Shannon has shown that perfect secrecy can be achieved if each plaintext symbol is encrypted with a key randomly chosen from a key domain. This idea is used in a cipher called one-time pad, invented by Vernam. One-Time Pad
  • 58. 3.2.2 Continued Rotor Cipher Figure 3.19 A rotor cipher
  • 59. 3.2.2 Continued Enigma Machine Figure 3.20 A schematic of the Enigma machine
  • 60. 3-3 TRANSPOSITION CIPHERS A transposition cipher does not substitute one symbol for another, instead it changes the location of the symbols. 3.3.1 Keyless Transposition Ciphers 3.3.2 Keyed Transposition Ciphers 3.3.3 Combining Two Approaches Topics discussed in this section: A transposition cipher reorders symbols. Note
  • 61. 3.3.1 Keyless Transposition Ciphers Simple transposition ciphers, which were used in the past, are keyless. A good example of a keyless cipher using the first method is the rail fence cipher. The ciphertext is created reading the pattern row by row. For example, to send the message “Meet me at the park” to Bob, Alice writes Example 3.22 She then creates the ciphertext “MEMATEAKETETHPR”.
  • 62. 3.3.1 Continued Alice and Bob can agree on the number of columns and use the second method. Alice writes the same plaintext, row by row, in a table of four columns. Example 3.23 She then creates the ciphertext “MMTAEEHREAEKTTP”.
  • 63. 3.3.1 Continued The cipher in Example 3.23 is actually a transposition cipher. The following shows the permutation of each character in the plaintext into the ciphertext based on the positions. Example 3.24 The second character in the plaintext has moved to the fifth position in the ciphertext; the third character has moved to the ninth position; and so on. Although the characters are permuted, there is a pattern in the permutation: (01, 05, 09, 13), (02, 06, 10, 13), (03, 07, 11, 15), and (08, 12). In each section, the difference between the two adjacent numbers is 4.
  • 64. 3.3.2 Keyed Transposition Ciphers The keyless ciphers permute the characters by using writing plaintext in one way and reading it in another way The permutation is done on the whole plaintext to create the whole ciphertext. Another method is to divide the plaintext into groups of predetermined size, called blocks, and then use a key to permute the characters in each block separately.
  • 65. 3.3.2 Continued Alice needs to send the message “Enemy attacks tonight” to Bob.. Example 3.25 The key used for encryption and decryption is a permutation key, which shows how the character are permuted. The permutation yields
  • 66. 3.3.3 Combining Two Approaches Example 3.26 Figure 3.21
  • 67. Figure 3.22 Encryption/decryption keys in transpositional ciphers 3.3.3 Continued Keys In Example 3.27, a single key was used in two directions for the column exchange: downward for encryption, upward for decryption. It is customary to create two keys.
  • 68. Figure 3.23 Key inversion in a transposition cipher 3.3.3 Continued
  • 69. 3.3.3 Continued Using Matrices We can use matrices to show the encryption/decryption process for a transposition cipher. Figure 3.24 Representation of the key as a matrix in the transposition cipher Example 3.27
  • 70. Figure 3.24 Representation of the key as a matrix in the transposition cipher 3.3.3 Continued Figure 3.24 shows the encryption process. Multiplying the 4 × 5 plaintext matrix by the 5 × 5 encryption key gives the 4 × 5 ciphertext matrix. Example 3.27
  • 71. 3.3.3 Continued Double Transposition Ciphers Figure 3.25 Double transposition cipher