decryption ciphers

advertisement
Network Security
Vocabulary:
Cryptography
Cryptanalysis
Cipher
Plaintext
Ciphertext
Encryption ≠ Decryption
Classes of encryption algorithm
1. one – key cryptography ( symmetric cryptography)
In this class used the same key for encryption and decryption.
Plaintext
Ciphertext
Encryption
Plaintext
Decryption
Symmetric cryptography
2. "Asymmetric cryptography"
In this class used two keys called – public key and private key.
Private key
Plaintext
Encryption
Public Key
Ciphertext
Decryption
Asymmetric cryptographyِِ
Ciphertext
Tradition cryptography could be divided into:
- transposition ciphers
- substitutions ciphers
- Transposition ciphers: In Transposition Ciphers plain letters are simply
rearranged
In Substitution Ciphers same plain letters are
replaced by same cipher letters.
- Substitutions ciphers:
 Transposition cipher
Meet me at noon
Encoding
Decoding
noonta em teem
Rail fence Algorithm
Rail fence Algorithm divides the word/sentence into two rows and
combines them.
Example :
Encode the following sentence using Rail fence Algorithm:
"Transposition ciphers can easily be broken"
t
a
s
o
i
i
n
i
h
r
c
n
a
i
y
e
r
k
r
n
p
s
t
o
c
p
e
s
a
e
s
l
b
b
o
e
The cipher text will be:
"Tasoiinihrcnaiyerknrnpstocpesaealbboe"
Rout cipher algorithm:
In this algorithm, the letters divided into elements, the element could
be only 1 letters then divide the elements into several levels and make a
keyword on the rows to show the rows arranging.
n
(The size of matrix and keyword should be agreement between the sender
and receiver)
Example:
"Transposition ciphers can easily be broken"
Matrix will be 14(columns) * 3(rows)
Keyword CAT
C
A
T
t
r
a
n
s
p
o
s
i
t
i
o
n
c
i
p
h
e
r
s
c
a
n
e
a
s
i
l
y
b
e
b
r
o
k
e
n
X
X
The cipher text will be:
"rssichsnsybkxtnotnpraaleonapioieceibrex"
In order to decoding the ciphertext fill the following table by alphabet of
CAT:
C
A
T
r
s
s
i
c
h
s
n
s
y
b
k
X
Exercise:
Cipher text: llcleafjlgaaoex
Matrix : 3 (rows) – 5 (column)
Keyword : CAT
Encode the Cipher text using Rout cipher algorithm.
*****
Transposition Cipher and Substitution Cipher at the same time
(Fractionation systems)
Example on Fractionation systems is a "ADFGVX Code":
"ADFGVX Code" use matrix (6*6) to exchange 26 letters of English
Language and 10 numbers.
A
D
F
G
V
X
O
r
a
n
g
e
A
B
c
d
f
h
i
D
J
k
l
m
p
q
F
S
t
u
v
w
x
G
Y
z
0
1
2
3
V
4
5
6
7
8
9
X
The keyword
Principle of coding using "ADFGVX Code"
1. In this method used keyword in the first row of matrix.
2. The initial ciphertext will be inserted into new matrix, where the
letters' places will be exchange.
Example: Encode the following word:
"Cryptography", the keyword is "orange"
Answer:
A
F
G
V
X
A
O
D
D
F
G
V
X
B
J
S
Y
4
c
k
t
z
5
d
l
u
0
6
f
m
v
1
7
h
p
w
2
8
i
q
x
3
9
The plaintext:
r
a
c
r
y
n
p
t
g
o
g
e
r
a
p
h
y
DD AD VA FV GD AA AV AD AF FV DV VA
The initial
ciphertext
The initial ciphertext will be inserted into the column of a new matrix of
exchange places (leftright) using new keyword (water: in our example).
w
a
t
e
r
5
1
4
2
3
D
D
A
D
V
A
F
V
G
D
A
A
A
V
A
D
A
F
F
V
D
V
V
A
A
‫ تشير إلى الترتيب االبجدي للكلمة‬5 ‫ إلى‬1 ‫االرقام من‬
water
The final ciphertext reading by alphabetic of keyword "water" ===>
"DFAAVDGVFAVDAVAAVAFVDAADD"
How
decoding
the
final
(DFAAVDGVFAVDAVAAVAFVDAADD)?
1. build the last matrix using keyword "water":
w
a
t
e
r
5
1
4
2
3
D
F
A
A
ciphertext
V
‫ تشير إلى الترتيب االبجدي للكلمة‬5 ‫ إلى‬1 ‫االرقام من‬
water
2. get the initial ciphertext
DD AD VA FV GD AA AV AD AF FV DV VA
3. put the initial ciphertext into the first matrix using keyword"orange"
A
A
O
D
r
F
a
B
c
d
D
J
k
l
F
S
t
u
G
Y
z
0
V
4
5
6
X
4. From this matrix get the plaintext.
G
V
X
f
m
v
1
7
h
p
w
2
8
i
q
x
3
9
n
g
e
Exercise 1:
Decode the following text:
n
a
s
e
r
"aadaa daaaa gfaaa ggaaa afaaa"
First keyword: hadi
Second keyword: naser
3
1
5
2
4
g
a
a
d
g
f
a
f
A
g
a
d
a
a
a
a
a
a
a
a
GAADGFAFAGADAAAAAAAAAAAAA
A
D
F
G
E
M
S
Y
4
f
n
t
z
5
g
o
u
0
6
j
p
v
1
7
H
A
D
F
G
V
X
a
d
i
ga
ad
gf
af
ag
ad aa
aa
s
a
u
d
i
a
h
h
h
V
b
k
q
w
2
8
X
c
l
r
x
3
9
V
b
k
q
w
2
8
X
c
l
r
x
3
9
h
Exercise 2:
Encode the following word:
"Saudia"
First keyword: hadi
Second keyword: naser
A
D
F
G
V
X
A
D
F
G
E
M
S
Y
4
f
n
t
z
5
g
o
u
0
6
j
p
v
1
7
H
The plaintext:
The initial ciphertext
a
d
i
s
a
u
d
ga
ad gf
af
ag ad
f
a
n
3
g
i
a
a
a
a
a
a
a
a
a
1
a
a
d
a
a
s
5
a
f
a
a
a
e
2
d
A a
a
a
r
4
g
g
a
a
a
The final ciphertext: aadaa daaaa gfaaa ggaaa afaaa
Download