LEC 3
LEC 3
LEC 3
Data Security :
Classical encryption
Digital Data
Voice ,image, video, and computer
3 data
Definitions
Data Security
Data is any type of stored digital information.
The security of data means the protection of data.
4
Cryptogr
What is
aphy
Cryptography ?
word Cryptography comes from the Greek words
Hidden or secret
writing
No Data
security
Sender
Hello Bob
Receiver
sender receiver
7
Definitio
ns
Encipher (encrypt) : converting plain text to
cipher text
Decipher( decrypt): recovering cipher text from
plain text
Cryptography : study of encryption principles /
methods
Cryptanalysis (code breaking) : the study of
principles / methods of deciphering cipher text
with out knowing
plaintext key message
: the original
Cryptology
cipher text : :the
thecoded
field message
of both cryptography and
cryptanalysis.
Key : information used in cipher known only to
sender / receiver.
EnCipher : algorithm for transforming plain text
to cipher text.
8
Symmetric Cipher Model
1
Classical Method
Substitution Cipher replacement blades
In this type of cipher, encryption would be through the
establishment of a character from the original text
(Plaintext) with another character to be the cipher char,
this substitution would be achieved by collecting the
key to the character of the original text.
Transposition replacement blades
In this type, the encryption is achieved by the
relocation letters of the original text
Some books call this type name (Permutation)
XOR
There are some books that classify this way through
encryption with classical methods, and in spite of the
weakness of these Way, but most modern ciphers rely
on this process in mathematical operation and other
processes
2
Substitution Cipher
3
Substitution ciphers Additive Cipher
Mono-alphabetic
5
ryptography example:
C = E(3, p) = (p + 3) mod 26
p = D(k, C) = (C - k) mod 26
7
Encrypt the message "THIS IS AN EXERCISE"
using a shift cipher with a key of 20. Ignore
the space between words. Decrypt the
message to get the original plaintext.
8
The encrypted message is NBCM CM UH
YRYLWCMY.
9
Substitution
Multiplicative Ciphers
ciphers
Mono-alphabetic
11
Affine
cipher
Algorithm
k = (a , b) is the encryption key
Encryption algorithm Ek(x) = a x + b mod (256 or 26)
Decryption algorithm Dk(y) = a -1 (y - b) mod (256 or 26)
note: (a -1) mod (256 or 26) exists iff gcd (a, 26 or 256) = 1
Cryptanalysis
1. Brute force attack
In case of ASCII plaintext: total number of keys = ((256) 256)
= (2 8 - 2 7) 2 8 = 2 15 = 3.27 10 4
If Affine cipher is poly-alphabetic cipher having m characters
block length then the total number of available keys =
((256) 256)m = (3.27 10 4 )m
2. Statistics of ciphertext
A rearranged version of plaintext statistics
12
Substitution
ROT 13
ciphers
Mono-alphabetic
o ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13 ) is a
simple letter substitution cipher that replaces a letter with the letter
13 letters after it in the alphabet.
o ROT13 is an example of the Caesar cipher, developed in ancient
Rome.
o In the basic Latin alphabet, ROT13 is its own inverse; that is, to undo
ROT13, the same algorithm is applied, so the same action can be
used for encoding and decoding. The algorithm provides virtually no
cryptographic security, and is often cited as a canonical example of
weak encryption.
13
Enigma Rotor Machine
14
Substitution
Atbash
ciphers
Mono-alphabetic
15
Atbas
h
o An easier, simpler and faster way of doing this is:
o First 13 letters: A|B|C|D|E|F|G|H|I|J|K|L|M
o Last 13 Letters: Z|Y|X|W|V|U|T|S|R|Q|P|O|N
o Atbash can also be used to mean the same thing in
any other alphabet as well.
o This is a very simple substitution cipher.
o For example, in Atbash, the letters "nlmvb" indicate
the word "money" Worked Example.
o It is a very weak cipher because it only has one
possible key, and it is a simple monoalphabetic
substitution cipher.
16
Poly alphabetic
Ciphers
Poly-alphabetic
substitution:
1. a = p , b = y ,c
= k.
2. a = b , b = g ,c
= f.
3. a = w , b = e ,c
= s.
17
Poly alphabetic CiphersVigenere cipher
18
Vigenere Cipher (Modern Table)
19
Vigenere Cipher
Cryptanalysis
1. Brute force attack
22
Playfair Cipher
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
2. Plaintext characters that fall in the same row of the matrix are
each replaced by letter to the right, with the first element of the
row circularly following the last. For example, “AR” is encrypted
25 as “RM”.
M O N A R M O N A R
C H Y B D C H Y B D
E F G I/J K E F G I/J K
L P Q S T L P Q S T
U V W X Z U V W X Z
27
Hill cipher
Another interesting multiletter cipher is the Hill cipher. It is
developed by Lester Hill in 1929. The encryption algorithm takes m
plaintext letters and substitutes for them m ciphertext letters. The
substitution is determined by m linear equations in which each
character is assigned a numerical value (a=0 , b=1….………z =25).
For m=3 the cipher gives
C = K P, K is the key
28
Hill cipher Analysis (ctd)
29
Transposition Cipher
30
Transposition Cipher Rail Fance
32
A pure transposition cipher is easily recognized
because it has the same letter frequencies as the
original plaintext. The transposition cipher can be
made significantly more secure by performing more
than one stage of transposition.
Cipher text
Key :
Input:
33
Exampl
e
34
( XOR
Vernam
cipher ) Cipher
Plaintext :
Cipher text
35
Combination Substitution/Transposition Cipher
36
OTP Rules
37
OTP Example (Modulo26)
• Here, we combine the key and the message using
modular addition.
38