Computer security ch3.
Computer security ch3.
BURIE CAMPUS
DEPARTMENT OF COMPUTER SCIENCE
Computer Security
By:
Amare W.
1
2
is not obvious.
The transformation of the plaintext under the control of the key into a cipher
Description:
♥ A sender S wanting to transmit message M
to a receiver R
♥ To protect the message M, the sender first
encrypts it into an unintelligible message M’
♥ After receipt of M’, R decrypts the message
to obtain M
♥ M is called the plaintext : What we want to encrypt
3/2/2018
Notation:
♥ Given
P=Plaintext
C=CipherText
♥ C = EK (P) Encryption
♥ P = DK ( C) Decryption
♥ Security depends on the secrecy of the key, not the secrecy of the
algorithm. The two types of attack on an encryption algorithm are
Principle of Encryption
♥ Very hard (impossible) to find out the message without knowing
the key
3/2/2018
♥ Very easy (and fast) to find out the message knowing the key
9 01/27/2025
Types of Cryptosystems
secure channel.
10 01/27/2025
2. Asymmetric cryptosystem
3/2/2018
12 01/27/2025
Substitution ciphers
♥ A substitution cipher is one in which the letters of plaintext are
replaced by other letters or by numbers or symbols.
♥ Substitution ciphers can be categorized as either
a. Monoalphabetic ciphers
b. Polyalphabetic ciphers
I. Monoalphabetic ciphers
♥ In this case, a character ( or symbol) in the plaintext is always
changed to the same character (or symbol) in the ciphertext
regardless of its position or text.
• For example, if the algorithm says that letter A in the 3/2/2018
plaintext is
changed to letter D, every letter A is changed to letter D.
• The relationship in between plaintext and ciphertext is one-to-one.
13 01/27/2025
3/2/2018
14 01/27/2025
Example: Use the additive cipher with key =15 to encrypt the message “hello”.
Soln. : We apply the encryption algorithm to the plaintext character by
character
Plaintext : h 07 Encryption: (07+15)mod 26 Ciphertext: 22 W
Plaintext : e 04 Encryption: (04+15)mod 26 Ciphertext: 19 T
Plaintext : l 11 Encryption: (11+15)mod 26 Ciphertext: 00 A
Plaintext : l 11 Encryption: (11+15)mod 26 Ciphertext: 00 A
Plaintext : o 14 Encryption: (14+15)mod 26 Ciphertext: 03 D
So, the result is “WTAAD”
Note: By using the reverse decrypt algorithm, we can now decrypt the3/2/2018
ciphertext “WTAAD”.
17 01/27/2025
….cont’d
♥ Example: Use the multiplicative cipher with key =7 to encrypt the message
“hello”.;
Soln.: We apply the encryption algorithm to the plaintext character by
character
Plaintext :h 07 Encryption: (07*07)mod 26 Ciphertext: 23 X
Plaintext : e 04 Encryption: (04*07)mod 26 Ciphertext: 02 C
Plaintext : l 11 Encryption: (11*07)mod 26 Ciphertext: 25 Z
Plaintext : l 11 Encryption: (11*07)mod 26 Ciphertext: 25 Z
Plaintext : o 14 Encryption: (14*07)mod 26 Ciphertext: 20 U
So, the result is “XCZZU”
Note: By using the reverse decrypt algorithm, we can now decrypt the
ciphertext “XCZZU”. (Use K-1 = 15) 3/2/2018
21 01/27/2025
♥ Example: Use the affine cipher with key pair (7, 2) to encrypt the
message “hello”.
♥ Soln. : We use 7 for the multiplicative key and 2 for the additive key.
♥ We apply the encryption algorithm to the plaintext character by
character
Plaintext : h 07 Encryption: (07*07+2)mod 26
Ciphertext: 25 Z
Plaintext : e 04 Encryption: (04*07+2)mod 26 Ciphertext:
04 E
Plaintext : l 11 Encryption: (11*07+2)mod 26 Ciphertext:
01 B
Plaintext : l 11 Encryption: (11*07+2)mod 26 Ciphertext:
01 B
Plaintext : o 14 Encryption: (14*07+2)mod 26 Ciphertext:
22 W
So, the result is “ZEBBW”. 3/2/2018
Note: By using the reverse decrypt algorithm, we can now decrypt the
ciphertext “ZEBBW”.
23 01/27/2025
II Polyalphabetic cipher
the ith character in the plaintext to create the ith character in the ciphertext.
25 01/27/2025
2. Playfair cipher
Ciphertext: BPPBFP
30 01/27/2025
3. Vegenere cipher
• The difference between the Vegenere cipher and the other two
polyalphabetic ciphers is that the Vegenere key stream does not
depend on the plaintext characters; it depends only on the position of
the character in the plaintext.
• In other words, the key stream can be created without knowing what
the plaintext is.
Example: Encrypt the message “she is listening” using the 6-character
keyword “PASCAL”.
Sol.: The initial key stream is (15, 0, 18, 2, 0, 11). The key stream is the
repetition of this initial key stream.
3/2/2018
32 01/27/2025
♥ Hill cipher,
♥ Rotor Cipher
3/2/2018
33 01/27/2025
Transposition Techniques
♥ Systematically transpose the positions of plaintext elements (rearrange their
orders).
♥ A transposition cipher does not substitute one symbol for another, instead it
changes the location of the symbols.
♥ A symbol in the first position of the plaintext may appear in the tenth position
of the ciphertext.
♥ A symbol in the eighth position in the plaintext may appear in the first position
of the ciphertext.
♥ In the other words, a transposition cipher reorders (transposes) the symbols.
This group of ciphers include:
3/2/2018
1. Keyless transposition ciphers
2. Keyed transposition ciphers
34 01/27/2025
EEMYNTAACTTKONSHITZG
♥ The receiver divides the ciphertext into 5-
character groups and , using the key3/2/2018
in the
reverse order, finds the plaintext.
39 01/27/2025
Block Ciphers
♥ A symmetric encryption algorithms in which a large block of plaintext
bits (typically 64) is transformed as a whole into a ciphertext block of
the same length.
♥ Block ciphers operate on blocks of plaintext and ciphertext- usually of
64 bits but sometimes longer.
♥ The groups of bits are called blocks. For modern computer
algorithms, a typical block size is 64 bits.
♥ Block ciphers operate on blocks of a message and apply the
3/2/2018
♥ With a block cipher, the same plaintext block will always encrypt
to the same ciphertext block, using the same key.
♥ A block cipher is an encryption/decryption scheme in which a
block of plaintext is treated as a whole and used to produce a
ciphertext block of equal length. It may be viewed as a simple
substitution cipher with large character size.
♥ The function is parameterized by a k-bit key K, taking values
from a subset K (the key space) of the set of all k-bit vectors V k.
3/2/2018
♥ n-bit block cipher takes n bit plaintext and produces n bit
ciphertext. 2n possible different plaintext blocks (inputs) will be
41 01/27/2025
3/2/2018
42 01/27/2025
♥ The output of Function F is then combined with the left half via
another XOR.
♥ The result of these operations becomes the new right half; the old
right half becomes the new left half. These operations are
repeated 16 times, making 16 rounds of DES.
♥ In the third phase, the output of the last (sixteenth) round consists
of 64 bits that are a function of the input plaintext and the key.
♥ The left and right halves of the output are swapped to produce the
preoutput. 3/2/2018
46 01/27/2025
3/2/2018
D
E
S
c
o
m
p
u
t
a
ti
o
n
p
a
T
3/2/2018
h Figure: One round of DES
50 01/27/2025
♥ Since the DES block size is 64 bits, each L i and Ri is 32 bits. The
new left half is simply the old right half.
♥ The round function F is the composition of the expansion
permutation, addition of subkey, S-boxes, and P-box.
♥ The expansion permutation expands its input from 32 to 48 bits
(all bits are used once; some are used twice), and the 48 bit
3/2/2018
3/2/2018
52 01/27/2025
3/2/2018
3/2/2018
55 01/27/2025
3/2/2018
59 01/27/2025
3/2/2018
60 01/27/2025
Substitution
61 01/27/2025
3/2/2018
62 01/27/2025
♥ It is known as DES-EEE3 mode (the Es indicate that there are three encryption
operations, where as the numeral 3 indicates that three different keys are used).
♥ DES-EEE3 can be expressed using the following notation, where E(K, P)
represents the encryption of plaintext P with key K :
3/2/2018
♥ E(K1, E(K2, E(K3, P))) DES-EEE3 has an effective key length of 168 bits.
64 01/27/2025
♥ The second variant (DES-EDE3) also uses three keys but replaces the second
encryption operation with a decryption operation:
♥ The third version of 3DES (DES-EEE2) uses only two keys, K 1 and K2, as follows:
♥ The fourth variant of 3DES (DES-EDE2) also uses two keys but uses a decryption
operation in the middle: E(K1, D(K2, E(K1, P)))
♥ Both the third and fourth variants have an effective key length of 112 bits .
♥ In DES-EDE2, the reason for using decryption as the second step is the backwards
compatibility with single DES when it is used with K1 = K2.
3/2/2018
♥ That is when K1 = K2 = K then it collapses to single DES
C = E(D(E(P, K), K), K) = E(P, K).
65
Thank you