Professional Documents
Culture Documents
Codes
Codes
CRYPTOGRAPHY
CIPHER LIST
✔ASCII
Type: Substitution
✅Binary
✅Decimal
✅Hexadecimal
✅Octal
✔LATIN CODE
Type: Numbers
> latin alphabet consist of 26 letters. A position in the alphabet is assigned to each letter. The 1 position
for example is assigned to letter a.
A=01 N=14
B=02 O=15
C=03 P=16
D=04 Q=17
E=05 R=18
F=06 S=19
G=07 T=20
H=08 U=21
I =09 V=A
J=10 W=23
K=11 X=24
L=12 Y=25
M=13 Z=26
✔ATBASH
Type: Substitution
> atbash is a type of substitution cipher in which the first letter (a) is substituted to the last letter (z),
second letter(b) is substituted to penultimate (y), and so on.
A=Z
B=Y
C=X
D=W
E=V
F=U
G=T
H=S
I=R
J=Q
K=P
L=O
M=N
Type: Substitution
> ceasar cipher or gronsfeld cipher is a type of encryption to which associated a shift of a fixed number
of a letter (towards left or right). Each letter is then relaced by that obtained after performing the shift.
Encrypt-shift forward
Decrypt-shift backward
Example:
Shift: 3
1.)LOVE
encrypted=ORYH
decrypted=ILSB
2.) JUHDW
encrypted=MXKGZ
decrypted=GREAT
✔CAESAR'S BOX
Example:
HBDY-AIAO-PRYU-PTT-YHO
(Note: arrange it like stack and read by column from top to bottom)
Stack form:
HBDY
AIAO
PRYU
PTT
YHO
✔VANITY CODE
Type: Substitution
Keypad keys:
1=.,
2=abc
3=def
4=ghi
5=jkl
6=mno
7=pqrs
8=tuv
9=wxyz
0=space
Example:
356937 = flower
6676464 = morning
✔MORSE CODE
Type: Trasposition
> morse code is a system to encode thanks to short and long impulses. Each letter or punctuation mark is
associated with a sequence of signals. These signals are translated to the following characters:
A= .-
B= -...
C= -.-.
D= -..
E= .
F= ..-.
G= --.
Η= ....
I= ..
J= .---
K= -.-
L= .-..
M= --
N= -.
O= ---
P= .--.
Q= --.-
R= .-.
S= ...
T= -
U= ..-
V= ...-
W= .--
X= -..-
Y= -.--
Z= --..
Example:
✔KEYWORD CIPHER
Type: Substitution
(Note: keyword given will be inserted as first in the sequence of alphabet and letters should never
repeat)
Example
Keyword: GOD
A=G N=M
B=O O=N
C=D P=P
D=A Q=Q
E=B R=R
F=C S=S
G=E T=T
H=F U=U
I=H V=V
J=I W=W
K=J X=X
L=K Y=Y
M=L Z=Z
✔ROT 13
> 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.
Type:
A=Z
B=Y
C=X
D=W
E=V
F=U
G=T
H=S
I=R
J=Q
K=P
L=O
M=N
✔BACON CIPHER
Type: Substitution
> To encode a message, each letter of the plaintext is replaced by a group of five of the letters 'A' or 'B'.
This replacement is a binary encoding and is done according to the alphabet of the Baconian cipher.
✔REVERSE CIPHER
Types: Words
> two modes are available in this code. First reverses the whole text, second reverses letters word by
word.
Example:
1st mode
✔PLAYFAIR
Type: Substitution
> playfair cipher uses an array of 5x5 containing a keyword or phrase. The first step is to create a grid
based on the key. The second step is to encrypt the letters of the message by selecting them in pairs.
Key: melons
M|E|L|O|N
S|A|B|C|D
F|G|H|I |K
P|Q|R|T|U
V|W|X|Y|Z
Plaintext: VALENTINES
VA LE NT IN ES
Ciphertext: WSOLOUJOMA
WS OL OU JO MA
✔SCYTALE CIPHER
Type: Transposition
> Suppose the rod allows one to write four letters around in a circle and five letters down the side of it.
To decrypt, all one must do is wrap the leather strip around the rod and read across.
(Note: make a table and insert there your input, table is based on diameter)
Example message:
Diameter: 7
H|E|Y| I|W|A|S
D|O| I|N|G|J|U
S|T|F| I|N|E|B
E|F|O|R|E| I|M
E|T|Y|O|U|
Ciphertext: HDSEEEOTFTYIFOYINIROWGNEUAJEISUBM
✔ROTATION CODE
Type: Substitution
(Note: it's formula forencryption is f(x)=(ax)mod26 and for decryption is f(y)=a^-1(y)mod26, where x or y
corresponds to the position of the letter in the alphabet, e.g. a=0, b=1, c=2.....z=25, mod26 correspond
to the limit of the rotation, and a correspond to any input number)
Example: (encryption)
Plaintext: KING
F(x)=(ax)mod26
a=2
K=10, f(x)=(2*10)mod26=20
�I =8, f(x)=(2*8)mod26=16
N=13, f(x)=(2*13)mod26=26
G=6, f(x)=(2*6)mod26=12
K=20=U
I =16=Q
N=26=A
G=12=M
Ciphertext: UQAM
Example: (decryption)
Ciphertext: UQAM
F(y)=a^-1(y)mod26
a=2
U=20, f(y)=2^-1(20)mod26=10
Q=16, f(y)=2^-1(16)mod26=8
A=26, f(y)=2^-1(26)mod26=13
M=12, f(y)=2^-1(12)mod26=6
U=10=K
Q=8=I
A=13=N
M=6=G
Plaintext: KING
(Note: mod26, when no>25, then it will rotate back to 0, 26=0, 27=1, 28=2 and so on, where a=0 and
z=25, e.g. 30=e)
✔AFFINE CIPHER
Type: Substitution
(Note: it's formula for encryption is f(x)=(ax+b)mod n, and for decryption is f(y)=a^-1(y-b)mod n, where
"a" should be coprime of "n", "x" or "y" corresponds on the position of the letter in the alphabet (see
rotation code), and "b" is any value of input, and mod n is the limit of rotation)
Example: (encryption)
Plaintext: AFFINE
F(x)=(ax+b)mod26
A=0, F(0)=(5(0)+8)mod26=8
F=5, F(5)=(5(5)+8)mod26=33
F=5, F(5)=(5(5)+8)mod26=33
I =8, F(8)=(5(8)+8)mod26=48
N=13, F(13)=(5(13)+8)mod26=73
E=4, F(4)=(5(4)+8)mod26=28
A=08=I
F=33=H
F=33=H
I =48=W
N=73=V
E=28=C
Ciphertext: IHHWVC
Example: (decryption)
Ciphertext: IHHWVC
F(y)=a^-1(y-b)mod n
I =08, f(8)=5^-1(8-8)mod26=0
H=33, f(33)=5^-1(33-8)mod26=5
H=33, f(33)=5^-1(33-8)mod26=5
W=48, f(48)=5^-1(48-8)mod26=8
V=73, f(73)=5^-1(73-8)mod26=13
C=28, f(28)=5^-1(28-8)mod26=4
I =0=A
H=5=F
H=5=F
W=8=I
V=13=N
C=5=E
Plaintext: AFFINE
Type: Transposition
(Note: shift depends on no. key or rails, and letters should be written downward and diagonally, let `=no.
of shift or rails)
shift: 3
h```j```m```o```d```s```r```
`e`i`u`t`e`y`u`n`t`i`i`c`a`y
``y```s```t```a```h```s```z`
Ciphertext:
HJMODSREIUTEYUNTIICAYYSTAHSZ
✔POLYBIUS SQUARE
Type: Numbers
> Polybius square, also known as the Polybius checkerboard, is a device invented by the Ancient
Greekhistorian and scholar Polybius, for fractionating plaintext characters so that they can be
represented by a smaller set of symbols.
(Note: create a table of any size, readings should start in column then row)
Example:5x5
⭐A B C D E
A|A|B|C|D|E
B|F|G|H|J|K
C|L|M|N|O|P
D|Q|R|S|T|U
E|V|W|X|Y|Z
Ciphertext: CB CD CC BD AA ED
Plaintext: M O N D A Y
✔VIGENERE CIPHER
Type: Substitution
(Note: keywords sets at the starting point of alphabet and keyword shoud be inserted in the first column
of the table mot in the row, keyword shoud be repeated until it reach the same value or no. of the text )
Example:
Plaintext: JUPITER
Keyword: mapsmap
Ciphertext: VUEAFEG
✔HITMAN CIPHER
If A is A then N is N.
A~A
B~Z
C~Y
D~X
E~W
F~V
G~U
H~T
I~S
J~R
K~Q
L~P
M~O
N~N
Example
Ciphertext: TSHOAN
Plaintext: HITMAN
✔BIFID CIPHER
Type: Substitution
CIPHER: First column and firs row contains numbers while the rest is letters)
Example: 5x5
✴1 2 3 4 5
1|A|B|C|D|E|
2|F|G|H| I |K|
3|L|M|N|O|P|
4|Q|R|S|T|U|
5|V|W|X|Y|Z|
Plaintext: MONSTER
✔TAP CODE
E (. .....) F (.. .)
*space* (null)
✔CLOCK CODES
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(°••••)
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(••°•°)
✔NEWS CIPHER
(Note: make a table of letters, whether theres a keyword or none, 5x5 from A to Z, where C/K and I/J are
interchangeable.)
Legends:
N ~ North
E ~ East
W ~ West
S ~ South
NE ~ North East
NW ~ North West
SE ~ South East
SW ~ South West
A|B|C|D|E
F|G|H|I|J
L | M| N | O | P
Q|R|S|T|U
V | W| X | Y | Z
Example:
Ciphertext: NWFNVNEDSBWISWFN
Plaintext: MARIANA
✔CROSS CODE
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 ~ +++
✔ARROW CODES
(Note: Create a table of letters 5x5 either theres a keyword or none, and moves starts after the first given
letter)
Legends: ←↑↓→
Moves: ¹ ² ³ ⁴
A|B|C|D|E
F|G|H|I|J
L | M| N | O | P
Q|R|S|T|U
V | W| X | Y | Z
Example:
Plaintext: PANDORA
> the pigpen and templar cipher is a geometric simple substitution cipher, which exchanges letters for
sybols which are fragments of grid.
00100001 = !
00100010 = "
00100011 = #
00100100 = $
00100101 = %
00100110 = &
00100111 = '
00101000 = (
00101001 = )
00101010 = *
00101011 = +
00101100 = ,
00101101 =
00101110 = .
00101111 = /
00111111 = ?
01000000 = @
NUMBERS:
00110000 = 0
00110001 = 1
00110010 = 2
00110011 = 3
00110100 = 4
00110101 = 5
00110110 = 6
00110111 = 7
00111000 = 8
00111001 = 9