0% found this document useful (0 votes)
39 views

CH 02 Basics of Cryptography

The document summarizes different types of classical ciphers including monoalphabetic substitution ciphers like the Caesar cipher and multiplicative ciphers, the Playfair cipher which encrypts digrams, and the Vigenere cipher which can be seen as a combination of additive ciphers using a repeating keyword. Cryptanalysis techniques for these early ciphers are also briefly discussed, noting weaknesses like frequency analysis for monoalphabetic ciphers and the need for more ciphertext to analyze polyalphabetic ciphers like the Playfair and Vigenere ciphers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

CH 02 Basics of Cryptography

The document summarizes different types of classical ciphers including monoalphabetic substitution ciphers like the Caesar cipher and multiplicative ciphers, the Playfair cipher which encrypts digrams, and the Vigenere cipher which can be seen as a combination of additive ciphers using a repeating keyword. Cryptanalysis techniques for these early ciphers are also briefly discussed, noting weaknesses like frequency analysis for monoalphabetic ciphers and the need for more ciphertext to analyze polyalphabetic ciphers like the Playfair and Vigenere ciphers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

Chapter 2

Basics of Cryptography
• Symmetric Cipher Model
• Substitution Techniques
• Transportation Techniques
• Other Cipher Properties- Confusion, Diffusion, Block and Stream
Ciphers.

10-Feb-21
Symmetric cipher Model

10-Feb-21
Symmetric cipher Model
If P is the plaintext, C is the ciphertext, and K is the key,

Symmetric cipher Model

We assume that Bob creates P1; we prove that P1 = P:

10-Feb-21
Cryptanalysis
• Cryptography is the science and art of creating secret
codes.
• Cryptanalysis is the science and art of breaking those
codes.

10-Feb-21
1. Ciphertext-Only Attack

10-Feb-21
2. Known-Plaintext Attack

⚫ Attacker knows some previous plaintext/ciphertext.


⚫ On that basis try to analyze new intercepted ciphertext.

10-Feb-21
3. Chosen-Plaintext Attack

⚫ Attacker will attack to chose some plaintext of her


own interest from sender’s machine.
⚫ On that basis try to analyze new intercepted ciphertext.

10-Feb-21
Chosen-Ciphertext Attack

⚫ Attacker will attack to chose some ciphertext


receiver’s machine.
⚫ On that basis try to analyze new intercepted ciphertext.

10-Feb-21
Brute Force Search
⚫ always possible to simply try every key
⚫ most basic attack, proportional to key size
⚫ assume either know / recognise plaintext
Key Size (bits) Number of Alternative Time required at 1 Time required at 106
Keys decryption/µs decryptions/µs

32 232 = 4.3 × 109 231 µs = 35.8 minutes 2.15 milliseconds

56 256 = 7.2 × 1016 255 µs = 1142 years 10.01 hours

128 2128 = 3.4 × 1038 2127 µs = 5.4 × 1024 years 5.4 × 1018 years

168 2168 = 3.7 × 1050 2167 µs = 5.9 × 1036 years 5.9 × 1030 years

26 characters 26! = 4 × 1026 2 × 1026 µs = 6.4 × 1012 years 6.4 × 106 years
(permutation)

10-Feb-21
Network security
encryption/ decryption

□ Three dimensions of cryptographic systems

types of ope.used to trans. crypto. Sys. Based on way in which plain text is
Plain text to cipher text (1) no. of keys used(2) processed(3)

asymmetric
Substitution type Transposition symmetric
type Block cipher Stream cipher

Monoalphabetic polyalphabetic rail fence pure transposition


cipher

Multip
Affine
licative
Mono Play fair Hill
autokey vigenere
Caesar/ Alpha cipher
10-Feb-21
additive betic
Categories of Traditional ciphers

⚫ Substitution cipher
⚫ Transposition cipher

⚫ A substitution cipher replaces one symbol with another.


