CompSec 4035 Chapter 3 Lesson 1
CompSec 4035 Chapter 3 Lesson 1
Secret Key
Ciphertext
Decryption algorithm
Mathematical Notation
Given
P=Plaintext
C=Ciphertext
C = EK (P) Encryption
P = DK ( C) Decryption
Cryptography
Services Provided by Cryptography
Guarantees
Confidentiality: provides privacy for messages and
stored data by hiding
Integrity: provides assurance to all parties that a
message remains unchanged
Authenticity: provides the identification of the
originator or
It confirms to the receiver that the data received has
been sent only by an identified and verified sender
Non-repudiation: ensures that an entity cannot refuse
the ownership of a previous commitment or an action
Cryptography
Purpose of Cryptography
Crypto Machines
Thomas Jefferson invented a wheel cipher in the 1790s - used
during World War II with slight modification.
Consisted of a set of wheels, each with random orderings of the
letters of the alphabet.
In 1844, the development of cryptography was dramatically changed by
the invention of the telegraph.
Ciphers were needed to transmit secret information over the telegraph.
Cryptography
Historical background
During World War II, most German codes were predominantly
based on the Enigma machine.
A British cryptanalysis group first broke the Enigma code
early in World War II - first uses of computers!
Example
Plaintext: are you ready
Ciphertext: duh brx uhdgb
Cipher Techniques
Substitution …Caesar Cipher
Activity
Convert it ....to Caesar Ciphertext?
Plaintext: are you ready
Plaintext ab c d e f g h i j k l mn o p q r s t u v w x y z
Ciphertext D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
Monoalphabetic Cipher:
Examples
Plain: abcdefghijklmnopqrstuvwxyz
Cipher:
DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplaceletters
Ciphertext:WIRFRWAJUHYFTSDVFSFUU
FYA
Cipher Techniques
Substitution …Monoalphabetic Cipher
Monoalphabetic Cipher:
Cipher Techniques
Substitution …
Playfair Cipher:
Aka Playfair square or Wheatstone- Playfair Cipher
The best-known multiple-letter encryption cipher
It was the first literal digraph/digram substitution
cipher.
The scheme was invented in 1854 by Charles
Wheatstone,
but bears the name of Lord Playfair who promoted
the use of the cipher.
Used in WWI and WWII
It used a 5 x 5 matrix constructed using a keyword
Cipher Techniques
Substitution …
Playfair Key Matrix
The Playfair algorithm is based on the use of a 5x5
matrix of letters constructed using a keyword.
a 5X5 matrix of letters based on a keyword
fill in letters of keyword (no duplicates, i & j used as a single
letter.)
E g. using the keyword (key) simple s i/j m p l
e a b c d
f g h k n
o q r t u
v w x y z
Cipher Techniques
Substitution …
Playfair Cipher rule
First, a plaintext message is split into pairs of two letters
(digraphs) or digrams.
If there is an odd number of letters, a “z or x” is added to
the last letter.
Let us say we want to encrypt the message “hide
money”.
It will be written as −
HI DE MO NE YZ
Use filler letter to separate repeated letters
eg. "balloon" encrypts as "ba lx lo on" Encrypt two
letters together
Cipher Techniques
Substitution …
Playfair Cipher rule
If both the letters are in the same row: Take the letter to
the right of each one (going back to the leftmost if at the
rightmost position).
ac--bd
If both the letters are in the same column: Take the letter
below each one (going back to the top if at the bottom).
gk--hn
If neither of the above rules is true: Form a rectangle
with the two letters and take the letters on the horizontal
opposite corner of the rectangle.
Cipher Techniques
Substitution …Playfair Cipher- Example
Eg. Keyword. Now write Then finish filling up the
the letters keyword in the remaining squares of the matrix
first squares of a five by with the remaining letters of the
five matrix: alphabet, in alphabetical order
Plaintext: Ethiopia
Ciphertext: klbfhvsb
Would you pleas tray this: “instruments” with the above
keyword
Cipher Techniques
Substitution… Polyalphabetic ciphers
Another way to improve on the simple monoalphabetic
technique is to use different monoalphabetic
substitutions as one proceeds through the plaintext
message.
The general name for this approach is polyalphabetic
substitution cipher.
All these techniques have the following common
features :
A set of related Monoalphabetic substitution rules is
used.
A key determines which particular rule is chosen for
a given transformation.
Cipher Techniques
Substitution… Vigenere Cypher
The best known, and one of the simplest, such
algorithm is referred to as the Vigenère cipher.
In this scheme, the set of related
monoalphabetic substitution rules consists of
the 26 Caesar ciphers, with shifts of 0 through
25.
Vigenere Cipher is a method of encrypting
alphabetic text.
It uses a simple form of polyalphabetic
substitution.
Cipher Techniques
Substitution… Vigenere Cypher
The Vigenere Table consists of the alphabets
written out 26 times in different rows, each
alphabet shifted cyclically to the left compared
to the previous alphabet, corresponding to the 26
possible Caesar Ciphers.
At different points in the encryption process, the
cipher uses a different alphabet from one of the
rows.
The alphabet used at each point depends on a
repeating keyword.
Vigenere Table
The Vigenère cipher uses a 26×26 table with A to Z as the row heading and column
heading
This table is usually referred to as the Vigenère Tableau, Vigenère Table or Vigenère
Square.
We shall use Vigenère Table. The first row of this table has the 26 English letters.
Starting with the second row, each row has the letters shifted to the left one position in a
cyclic way.
Plaintext
Key
Cipher Techniques
Substitution… Vigenere Cypher working rule
Use the Vigenere Table to encrypt
Write the plaintext out
Key must be as long as the plaintext
Write your keyword across the top/bottom of the text
you want to encipher
For each p, look at the letter of the key above it and
find that row in the Vigenere table
Find the column of p and trace down until we reach
the row we found before
Finally, take the value at the intersection
Cipher Techniques
Substitution… Vigenere Cypher working rule
Cipher Techniques
Substitution… Vigenere Cypher
Example
M= attack shall start tonight (plaintext)
K= secret
C=E(K, M)= sxvrgdklccplletkxhfmiyx
To decipher back to M
Key identifies row
Cipher shows which column to look for
P is the top value in that column of the row
Cipher Techniques
Transposition Cipher
All the techniques examined so far involve the substitution of a
ciphertext symbol for a plaintext symbol.
A very different kind of mapping is achieved by performing some
sort of permutation on the plaintext letters.
This technique is referred to as a transposition cipher
Ciphertext mapping is achieved by performing or applying some
sort of permutation on the plaintext letters
Positions held by units of plaintext (which are commonly
characters or groups of characters) are shifted according to a
regular system
Can be single or double transposition
Cipher Techniques
Transposition Cipher – Next class