Professional Documents
Culture Documents
Cryptography and Computer Security
Cryptography and Computer Security
Cryptography and Computer Security
Security
Basics
terminology of cryptography
and Information security
What is cryptography ?
X
Y
Z
50
50
M= 24
Plain text 50-26=24
+26 =
Key
50
Decryption process
Encryption process
Cipher text
n × (n – 1)/2.
Cryptanalyst
S R
X
Message X Encryption Y Decryption
source algorithm algorithm
Cryptosystem
Contains (P, C, K, E, D)
P
(k)
(k)
Encryption function
ek(P)=C Decryption function
dk(C)
Dk(ek(P)
P
Keyless Schemes
Keyed Schemes
Keyless Schemes
reversed
Keyed Schemes
• Using key
writing the plaintext out in rows, and then reading the cipher text off in
columns.
T R E E
- I S -
G R E E
N - - -
RIR_ESE_T_GN E_E_
Decryption
Divide the length of the cipher text by the length of the
keyword to get the depth of the column
H A C K
3 1 2 4
T R E E
_ I S -
G R E E
N _ _ -
TREE IS GREEN
Example
Encrypt the message BUY SOME BEER AND FOOD Using transposition
cipher with keyword MONEY
M O N E Y
2 4 3 1 5
2 4 3 1 5
B U Y - S
O M E - B
E E R - A
N D - F O
O D - - -
Encryption
A key less cipher
Depth and plain text is given
Use zigzag for encryption and decryption
As the depth increases increase the complexity
Example
H L O O L
E L W R D
H - - - -
- - - - -
H L O O L
E L W R D
Depth=3
H O L
E L W R D
L O
H - -
- - - - -
- -
On the first row two letters, the second row 5 letters and the last two
H O L
E L W R D
L 0
Depth =4
???
“meet me after the class is over”
m a h s r
e e f t e s i e
e m t r c a s v
t e l o
Cipher Text=
mahsreeftesieemtrcasvtelo
Decrypt the cipher text shown below
mahsreeftesieemtrcasvtelo
Need to try each key in turn until the message appears. The
maximum key size is the length of the plain text. So, need
to try starting from N-1
X=Z26={0,1,2,3…25}
C= Z26
K= Z26
Encryption
ek=(X)=(X+K)MOD26=Y ∈ Z26
Decryption
dk(Y)=(Y-K)MOD26
X Y
(K=15)
“Hello” (K=15)
Z
Example
K=15
X=Hello
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 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
“HELLO”
WTAAD
Decryption
Note
This technique can be easily broken using brute force attack
By trying all 25 possible keys until get a meaningful text
Decryption
CIPHER TEXT= WTAAD
22 19 0 0 3
dk(Y)= (22-15) mode 26 =7
dk(Y)= (19-15) mode 26 =4
dk(Y)= (0-15) mode 26 =11
dk(Y)= (0-15) mode 26 =11
dk(Y)= (3-15) mode 26 =14
HELLO
Caesar Cipher
simplest method of encryption technique
Letters are replaced by other letters
En=(P.T+K) mod 26
Dn=(C.T-K) mod 26
Example:
P.T= Hello
K=7
C.T=? C.T= OLSSV
How do you modify a Caesar cipher for a better security?
?
Substitution cipher
Mono Alphabet
Every alphabet is mapped with fixed alphabet
Simple
brute-force attack infeasible because Φ=26!=288
X=C= set of alphabet=A
={A,B,C…Z}
Φ:A=26!
K={ φ}
e Φ(X)= Φ(X)=Y
d Φ(Y)= Φ-1(Y)
“Hello”
Example
Plain text= THISISCRYPTOSYSTEM
M=6
Key=CIPHER
Find the cipher text?
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 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
19 7 8 18 8 18 2 17 24 15 19 14 18 24 18 19 4 12
2 8 15 7 4 17 2 8 15 7 4 17 2 8 15 7 4 17
21 15 23 25 12 9 4 25 13 22 23 5 20 6 7 0 8 3
V P X Z MJ E Z N WX F U G H A I D
Ex.
Plain text= Thequickbrownfoxjumpsoverthelazydog
M=5
Key=SOLVE
Find the cipher text?
Playfair Cipher
Generate the key Square(5×5): The key square is a 5×5 grid of alphabets
Algorithm to encrypt the plain text: The plaintext is split into pairs of two letters
P.T= Welcome
C.T=?
Encryption
We lc om e
We lc om ex
vx rn sm xm
HE LX OX
DM YR QE
Rules for Decryption: If both the letters are in the same column: Take the letter above
each one (going back to the bottom if at the top).
For example:
Diagraph: "cl"
Decrypted Text: me
Decryption: c -> m l -> e
•If both the letters are in the same row: Take the letter to the left of each one
(going back to the rightmost if at the leftmost position).
For example:
Diagraph: "tl"
Decrypted Text: st
Decryption: t -> s l -> t
•If neither of the above rules is true:
•Form a rectangle with the two letters and take the letters on the
horizontal opposite corner of the rectangle.
For example:
Diagraph: "rq"
Decrypted Text: nt
Decryption: r -> n q -> t
Hill Cipher (Reading Assignment)
Always consider M x M matrix for key and separate the plain text in
two M pairs.
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
P,K 0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
C=K.P mod 26
Example Plain text “Hello World” and generate cipher text
K= 2 1
3 4 = He ll ow or ld
=P H
E
=P 7
4
?
How can the security of play fair ciphers be increased?
Project
Block cipher
64 or 128 bits
Feistel cipher
A traditional block cipher
Why?
Similar questions like why von Neuman? Why 8086 MP
Feistel cipher architecture
R1
R2
.
.
.
Rn
Encryption Process
In each round, the right half of the block, R, goes through unchanged. But
the left half, L, goes through an operation that depends on R and the
encryption key.
For 8 bit plain text and 6 bit key ,sub key generation will be
.
.
.
Example