⚫ Substitution ciphers can be categorized as either
monoalphabetic ciphers or polyalphabetic ciphers.

⚫ A transposition cipher does not substitute one symbol for


another, instead it changes the location of the symbols.

10-Feb-21
Substitution cipher

⚫ Monoalphabetic cipher
⚫ Additive Cipher/Ceaser cipher
⚫ Multiplicative cipher
⚫ Affine cipher

10-Feb-21
Monoalphabetic cippher
⚫ rather than just shifting the alphabet
⚫ could shuffle (jumble) the letters arbitrarily
⚫ each plaintext letter maps to a different random
ciphertext letter
⚫ hence key is 26 letters long

Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN

Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA

10-Feb-21
Monoalphabetic Cipher Security
⚫ now have a total of 26! = 4 × 1026
⚫ with so many keys, might think is secure
⚫ but would be !!!WRONG!!!
⚫ problem is language characteristics

10-Feb-21
Additive Cipher

• Simplest monoalphabetic cipher is the additive cipher.


• This cipher is sometimes called a shift cipher and sometimes a
Caesar cipher.

10-Feb-21
Additive cipher(Caesar Cipher)
⚫ replaces each letter by 3rd letter on
⚫ The alphabet is wrapped around so that after Z follows
A:

⚫ mathematically give each letter a number

10-Feb-21
Additive cipher(Caesar Cipher)
⚫ then have Caesar cipher as:
c = E(k, p) = (p + k) mod (26)
p = D(k, c) = (c – k) mod (26)

⚫ example:
c = E (3, p) = (p + 3) mod (26)
p = D(3, c) = (c – 3) mod (26)

⚫ Plain text : hello


⚫ Cipher text: KHOOR

⚫ Plain text : meet me after the toga


party
⚫ Cipher text: PHHW PH DIWHU WKH WRJD
SDUWB 10-Feb-21
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.

10-Feb-21
Multiplicative Ciphers

• In a multiplicative cipher, the plaintext and ciphertext


are integers in Z26.
• the key is an integer in Z26*.

10-Feb-21
Multiplicative Ciphers
What is the key domain for any multiplicative cipher?
• 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.

• Multiplicative cipher to encrypt the message “hello” with a key


of 7.
• The ciphertext is “XCZZU”.

10-Feb-21
Affine cipher

10-Feb-21
Affine cipher
• 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.

Use an affine cipher to encrypt the message “hello” with the key
pair (7, 2).

10-Feb-21
Affine
cipher
Use the affine cipher to decrypt the message “ZEBBW” with the
key pair (7, 2) in modulus 26.
Solution

10-Feb-21
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

10-Feb-21
Playfair Key Matrix
⚫ a 5X5 matrix of letters based on a keyword
⚫ fill in letters of keyword (minus duplicates)
⚫ fill rest of matrix with other letters
⚫ eg. using the keyword MONARCHY

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

10-Feb-21
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 same row and in the column of the other letter
of the pair

Wireless wi re le sx sz XG MK UL XA TX 10-Feb-21
Example
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

Wireless wi re le sx sz XG MK UL XA TX
Monday mo nd ay ON RY NB

10-Feb-21
Security of Playfair Cipher
⚫ security 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)
⚫ and 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
⚫ since still has much of plaintext structure

10-Feb-21
Vigenere
Cipher

Example
3.16
We can encrypt the message “She is listening” using
the 6-character keyword “PASCAL”.

3.29
Let us see how we can encrypt the message “She is
listening” using the 6-character keyword “PASCAL”. The
initial key stream is (15, 0, 18, 2, 0, 11). The key
stream is the repetition of this initial key stream (as
many times as needed).

3.30
Vigenere cipher can be seen as combinations of m
additive ciphers.

Figure 3.14 A Vigenere cipher as a combination of m additive


ciphers

3.31
Using we can say that the additive cipher is a special
case of Vigenere cipher in which m = 1.

