Conventional Encryption
Conventional Encryption
Classical Cryptography
Definition No.1:
Cryptology: The Study of secure communications, which encompasses both
cryptography and cryptanalysis.
Insecure Communication
Channel
I------
Information Source ------- Info-Destination
-------
Plaintext
Sealed Envelope
Definition No. 2:
Cryptography: Deals with the design of algorithms for encryption and decryption,
intended to ensure the secrecy and/or authenticity of messages.
Definition No. 3:
Encryption: The Process of transforming plaintext into a disguised text (or cipher-
text) is called encryption. The reverse process is called decryption.
Plaintext
Sep. 16.2003 1
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Ciphertext
Ciphertext Plaintext
Bob
Definition No. 4:
Plaintext: The input to an encryption process (or function) or the output of a
decryption function.
Definition No. 5:
Ciphertext: The output of an encryption function.
Definition No. 6:
Cryptanalysis: Deals with the breaking of a cipher to recover information.
Note 1: The ciphertext obtained by substituting one letter from alphabet with
another one called “substitution (encryption) rule”. The number of places moving
forward (or backward) in the alphabet called a “Key”.
Note 2: The “keyspace” (or the finite set of possible keys) for the above Caesar’s
Substitution Cipher is the finite number of letters in alphabet, i.e., 26.
te 3: Substitution Cipher: Add to plain letter + (5 places)
Algorithm + Key
Note 4: Algorithm is the same; the only difference for getting differing cipher-text
from the original plaintext is due only to the key (i.e., number of places advancing
in alphabet).
Sep. 16.2003 2
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Cryptosystem
.. Z A..
.. z a..
Rotates
1,2,3,…
..n m..
..N M..
Note 5: In this substitution cipher if you decipher “one letter” you have found the
key! (i.e., the number of shifts in the alphabet).
Exercise: Determine the 5-tuple (P, C, K, E, D) for the Caesar’s shift cipher.
then we write
Sep. 16.2003 3
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
a b (mod m) congruence
If m divides (b-a).
Example 2: The key for a “shift cipher” is k = 11, and the plaintext is
“wewillmeetatmidnight”, find the ciphertext.
Solution:
A B C D E F G H I J K L M
0 1 2 3 4 5 6 7 8 9 10 11 12
N O P Q R S T U V W X Y Z
13 14 15 16 17 18 19 20 21 22 23 24 25
Step-2 Use the above table to convert the given plaintext to a sequence of
integers:
22 4 22 8 11 11 12 4 4 19 0 19
12 8 3 13 8 6 7 19
“HPHTWWXPPELEXTOYTRSE”
Sep. 16.2003 4
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Solution:
a mod m b iff
a = km + b b (0, 1, …, m-1)
That is b is the remainder when m divides a:
7503 = k81 + b
7503
92 m b , remainder is b = 51
81
Thus,
7503 (mod 81) = 51
Solution:
(7503) mod 81 = 51mod(81) = 30
81 mod 7503 81
Remainder
Recall that given any positive integer n and any integer a, if we divide a by n, we
get:
n
Sep. 16.2003 5
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
0 1 2 n 2n qn a (q+1)n
r
a mod m = b mod m
Solution:
18 = 28+2 = 2(mod 8)
42 = 58+2 = 2(mod 8)
18(mod 8) = 42(mod 8) = 2(mod 8)
42 = 18(mod 8)
Property 1:
a b(mod m) if (a-b) divides by m.
Proof
If (a-b) divides m, then, (a-b) = qm for some q
a = qm +b
a(mod m) = (b+ qm) (mod m)
0
= b(mod m)+ qm(mod m)
= b(mod m) Q.E.D.
Proof
Let a (mod m) = qam+ra
b mod m) = qbm+rb
If a(mod m) = b(mod m)
Then (qam+ra) (mod m) = ra = rb = b (mod m)
ab(mod m)
Sep. 16.2003 6
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Note 4:
The (mod m) operator maps all integers into set of integers
{ 0, 1, …, (n-1)} = Zm
This is referred to as the set of residues modulo m.
Note 5:
The following properties hold for integers in Zm :
P1 Commulative law:
(w+x) mod m = (x+w) mod m
P2 Associative law:
[(w+x)+y] mod m = [w+(x+y)] mod m
P3 Distributive law:
[w(x+y)] mod m = [(wx)+ (wy)] mod m
P4 Identities:
(0+w) mod m = w mod m
Solution:
Δ
71 mod 26 = z such that
(7z) mod 26 = 1 (mod 26) =1
Sep. 16.2003 7
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
7 z 1
q
26
26q 1 5q 1
z 3q
7 7
5 4 1
For q = 4, we get z 3 4 12 3 15
7
7-1 mod 26 = 15
1.3 Attacks
Opponent
Oscar
Attack (Interception)
Alice Bob
Source Destination
Oscar
……………..
?
Alice Interruption Bob
Sep. 16.2003 8
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Oscar
Modification
Alice Bob
Oscar
Fabrication
Alice Bob
Passive Attacks
Interception (confidentiality is lost)
Active Attacks
Sep. 16.2003 9
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Note 1:
Weakness of the Caesar’s shift cipher or mono-alphabetic ciphers is that
their distribution reflects the distribution of the underlying alphabet.
For example, in English language:
(a) “E” is the most often used letter, followed by “t”, “o, “a” and “n”.
(b) “T” is the most common letter at the beginning of a word.
(c) “E” is the most common letter at the end of a word.
(d) “A” and “I” are the only single-letter words in English.
(e) The words “of”, “to” and “in” are the most frequent two-letter words.
(f) “the” and “and” are the most frequent three-letter words.
(g) “that” is the most frequent four-letter words.
(h) “N” is the consonant that most often follows a vowel.
Note 2:
In the Caesar’s shift cipher, once a key is chosen, each alphabet
character is mapped to a unique alphabet. For this reason, these
cryptosystems are called monoalphabetic cryptosystems.
Note 3:
The frequency pattern of a language, as mentioned in Note 1 above, helps
a cryptanalyzer to cryptanalyze a mono-alphabetic cryptotext.
This looks like the Caesar’s cipher, but instead of one cipher alphabetic, there
are 26, i.e., a polyalphabet. To encrypt a message a key is needed that is as long
as the message. Usually, the key is a repeating keyword.
The figure in the next page shows a key length of 5, that is K=(1, 5, 8, 11, 14)
has been used to encrypt the plaintext “every” into a ciphertext “FAMCM”.
It is seen that in this scheme the letter “e” in the original plaintext is mapped into
two different letters, namely “F” and “M”. This cryptosystem is invented by a
French cryptographer, Blaise de Vigenĕre, in 1500s.
1 E F
Sep. 16.2003 5 V A 10
8 & E = M
11 R C
14 Y M
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
2 C 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
3 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
4 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 D
5 F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
6 G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
7 H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
8 I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
9 J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
10 K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
11 L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
12 M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
13 N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
14 O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
15 P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
16 Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
17 R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
18 S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
19 T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
20 U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
21 V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
22 W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
23 X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
24 Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
25 Z A B C D E F G H I J K L M N O P Q R S T U V W X Y
Example 1: Use the keyword “deceptive” to encrypt the message “we are
discovered save yourself” in the Vigenĕre scheme. What is the resulting
ciphertext?
Solution:
Step 1
Write the plaintext as:
wearediscoveredsaveyourself
Sep. 16.2003 11
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
1 5 10 15 20 25 27
ZICVTWQNGRZGVTWAVZHCQYGLMGJ
Decryption is equally simple. The key letter again identifies the row. The position
of the ciphertext letter in that row determines the column, and the plaintext letter
is at the top of that column in the Vigenĕre tableau.
and
Sep. 16.2003 12
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Example 2
Suppose m=6 and the keyword is “cipher”. Convert the following plaintext
string into a Vigenĕre ciphertext:
“thiscryptosystemisnotsecure”
Solution:
Step 1
Convert the plaintext elements to residues modulo 26, write them in groups of
six, and then add the keyword modulo 26 as follows:
t h i s c r y p t o s y
19 7 8 18 2 17 24 15 19 14 18 24
2 8 15 7 4 17 2 8 15 7 4 17
21 15 23 25 6 8 0 23 8 21 22 15
s t e m i s n o t s e c
18 19 4 12 8 18 13 14 19 18 4 2
2 8 15 7 4 17 2 8 15 7 4 17
20 1 19 19 12 9 15 22 8 25 8 19
u r e
20 17 14
2 8 15
22 25 19
“VPXZGIAXIVWPUBTTMJPWIZITWZT”
To decrypt, we can use the same keyword but we would subtract it modulo 26
from the ciphertext, instead of adding.
Sep. 16.2003 13
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security
Sep. 16.2003 14