Week 15 Cryptography
Week 15 Cryptography
Methods of Cryptography:
1.) Shift Cipher (Ceasar Cipher)
2.) Using a Modulo Operator
ABCDEFGHIJKLMNOPQRSTUVWXYZ
This means that after shifting C thrice to the right, its equivalent is F.
Step 3: Form the encrypted message. CRYPTOGRAPHY – FUBSWRJUDSKB
ABCDEFGHIJKLMNOPQRSTUVWXYZ
ABCDEFGHIJKLMNOPQRSTUVWXYZ
ABCDEFGHIJKLMNOPQRSTUVWXYZ
CRYPTOGRAPHY
Example 2: Decrypt to cipher text, “BJY DN BJJY”, using the key of 5 shifts to
the left.
Solutions:
Step 1: Write the letters of the English alphabet.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Step 2: Make 5 shifts from the given letter going to the right (opposite of the
given direction when the process involved is decryption).
ABCDEFGHIJKLMNOPQRSTUVWXYZ
This means that after shifting B five times to the right (opposite direction, its equivalent is G.
“BJY
Step 3: Form the DN BJJY”
encrypted – “GOD IS GOOD”
message.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
CRYPTOGRAPHY
USING MODULO OPERATOR – the sender of the message uses the key K
to encrypt and to decrypt the secret message. The key K may have any
integer value from 0 to 25 and this will be shared to the person/s who
will be receiving the secret message.
Step 2: M M W I S F U N T O L E A R N
12 12 22 8 18 5 20 13 19 14 11 4 0 17 13 C
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 +K
17 17 27 13 23 10 25 18 24 19 16 9 5 22 18 C+K
Step 3: Since 27 exceeded 25, apply modulo operator to find its equivalent.
That will be Y = 27mod26 which is equal to 1. Converting every Y into a
letter in the english alphabet we have RRB NX KZS YT QJFWS.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
CRYPTOGRAPHY
Steps in Decrypting Message:
Step 1: Express the letters of the alphabet into an integer from 0 to 25,
that matches its order, for example, A=0, B=1, C=2, . . ., then label
them as Y.
Step 2: Calculate C = (Y – K)mod26, for every letter of the decrypted
message.
Step 3: Convert the number C into a letter following the order of the
letter of the alphabet.
R R B N X K Z S Y T Q J F W S
Step 2: 17 17 1 13 23 10 25 18 24 19 16 9 5 22 18 Y
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 – K
12 12 - 4 8 18 5 20 13 19 14 11 4 0 17 13 Y–K