Lecture 3 Symmetric Encryptions
Lecture 3 Symmetric Encryptions
Lecture 3 Symmetric Encryptions
Introduction
Symmetric cryptographic schemes are also referred to as symmetric-key, secret-key, and single-
key schemes or algorithms. Symmetric cryptography is best introduced with an easy-to-
understand problem: There are two users, Alice and Bob, who want to communicate over an
insecure channel Figure 1.
The term channel might sound a bit abstract but it is just a general term for the communication
link: This can be the Internet, a stretch of air in the case of mobile phones or wireless LAN
communication, or any other communication media you can think of. The actual problem starts
with the bad guy, Oscar, who has access to the channel, for instance, by hacking into an Internet
router or by listening to the radio signals of a Wi-Fi communication. This type of unauthorized
listening is called eavesdropping.
Obviously, there are many situations in which Alice and Bob would prefer to communicate
without Oscar listening. For instance, if Alice and Bob represent two offices of a car
manufacturer, and they are transmitting documents containing the business strategy for the
introduction of new car models in the next few years, these documents should not get into the
hands of their competitors, or of foreign intelligence agencies for that matter.
In this situation, symmetric cryptography offers a powerful solution: Alice encrypts her message
X using a symmetric algorithm, yielding the ciphertext Y. Bob receives the ciphertext and
decrypts the message. Decryption is, thus, the inverse process of encryption Figure 2. What is the
advantage? If we have a strong encryption algorithm, the ciphertext will look like random bits to
Oscar and will contain no information whatsoever that is useful to him.
{0,1,2,3,4,5,6,7,8}
We can do regular arithmetic as long as the results are smaller than 9. For instance:
2x3=6
4+4=8
But what about 8+4? Now we try the following rule: Perform regular integer arithmetic and
divide the result by 9. We then consider only the remainder rather than the original result. Since
8+4 = 12, and 12/9 has a remainder of 3, we write:
8+4 ≡ 3 mod 9
We now introduce an exact definition of the modulo operation:
Definition of Modulo Operation
Caesar Cipher
The earliest known, and simplest, use of a substitution cipher was by Julius Caesar. The Caesar
cipher involves replacing each letter of the alphabet with the letter standing three places further
down the alphabet. For example,
Plaint 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
ext
Ciphe 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
r
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
Then the algorithm can be expressed as follows. For each plaintext letter P, substitute the ciphertext
letter C
C = E (k, p) = (p + k) mod 26
where takes on a value in the range of 1 to 25. The decryption algorithm is simply
p = D (k, C) = (C - k) mod 26
If it is known that a given ciphertext is a Caesar cipher, then brute-force cryptanalysis is easily
performed: simply try all the 25 possible keys.
Let x, y, k ∈ Z26.
Definition 1.2. Shift Cipher
Playfair Cipher
The Playfair algorithm is based on the use of a 5 × 5 matrix of letters constructed using a keyword.
Instrument
Key: Monarchy
1. The matrix is constructed by filling in the letters of the keyword (minus duplicates) from left to
right and from top to bottom, and then filling in the remainder of the matrix with the remaining
letters in alphabetic order. The letters I and J count as one letter.
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
HILL CIPHER
This encryption algorithm takes successive plaintext letters and substitutes for them ciphertext
letters. The substitution is determined by M linear equations in which each character is assigned
a numerical value (0=A, 1=B, 2=C………..25=Z. For, the system can be described as.
C1 = (K11p1 + K12p2 + K13p3) mod 26
where C and P are row vectors of length 3 representing the plaintext and ciphertext, and K is a matrix
representing the encryption key. Operations are performed mod 26
For example, consider the plaintext “paymoremoney” and use the encryption key
Steps
1. Split the plaintext
Pay mor emo ney
2. Substitute numerical equivalence (0=a, 1=b…..25=z)
P A Y M O R E M O N E Y
15 0 24 12 14 17 4 12 14 13 4 24
The first three letters of the plaintext are represented by the vector [15 0 24]. Then (15 0
24) K = (303 303 531) mod 26 = (17 17 11) = RRL. Continuing in this fashion, the ciphertext
for the entire plaintext is s RRL MWB KAS PDH.
NOTE: THE CALCULATION WILL BE DONE IN CLASS BOARD