Model of Conventional Encryption
Model of Conventional Encryption
The following figure, which is on the next page, illustrates the conventional
encryption process. The original “plaintext” is converted into apparently random
nonsense, called “ciphertext”. The encryption process consists of an algorithm
and a key. The key is a value independent of the plaintext. The algorithm will
produce a different output depending on the specific key being used at the time.
Changing the key changes the output of the algorithm, i.e., the ciphertext.
X^
Cryptanalyst
Y^
Message X Y
Encryption Decryption Destination
Source
Algorithm Algorithm
Secure Channel
Key
Source
Sep. 23.2003
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Referring to Fig. 1 above, with the message X and the encryption key K as input,
the encryption algorithm forms the ciphertext.
Y=Ek (X)
2.3-2 Cryptanalysis
The following table summarizes the various types of cryptanalytic attacks based
on the amount of information known to the cryptanalyst.
Sep. 23.2003 2
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Example 1:
Read L A S T N I
down T E W A S H
E A V E N P
L E A S E M
A R R Y M E
To encipher the text, we only read letters down the first column, then letters down
from the second column, and so on. The ciphered letters are the same as the
plaintext letters except that they are positioned to form a new pattern, as given
below.
To decipher the received ciphertext, the receiver must know two things: the
length and width of the grid and the way letters are read from the grid.
Sep. 23.2003 3
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Let m be a positive integer. Let P =C = (Z26)m and let K consist of all permutations
of {1, …, m}. For a key (i.e., a permutation) , we define
e (x1, …, x m)=( x(1), …, x(m)) and
d (y1, …, ym)=( y (1), …, y (m)) ,
-1 -1
x 1 2 3 4 5 6
(x) 3 6 1 5 2 4
Note that the first row of this diagram lists the values of x, 1 x 6, and the 2nd
row lists the corresponding values of (x).
The inverse permutation -1 can be constructed by interchanging the two rows in
this diagram, and rearranging the columns so that the first row is in increasing
order. Thus, carrying out these operations, we get the following decryption
permutation -1 as:
x 1 2 3 4 5 6
(x)
-1
3 5 1 6 4 2
We first partition the plaintext into groups of six letters, and then rearrange each
group of six letters according to permutation . The result is shown in the
following 6x6 grid.
x 1 2 3 4 5 6
(x) E E S L S H
S A L S E S
L S H B L E
H S Y E E T
H R A E O S
Sep. 23.2003 4
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
or in a compact form
Y=KX
Where Y and X are column vectors of length 3, representing the ciphertext and
plaintext letters, and K is a 33 matrix, representing the encryption key.
Operations are performed mod26. Decryption requires using the inverse of matrix
K.
17 17 5
K 21 18 21
2 2 19
Sep. 23.2003 5
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Solution:
Plaintext: paymoremoney
15 0 24 …
The first three letters of the plaintext are represented by vector (x 1, x2, x3)=(15, 0,
24)
Thus:
y1 x1 17 17 5 15
y2 K x2 21 18 21 0
y x 2 2 19 24
3 3
That is:
y1 375 11 L
y2 819 mod 26 13 N
y 489 18 S
3
Continuing in this fashion, the ciphertext for the entire plaintext is:
Ciphertext: LNSHDLEWMTRW
Q.E.D.
Decryption requires using the inverse of the matrix K. The inverse K1 of a matrix
K is defined by the equation K K1= K1K =I, where I is the diagonal matrix that is
all zeros except for ones along the main diagonal from upper left to lower right.
Note 2: The inverse of a matrix does not always exist, but when it does, it
satisfies the preceding equation.
4 9 15
K 1 15 17 6
24 0 17
Sep. 23.2003 6
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Note 3: It is easily shown that if the matrix K1 is applied to the above
resulting ciphertext, then the plaintext can be recovered.
LNSHDLEWMTRW
He has also estimated the decryption matrix from some previous analysis for this
Hill Cipher to be:
4 9 15
1
K 15 17 6
24 0 17
and let
C = EK(P)=KP
P = DK(C) = K1 C= K1 KP = P
Note 2: The weakness of the Hill Cipher is that it is easily broken with a
known plaintext attack.
Let
Sep. 23.2003 7
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Cj=KPj 1jm
X = (Pij)
Y = (Cij)
Example 2: It is known that the plaintext “friday” is encrypted using a 22 Hill
Cipher to yield the ciphertext PQCFKU. Find the key matrix K for this
cryptosystem.
Solution:
Plaintext: f r i d a y
Pij : 15 17 8 3 0 24
Ciphertext: P Q C F K U
Cij : 15 16 2 5 10 20
For the unknown key matrix is K, we can write the following plaintext-ciphertext
pairs:
KPj = Cj 1jm
Sep. 23.2003 8
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Using the first two plaintext-ciphertext pairs, we can write the following matrix
equation:
15 16 5 17
2 5 8 3 K mod 26
1
5 17 15 16
K = mod 26
8 3 2 5
9 1 15 16
= mod 26
2 15 2 5
7 19
=
8 3
Therefore, we obtained the key matrix! The result can be verified by testing the
remaining plaintext- ciphertext pair.
Note 3 : From the above example and other examples worked out so far, we
may conclude that neither cipher schemes of Substitution nor Transposition are
strong enough to stand cryptanalytic attacks. One may find that using the two
types together creates much better concealment than either method above. In
fact, using substitution and transposition cipher methods repeatedly on ciphertext
provides strong disguising patterns.
Exercise 2: Why transposition ciphers are used if they are so easy to crack?
Exercise 3: Repeat the transposition cipher used in Exercise 1 (on page 17)
twice for the plaintext used:
Solution:
Plaintext: lastnitewasheavenpleasemarryme
1st transposed ciphertext: LTELAAEAERSWVARTAESYNSNEMIHPME
2nd transposed ciphertext: LEVSMTAAYIEERNHLRTSPASANMAWEE
Read
down
L A S T N I L T E L A A
Sep. 23.2003 9
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
T E W A S H E A E R S W
E A V E N P V A R T A E
L E A S E M S Y N S N E
A R R Y M E M I H P M E
Sep. 23.2003 10