Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
109 views

Conventional Encryption

The document defines key terms related to cryptography including cryptology, cryptography, encryption, decryption, plaintext, and ciphertext. It then provides examples of the Caesar cipher, a substitution cipher that shifts letters in the alphabet. The cipher uses modular arithmetic properties like congruence. The document also defines a cryptosystem as a 5-tuple of plaintext, ciphertext, keyspace, encryption, and decryption rules.

Uploaded by

ekalve
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views

Conventional Encryption

The document defines key terms related to cryptography including cryptology, cryptography, encryption, decryption, plaintext, and ciphertext. It then provides examples of the Caesar cipher, a substitution cipher that shifts letters in the alphabet. The cipher uses modular arithmetic properties like congruence. The document also defines a cryptosystem as a 5-tuple of plaintext, ciphertext, keyspace, encryption, and decryption rules.

Uploaded by

ekalve
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 14

S. Erfani, ECE Dept.

, University of Windsor 0688-590-18 Network Security

Classical Cryptography

1.1 Defining Terms:

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

Alice “See You” Bob

Plaintext: SEE YOU


Cipher Scheme: Replace each letter in the message forward by 5 positions in
alphabet.

Sep. 16.2003 1
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security

Ciphertext: XJJ DTZ “???”

Ciphertext

Alice “XJJ DTZ” Bob

Ciphertext (encrypted message) = message letter + 5 places forward in alphabet


Cipher Key

Uses the “decipher key”


XJJ DTZ SEE YOU

Ciphertext Plaintext
Bob

Decipher Text = each letter in ciphertext – 5 places in alphabet


Decipher Key

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..

Caesar’s Cryptosystem for “Substitution Cipher”

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).

Definition: (Mathematical Definition) A cryptosystem is a 5-tuple (P, C, K, E, D),


where
1) P is a finite set of possible plaintexts
2) C is a finite set of possible ciphertexts
3) K, the key-space, is a finite set of possible keys
4) For each k K, there exists an encryption rule such that ek  E, and a
corresponding decryption rule
dk D, if xP, then dk (ek (x)) = x

Exercise: Determine the 5-tuple (P, C, K, E, D) for the Caesar’s shift cipher.

1.2 Modular Arithmetic

The Caesar’s shift cipher is based on modular arithmetic.

Definition: Congruence - If a and b are integers and m is a positive integer,

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).

We say, “a is congruent to b modulo m”. m is called the modulus.

Example 1: Let m = 16. Find 1113 modulus 16.

Solution: 11´13 = 143


143 = 8m+15 Remainder
11´13(mod 16) 15

Example 2: The key for a “shift cipher” is k = 11, and the plaintext is
“wewillmeetatmidnight”, find the ciphertext.

Solution:

Step-1 Set up the correspondence between alphabetic characters and


residues modulo 26 as follows:

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

Remember this table for the rest of this course!

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

Step-3 Add 11 to each value, reducing each sum modulo 26:


7, 15, 7, 19, 22, 22, 23, 15, 15, 4, 11, 4, 23, 19, 14, 24,19, 17, 18, 4

Step 4 Convert the above sequence of integers to alphabetic characters by


using the Table in Step 1.

“HPHTWWXPPELEXTOYTRSE”

Example 3: ( Exercise 1.1 on page 38 of Stinson Book)

Sep. 16.2003 4
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security

(a) Evaluate (7503) mod 81

Solution:
a mod m  b iff
a = km + b b  (0, 1, …, m-1)
That is b is the remainder when m divides a:

7503 = k81 + b

7503
 92  m  b , remainder is b = 51
81
Thus,
7503 (mod 81) = 51

(b) Evaluate (7503) mod 81

Solution:
(7503) mod 81 = 51mod(81) = 30

Note: 7503 = 9381+30 remainder

(c) Evaluate 81 mod 7503

81 mod 7503  81

(d) Evaluate –81 mod 7503

–81 mod 7503 = (-7503 + 7421) mod 7503

Note: –81 = 7422 – 7503 = 7422

Remainder

1.2.1 Properties of Modular Arithmetic

Recall that given any positive integer n and any integer a, if we divide a by n, we
get:

a=qn+r 0 r <n ; q = a/n

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

Figure shows the relationship a=qn+r

Note 1: Given a and positive n, it is always possible to find q and r.

Note 2: The remainder r is often referred to as a residue.

Note 3: Two integers a and b are congruent modulo m , if

a mod m = b mod m

This can be written as a  b mod m

Example: Show that 18(mod 8)=42(mod 8)

Solution:
18 = 28+2 = 2(mod 8)
42 = 58+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) = qm for some q
 a = qm +b
 a(mod m) = (b+ qm) (mod m)
0
 = b(mod m)+ qm(mod m)

 = b(mod m) Q.E.D.

Property 2: If a (mod m) = b (mod m), then a  b (mod m)

Proof
Let a (mod m) = qam+ra
b mod m) = qbm+rb
If a(mod m) = b(mod m)
Then (qam+ra) (mod m) = ra = rb = b (mod m)
 ab(mod m)

Sep. 16.2003 6
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security

Property 3: a  b mod m implies b  a mod m

Property 4: a  b mod m and b  c mod m implies a  c mod m

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 = [(wx)+ (wy)] mod m

P4  Identities:
(0+w) mod m = w mod m

P5  Additive inverse (w):


For each w Zm, there exists a z such that w+z  0 mod m.

P6  Multiplicative inverse (w1):


For each w Zm, there exists a z such that wz 1 mod m.

Example: Find the multiplicative inverse of 7 in Zm for modulus m=26

Solution:
Δ
71 mod 26 = z such that
(7z) 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

Insecure communications are always subject to attacks by an opponent. The


insecure channel could be a telephone line or a computer network.

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)

Release of Message Contents Traffic Analysis


(Privacy is lost) (Pattern, frequency, length, date and time is
observed)

Active Attacks

Interruption Modification Falsification


(Availability is lost) (Integrity is lost) (Integrity is lost, denial of
service can happen)

1.4 Polyalphabetic Substitution Ciphers

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.

1.5 The Vigenĕre Cipher

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

Key Plaintext Ciphertext

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

Figure: The Vigenĕre cipher is a polyalphabetic cipher

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

Since this message has a length of 27, it needs a key as long as


27 letters.
Step 2
Repeat the given keyword “deceptive” three times to obtain the
following key:

deceptive deceptive deceptive


Step 3
Use this key and the Vigenĕre Tableau (shown in the previous
page) to encrypt the original plaintext into:

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.

1.5.1 The Vigenĕre Cryptosystem

Let m be a positive integer. Define P=C=K=(Z26)m. For a key


K=(k1, k2, …, km), we define
eK(x1, x2,…, xm)=( x1+k1, x2+k2, …, xm+km)

and

dK(y1, y2,…, ym)=( y1-k1, y2-k2, …, ym-km),

Sep. 16.2003 12
S. Erfani, ECE Dept., University of Windsor 0688-590-18 Network Security

where all operators are performed in Z26.

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

The alphabetic equivalent of the ciphertext string would thus be:

“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

1.5.2 Comparing the Caesar Shift Cipher and Vigenĕre Cipher

Simple key lock A more complex key


left to “3”
open left to “27”
left to left to “8” open
“3” open

Caesar Cipher key Vigenere Cipher key = 3, 27, 8


1st letter Turn left to ‘3’ 1st letter Turn left to ‘3’
2nd letter Turn left to ‘3’ 2nd letter Turn left to ‘27’
3rd letter Turn left to ‘3’ rd
3 letter Turn left to ‘8’

tput of (a) enciphered.

Sep. 16.2003 14

You might also like