Cryptography is a method to transmit sensitive data across insecure networks (Internet). This method allows encrypting and decrypting data so that the message cannot be read by anyone other than the intended recipient, similar to barcode labels. Cryptography is used for securing data and cryptanalysis is for breaking and analyzing secure communications.
In cryptography, the original text is called plaintext and the altered text is called cipher text. The conversion from plaintext to cipher text is called encoding and the conversion from cipher text to plaintext is called decoding.
How does Cryptography Work?
A cryptographic algorithm is used for encryption and decryption process. This algorithm works in combination with a key to encrypt a plaintext. The same plaintext is encrypted to different cipher text by different keys. The security of the cipher text is based on two things: the strength of the algorithm and the key secrecy.
Different Types of Cryptographic Techniques
There are many types of cipher systems and they all can be categorized as either substitution (replace characters, bits, or blocks of characters with substitutes) or transposition (rearrange characters or bits in the information) or combination of the two.
Caesar Cipher: Caesar cipher is a simplest example of a substitution cipher in which the cipher text is obtained by shifting each letter in the plaintext to a fixed number of positions down the alphabet. This method is named after Julius Caesar, who used it to communicate with his generals. The cipher text can be obtained by rotating plaintext to the left or right by fixed number of positions.
Example:
Plaintext: hello Cipher text: kioor
Atbash: Atbash is the simplest form of substitution cipher for the Hebrew alphabet. In this method the first is substituted with the last letter, the second letter is substituted with the one before last, and so on, reversing the alphabet.
Example:
The substitutions for the alphabet are:
ABCDEFGHIJKLM
ZYXWVUTSRQPON
Plaintext: this is fun Cipher text: gsrh rh ufm
Monoalphabetic substitution: A monoalphabetic substitution is a permutation of the alphabet. In this method, same plaintext letters are always encrypted to the same cipher text letters. The key is used to map the plaintext with a substitute letter in the cipher text. The simplest examples of monoalphabetic substitutions are Caesar cipher and Atbash.
Example:
Alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Key: QAZXSWEDCVFRTGBNHYUJMKIOLP
Plaintext: it works
Cipher text: cj inyfu
Polybius Cipher: The Polybius cipher is invented by the Greek historian Polybius. This principle is mainly applied for messages that can be transmitted over distances in audible or optical ranges. This method is occasionally used in the twentieth century. In this method, every character is assigned to a specific column in a matrix. A character is then transmitted by light signals or with knocking signs.
Example:
1 |
2 |
3 |
4 |
5 |
|
1 |
Q |
W |
E |
R |
T |
2 |
A |
S |
D |
F |
G |
3 |
Z |
X |
C |
V |
B |
4 |
Y |
U |
I |
O |
P |
5 |
H |
J |
K |
L |
N |
Here, the character H corresponds to the number 51 and the character O to 44. The word “Hello” can therefore be encoded by 51 13 54 54 44.
Checkerboard: The checkerboard cipher is a 5×5 Polybius matrix in which each plaintext is corresponded by two letters (digraph).
Example:
B |
L |
A |
C |
K |
|
G |
Q |
W |
E |
R |
T |
R |
A |
S |
D |
F |
G |
E |
Z |
X |
C |
V |
B |
E |
Y |
U |
I |
O |
P |
N |
H |
J |
K |
L |
N |
Here, the letter A is represented by RB and L is represented by NC.
Plaintext: good
Cipher text: RK EC EC RA
Vigenère Cipher: The Vigenère Cipher is a polyalphabetic cipher, developed by Blaise de Vigenère in the 16th century. This uses two or more alphabets to encrypt the message.
Example:
Vigenère Square
|
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 |
A |
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 |
B |
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 |
A |
C |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
D |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
E |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
F |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
G |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
H |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
I |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
J |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
K |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
L |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
M |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
N |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
O |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
P |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
Q |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
R |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
S |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
T |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
U |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
V |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
W |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
X |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
Y |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Z |
Z |
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 |
This square is a series of Caesar ciphers. The first letter has a shift of 1, the second a shift of 2, and so on, the shifting continues. In this method, the key is written as many times it is necessary.
G |
O |
O |
D |
G |
H |
E |
L |
L |
O |
N |
S |
Z |
Z |
U |
Key:
Plaintext:
Cipher text: