Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Cryptology

Letter 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
Ordinal 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Number

Letter 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
Relative 8 1.5 3 4 12.5 2 2 5.5 7 0.1 0.7 4 2.5 7 8 2 0.1 6 6.5 9 3 1 2 0.2 2 0.1
frequency
in %

9.1. Affine Ciphers:


(1) Caesar Cipher

Encoding C ≡ P+3 (mod 26)


Decoding P ≡ C-3 (mod 26)
(2) Shift Cipher
Encoding C ≡ P+k (mod 26)
Decoding P ≡ C-k (mod 26)
(3) Affine Ciphers
Encoding C ≡ aP+k (mod 26)
Decoding P ≡ a-1(C-k) (mod 26)
(4) Vigenère Ciphers
Given a key word w1w2…wn
Encoding C ≡ Pi+ki (mod 26)
Decoding P ≡ Ci-ki (mod 26)
9.2. Hill Ciphers
Encoding: For n = 2:
C1 ≡ aP1+bP2 (mod 26)
C2 ≡ cP1+dP2 (mod 26)
‫ܥ‬ ܽ ܾ ܲଵ
That is ൤ ଵ ൨ = ቂ ቃ ൤ ൨ (݉‫ ݀݋‬26)
‫ܥ‬ଶ ܿ ݀ ܲଶ
Decoding:
ܲ ܽ ܾ ିଵ ‫ܥ‬ଵ
൤ ଵ൨ = ቂ ቃ ൤ ൨ (݉‫ ݀݋‬26)
ܲଶ ܿ ݀ ‫ܥ‬ଶ
ିଵ
ܽ ܾ ଵ ݀ −ܾ
Where ቂ ቃ = (௔ௗି௕௖) ቂ ቃ
ܿ ݀ −ܿ ܽ

Inverses modulo 26: 1-1 = 1 3-1 = 9 5-1 = 21 7-1 = 15 11-1 = 19 17-1 = 23 25-1 = 25

Reference:

1. Thomas Koshy, Elementary Number Theory with Applications, Chapter 9.

You might also like