Documente Academic
Documente Profesional
Documente Cultură
Classic
Data Encryption
Content
Content
Basic Terminology
Introduction
Symmetric Cipher
Caesar Cipher
Base 64 encoding
Monoalphabetic Cipher
Playfair Cipher
Hill Cipher
Vigenre Cipher
Rail Fence Cipher
Row Transposition Cipher
Product Cipher
Base 64 Encoding Table
Page
3
4
5
7
8
9
13
15
17
18
18
19
20
Basic terminology
Plaintext
Ciphertext
Enciphering or encryption
=
=
=
Encryption algorithm
Deciphering or decryption
Decryption algorithm
=
=
Secret key
Cryptography
Cryptography system
Cipher
Block cipher
Stream cipher
Cryptanalysis
Brute force attack
=
=
Key space
Introduction
Encryption is the conversion of data into a form, called a ciphertext, that cannot
be easily understood by unauthorized people. Decryption is the process of
converting encrypted data back into its original form, so it can be understood.
The use of encryption/decryption is as old as the art of communication. In
wartime, a cipher, often incorrectly called a code, can be employed to keep
the enemy from obtaining the contents of transmissions. (Technically, a code is a
means of representing a signal without the intent of keeping it secret; examples
are Morse code and ASCII.) Simple ciphers include the substitution of letters for
numbers, the rotation of letters in the alphabet, and the "scrambling" of voice
signals by inverting the sideband frequencies. More complex ciphers work
according to sophisticated computer algorithms that rearrange the data bits in
digital signals.
In order to easily recover the contents of an encrypted signal, the correct
decryption key is required. The key is an algorithm that undoes the work of the
encryption algorithm. Alternatively, a computer can be used in an attempt to
break the cipher. The more complex the encryption algorithm, the more difficult
it becomes to eavesdrop on the communications without access to the key.
Here I would like to introduce some of the classic encryption:
Symmetric Cipher
A symmetric cipher model
A message
plain text = THIS CIPHER IS CERTAINLY NO SECURE.
m = THISC IPHER ISCER TAINL YNOTS ECURE group it into five
is encrypted to
c = Ee = WKLVF LSKHU LVFHU WDLQO BQRWV HFXUH
Ciphertext = wklvflskhulvfhuwdlqobqrwvhfxuh
Explanation:
c = ciphertext
E = encryption algorithm
d = decryption algorithm
or
or
Y = E(K, X)
X = D(K, Y)
X = plaintext
Y = ciphertext
K = secret key
E = encryption algorithm
D = decryption algorithm
Both E and D are known to public
Substitution Ciphers
Replacing each element of the plaintext with another element
Shift ciphers
Base64 encoding
Monoalphabetic ciphers
Playfair cipher
The Hill cipher
Polyalphabetic ciphers
Shift Ciphers
Caesar cipher
base64 encoding
- A simple substitution cipher obviously looks much too
simple to be able to provide any security, but that is the
case only if you have some idea regarding the nature
of plaintext
- For example, in the plaintext Man , encoded in ASCII
the character M, a and n are stored as bytes 77, 97
and 110 which are the 8-bit binary values 01001101,
01100001 and 01101110. These three values are joined
together into a 24-bit string, producing
010011010110000101101110. Group of 6-bits (6 bits have
a maximum of 26 = 64 different binary values) are
converted into individual numbers from left to right (in
this case, there are four numbers in a 24-bit string),
which are then converted into their corresponding
Base64 character values.
Text content
M
a
n
77 (0x4d)
97 (0x61)
110 (0x6e)
ASCII
Bit pattern 0 1 0 0 1 1 0 1 0 1 1 0 0 0 0 1 0 1 1 0 1 1 1 0
19
22
5
46
Index
Base64-encoded
T
W
F
u
monoalphabetic ciphers
- Basically, Caesar cipher is also a kind of
monoalphabetic ciphers. In monoalphabetic ciphers,
we have a substitution rule that gives us a replacement
ciphertext letter for each letter of the alphabet used in
the plaintext message.
- Lets now consider a seemingly strong monoalphabetic
cipher by making our substitution letters a random
permutation of the 26 letters of the alphabet:
10
H 5.83
F 3.33
B 1.67
C 0.00
Z 11.67
D 5.00
W 3.33
G 1.67
K 0.00
8.33
E 5.00
Q 2.50
Y 1.67
L 0.00
8.33
V 4.17
2.50
0.83
N 0.00
7.50
X 4.17
1.67
0.83
R 0.00
6.67
11
12
Playfair ciphers
- With one character at a time substitution obviously
leaves too much of the plaintext structure in ciphertext.
- So how about destroying some of that structure by
mapping multiple characters at a time to ciphertext
characters?
- In Playfair cipher, you first choose an encryption key.
You then enter the letters of the key in the cells of a 5
5 matrix in a left to right fashion starting with the first cell
at the top-left corner. You fill the rest of the cells of the
matrix with the remaining letters in alphabetic order. In
the following example, the key is playfair example:
P
L
A
Y
F
I
R
E
X
M
B
C
D
G
H
K
N
O
Q
S
T
U
V
W
Z
- Plaintext is encrypted two letters at a time.
- If a pair is repeated letter, insert a filter like X, e.g.
Communication encrypts as Co mx mu ni ca ti on
- If the letters appear on the same row of your table,
replace them with the letters to their immediate right
respectively (wrapping around to the left side of the
row if a letter in the original pair was on the right side of
the row).
e.g. XM becomes MI
- If the letters appear on the same column of your table,
replace them with the letters immediately below
respectively (again wrapping around to the top side of
the column if a letter in the original pair was on the
bottom side of the column). e.g. NU becomes UL
13
14
)(
15
( )
)(
- Ciphertext : LNS
- Decryption Example :
key :
inverse key :
)(
16
Polyalphabetic Ciphers
:
Vigenre cipher
- In a poly alphabetic cipher, on the other hand, the
substitution rule changes continuously from one
character position to the next in the plaintext
according to the elements of the encryption key.
- In the Vigenere cipher, you first align the encryption
key with the plaintext message. ( If the plaintext
message is longer than the encryption key, you can
repeat the encryption key, as I show below where the
encryption key is lemon.) Now consider each letter of
the encryption key denoting a shifted Caesar cipher,
the shift corresponding to the letter of the key.
- E.g. :
Transposition cipher
rail fence cipher
row transposition cipher
17
transposition cipher :
transposition cipher :
18
Products Cipher
- Ciphers using substitutions or transpositions are not
secure because of language characteristic.
- Hence, consider using several ciphers in succession
to make harder :
o Two substitutions make a more complex
substitution
o Two transposition make a more complex
transposition
o A substitution followed by a transposition
makes a new much harder cipher
19
20