P02-Symmetric-key Encryption 3
P02-Symmetric-key Encryption 3
Symmetric-key Encryption
The type of
operations used for The way in which
The number of keys
transforming the plaintext is
used
plaintext to processed
ciphertext
Symmetric,
single-key,
Substitution secret-key, Block cipher
conventional
encryption
Asymmetric,
two-key, or
Transposition Stream cipher
public-key
encryption
Cryptanalysis and
Brute-Force Attack
Cryptanalysis Brute-force attack
• Attack relies on the • Attacker tries every
nature of the possible key on a
algorithm plus some piece of ciphertext
knowledge of the until an intelligible
general translation into
characteristics of the plaintext is obtained
plaintext • On average, half of
• Attack exploits the
all possible keys
characteristics of the must be tried to
algorithm to attempt achieve success
to deduce a specific
plaintext or to
deduce the key being
used
Cryptanalysis
Based on Kerckhoff’s principle, one should always assume that the adversary,
Eve, knows the encryption/decryption algorithm. The resistance of the cipher
to attack must be based only on the secrecy of the key. (Kerckhoff 1883)
Messages
Encryption Scheme Security
Unconditionally secure
No matter how much time an opponent has, it is
impossible for him or her to decrypt the ciphertext simply
because the required information is not there
Computationally secure
The cost of breaking the cipher exceeds the value of the
encrypted information.
The time required to break the cipher exceeds the useful
lifetime of the information.
Substitution Technique
• A shift may be of any amount, so that the general Caesar algorithm is:
C = E(k , p ) = (p + k ) mod 26
• Where k takes on a value in the range 1 to 25; the decryption
algorithm is simply:
p = D(k , C ) = (C - k ) mod 26
Brute-Force
Cryptanalysis of Caesar
Cipher
Example of a key:
Monoalphabetic Cipher
If the “cipher” key can be any permutation of the 26
alphabetic characters, then there are 26! (> 4 x 1026)
possible keys
This is 10 orders of magnitude greater than the key space
for DES
Approach is referred to as a monoalphabetic substitution
cipher because a single cipher alphabet is used per message
Monoalphabetic Ciphers
3.25
Polyalphabetic Ciphers
Example 3.16
We can encrypt the message “She is listening” using the 6-character keyword “PASCAL”.
3.29
Vigenere Cipher: Cryptanalysis
3.30
Kasiski Test
Example 3.19
The Kasiski test for repetition of three-character segments yields the results shown in Table 3.4.
3.31
Example 3.19 (Continued)
The greatest common divisor of differences is 4, which means that the key length is multiple of 4. First try m = 4.
3.32
Autokey Cipher
Assume that Alice and Bob agreed to use an autokey cipher with initial key value k1 = 12. Now Alice wants to send
3.33
Autokey System
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
Example 3.15 (Forouzan)
3.37
Hill Cipher
C = P K (mod 26)
-1
P = C K (mod 26)
3.38
Example
For example, the plaintext “code is ready” can make a 3 × 4 matrix when adding extra bogus character “z” to the
3.39
Assume that Eve knows that m = 3. She has intercepted three plaintext/ciphertext pair blocks (not necessarily from
3.40
Eve makes matrices P and C from these pairs. Because P is invertible, she inverts the P matrix and multiplies it by
Now she has the key and can break any ciphertext encrypted with that key.
3.41
Hill Cipher
3.43
Enigma Machine
A rotor machine developed
in Germany (early 1920s)
Extensively used by the
German army in WWII
Enigma Machine
3.45
Vernam Cipher
One-Time Pad
Simple transposition ciphers, which were used in the past, are keyless.
Example 3.22
A good example of a keyless cipher using the first method is the rail fence cipher. The ciphertext is created reading
the pattern row by row. For example, to send the message “Meet me at the park” to Bob, Alice writes
3.49
Rail Fence Cipher
Alice and Bob can agree on the number of columns and use the second method. Alice writes the same plaintext,
3.51
Keyed Transposition Ciphers
The key used for encryption and decryption is a permutation key, which shows how the character are permuted.
3.52
Combining Two Approaches
Example 3.26
Figure 3.21
3.53
Double Transposition Ciphers
3.54
Steganography
• Character marking
• Selected letters of printed or typewritten text
Classical Techniques: are over-written in pencil
• The marks are ordinarily not visible unless the
paper is held at an angle to bright light
• Invisible ink
• A number of substances can be used for
writing but leave no visible trace until heat or
some chemical is applied to the paper
• Pin punctures
• Small pin punctures on selected letters are
ordinarily not visible unless the paper is held
up in front of a light
• Typewriter correction ribbon
• Used between lines typed with a black ribbon,
the results of typing with the correction tape
are visible only under a strong light
Summary