3.32
Hill Cipher
⚫ Takes two or three or more letter combinations to the same
size combinations, e.g. “the” “rqv”
⚫ Uses simple linear equations
⚫ An example of a “block” cipher encrypting a block of text at
a time
⚫ Numbered alphabet: a = 0, b = 1, c = 2, etc.
Hill cipher
C=E(K, P)=KP mod 26
P=D(K, P)=K-1C mod 26

10-Feb-21
Hill chipher Example 1
encryption

10-Feb-21
key for decryption
Decryption

10-Feb-21
Hill Cipher example2 encryption

10-Feb-21
Hill Cipher

10-Feb-21
Hill Cipher

10-Feb-21
Hill Cipher

10-Feb-21
Hill Cipher example 2 decyption

10-Feb-21
Hill Cipher

10-Feb-21
Hill chipper example 3

10-Feb-21
10-Feb-21
10-Feb-21
10-Feb-21
10-Feb-21
10-Feb-21
10-Feb-21
10-Feb-21
10-Feb-21
10-Feb-21
10-Feb-21
Transposition Ciphers
⚫ Transposition or permutation ciphers
⚫ These hide the message by rearranging the letter order
without altering the actual letters used.
⚫ Can recognise these since have the same frequency
distribution as the original text

10-Feb-21
Rail Fence cipher
⚫ Write message letters out diagonally over a
number of rows
⚫ then read off cipher row by row
⚫ eg. write message out as: “Meet me at the
park”

ciphertext “MEMATEAKETETHPR”.

10-Feb-21
Columnar transposition(without key)
⚫ Arrangement of plaintext into columns.
⚫ Example: four columns. Plaintext is written row by
row, in a table of four columns.
⚫ Plain text: meet me at the park

⚫ Cipher text: “MMTAEEHREAEKTTP”.


10-Feb-21
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.57
Alice needs to send the message “Enemy attacks
tonight” to Bob..

The key used for encryption and decryption is a


permutation key, which shows how the character are
permuted.

The permutation yields

3.58
3.3.3 Combining Two
Approaches
Example
3.26 Figure 3.21

3.59
Key
s
In Example 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.22 Encryption/decryption keys in transpositional


ciphers

3.60
Using
Matrices
We can use matrices to show the encryption/decryption
process for a transposition cipher.

Example
3.27
Figure 3.24 Representation of the key as a matrix in the transposition
cipher

3.61
Columnar transposition(with key)
⚫ write letters of message out in rows over a specified number of
columns
⚫ then reorder the columns according to some key before reading
off the rows
⚫ plain text: this is css third year class
⚫ Key: 3 4 2 1 5

t h i s i
s c s s t
h i r d y
e a r c l
a s s z z
Ciphertext: ISRRSSSDCZHCIASTSHEAITYLZ

10-Feb-21
Stream Ciphers
Call the plaintext stream P, the ciphertext stream C, and
the key stream K.

Additive ciphers, monoalphabetic ciphers are examples of stream


ciphers as they process stream of characters.
10-Feb-21
Block Ciphers
⚫ In a block cipher, a group of plaintext symbols of size
m (m > 1) are encrypted together creating a group of
ciphertext of the same size.
⚫ A single key is used to encrypt the whole block

10-Feb-21
Block cipher
⚫ A symmetric-key modern block cipher encrypts an

n-bit block of plaintext or decrypts an n-bit block of


ciphertext. The encryption or decryption algorithm uses a
k-bit key.

10-Feb-21
Confusion and Diffusion
⚫ Diffusion : to hide the relationship between the cipher text
and the plain text.
⚫ Diffusion implies that each symbol in the cipher text is
dependent on some or all symbols in the plain text.
⚫ This will frustrate the opponent who use cipher text
statistics to find the plain text.
⚫ Confusion: to hide the relationship between the cipher text
and the key.
⚫ If a single bit in the key is changed most or all bits in the
cipher text will also be changed.
⚫ This will frustrate the opponent who use cipher text
statistics to find the key
10-Feb-21

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy