Vigenere Cipher

166 12 2
                                        

VIGENERE CIPHER

This tutorial uses calculations based on MODULUS function.

A = 0
B = 1
C = 2
D = 3
E = 4
F = 5
G = 6
H = 7
I = 8
J = 9
K = 10
L = 11
M = 12
N = 13
O =14
P = 15
Q = 16
R = 17
S = 18
T = 19
U = 20
V = 21
W = 22
X = 23
Y = 24
Z = 25

Encryption:
с = ( м + к )MOD26
Decryption:
м = ( с - к )MOD26
where,
с is the value of the cipher text letter,
м is the value of the plaintext letter, and
к is the obtained by repeating the keyword [n/m] times, m = keyword length

Steps and Examples:
A. Encrypt the word "HELLO" using the keyword "ACE".
1. Create a key from the keyword to match the number of letters of the message.
The message has 5 letters so we will increase the keyword length by 2 letters.
The generated key would be "ACEAC"
(repeat the keyword until there is enough letters)
2. Now that you have a complete key for the message, it's now time for the calculation.
We will encrypt the letters one by one until the whole word is encrypted.
Using the formula for encryption:
a) encrypt H using A given that H = 7, A = 0
с = ( 7 + 0 )MOD26
с = ( 7 )MOD26
с = 7 → H  << this is now the encrypted letter

b) encrypt E using C given that E = 4, C = 2
c = ( 4 + 2 )MOD26
c = ( 6 )MOD26
c = 6 → G

c) encrypt L using E given that L = 11, E = 4
c = ( 11 + 4 )MOD26
c = ( 15 )MOD26
c = 15 → P

d) encrypt L using a given that L = 11, A = 0
c = ( 11 + 0 )MOD26
c = ( 11 )MOD26
c = 11 → L

e) encrypt O using C given that O = 14, C = 2
c = ( 14 + 2 )MOD26
c = ( 16 )MOD26
c = 16 → Q

3. Now that you have encrypted every letter, form the encrypted word.
Message: "HELLO"
Keyword: "ACEAC"
Encrypted: "HGPLQ"

B. Decrypt "HGPLQ" using the same keyword.
1. Decrypt each letter using the decryption formula:
a) decrypt H using A given that H = 7, A = 0
м = ( 7 - 0 )MOD26
м = ( 7 )MOD26
м = 7 → H

b) decrypt G using C given that G = 6, C = 2
м = ( 6 - 2 )MOD26
м = ( 4 )MOD26
м = 4 → E

c) decrypt P using E given that P = 15, E = 4
м = ( 15 - 4 )MOD26
м = ( 11 )MOD26
м = 11 → L

d) decrypt L using A given that L = 11, A = 0
м = ( 11 - 0 )MOD26
м = ( 11 )MOD26
м = 11 → L

e) decrypt Q using C given that Q = 16, C = 2
м = ( 16 - 2 )MOD26
м = ( 14 )MOD26
м = 14 → O

2. As you can see, the message "HGPLQ" decrypts into the word "HELLO".

-----------
-----------
Mukang mahirap, pero madali lang ean:)
Please Vote!
Thank you!

Codes And Ciphers (Complete)Where stories live. Discover now