You are on page 1of 16

CRYPTOLOGY

Cryptology The message


the study of making and breaking codes. after it is coded

The message
before it is coded

Method changing
from ciphertext
to plaintext

Method changing
from plaintext to
ciphertext
CEASAR CIPHER
(CYCLICAL ENCRYPTING)
To encrypt, To decrypt,
key

𝐜 ≡ 𝐩 + 𝐦 𝐦𝐨𝐝 𝟐𝟔 𝐩 ≡ 𝐜 − 𝐦 𝐦𝐨𝐝 𝟐𝟔
Numerical equivalent of
the plaintext letter
Numerical
equivalent of the
ciphertext letter
CEASAR CIPHER
(CYCLICAL ENCRYPTING)
PLAINTEXT P ENCRYPTING (KEY = 5) CIPHERTEXT
S 18 18 + 5 mod 26 ≡ 23 X
I 8 8 + 5 mod 26 ≡ 13 N
N 13 13 + 5 mod 26 ≡ 18 S
G 6 6 + 5 mod 26 ≡ 11 L
K 10 10 + 5 mod 26 ≡ 15 P
O 14 14 + 5 mod 26 ≡ 19 T
CEASAR CIPHER
(CYCLICAL ENCRYPTING)
CIPHERTEXT C DECRYPTING (KEY = 5) PLAINTEXT
X 23 23 – 5 mod 26 ≡ 18 S
N 13 13 – 5 mod 26 ≡ 8 I
S 18 18 – 5 mod 26 ≡ 13 N
L 11 11 – 5 mod 26 ≡ 6 G
P 15 15 – 5 mod 26 ≡ 10 K
T 19 19 – 5 mod 26 ≡ 14 O
AFFINE CIPHER
To encrypt, To decrypt,

𝐜 ≡ 𝐚𝐩 + 𝐦 𝐦𝐨𝐝 𝟐𝟔 𝐩 ≡ 𝐛 𝐜 − 𝐦 𝐦𝐨𝐝 𝟐𝟔

Another key such that Multiplicative inverse of “a in mod 26”


gcd(a,26) = 1.
AFFINE CIPHER
PLAINTEXT P ENCRYPTING (A=5;M=2) CIPHERTEXT
G 6 5∙6 + 2 mod 26 ≡ 6 G
O 14 5∙14 + 2 mod 26 ≡ 20 U
U 20 5∙20 + 2 mod 26 ≡ 24 Y
S 18 5∙18 + 2 mod 26 ≡ 14 O
T 19 5∙19 + 2 mod 26 ≡ 19 T
E 4 5∙4 + 2 mod 26 ≡ 22 W
AFFINE CIPHER
CIPHERTEXT C DECRYPTING (B=21;M=2) PLAINTEXT
G 6 21(6 – 2) mod 26 ≡ 6 G
U 20 21(20 – 2) mod 26 ≡ 14 O
Y 24 21(24 – 2) mod 26 ≡ 20 U
O 14 21(14 – 2) mod 26 ≡ 18 S
T 19 21(19 – 2) mod 26 ≡ 19 T
W 22 21(22 – 2) mod 26 ≡ 4 E
VIGENÈRE CIPHER
Is a poly-alphabetic substitution
system.
When using the Vigenère cipher, a
keyword is required in addition to the
plaintext. This keyword is repeated so
that the total length is equal to that of
the plaintext.

To encrypt, locate the 1st letter of the


of the plain text in the 1st row of the
table and the 1st letter of the key on
the 1st column. The cipher letter is at
the intersection.
VIGENÈRE CIPHER
To decrypt,

𝐩 ≡ 𝐜 − 𝐦 𝐦𝐨𝐝 𝟐𝟔
VIGENÈRE CIPHER

Encrypt DAGOHOY
with keyword UST
RSA PUBLIC-KEY CRYPTOGRAPHY
Rivest – Shamir – Adleman
Is used largely to secure highly sensitive data and information especially
when these data and information are sent over networks like the internet

STEPS:
1. Choose two prime numbers p and q.
2. n = pq
3. z = (p – 1)(q – 1)
4. Randomly choose e such that
• 1 < e <z
• gcd(e,z) = 1
RSA PUBLIC-KEY CRYPTOGRAPHY
5. Solve for d where:
ed ≡ 1 mod z (multiplicative inverse of e in Zz)
6. To encrypt,
M ≡ Ne mod n N = plaintext
7. To decrypt, M = ciphertext
N ≡ Md mod n

Note: To encrypt a message, each letter of the alphabet is given a number; for
instance, A = 11, B = 12, C = 13, … .Now replace each letter in the message with its
number equivalent. Using our coding scheme, the word MATH would be 23 11 30
18.
RSA PUBLIC-KEY CRYPTOGRAPHY
Encrypt, MATH where p = 59 and q = 83.
n = 4897 z = 4756
e = 129 M ≡ Ne mod n
d = 1401
We use A = 11, B = 12, C = 13, …

PLAINTEXT P ENCRYPTING CIPHERTEXT


M 23 23129 mod 4897 3065
A 11 11129 mod 4897 2001
T 30 30129 mod 4897 957
H 18 18129 mod 4897 2753
RSA PUBLIC-KEY CRYPTOGRAPHY
Decrypt MATH where p = 59 and q = 83.
n = 4897 z = 4756
e = 129 N ≡ Md mod n
d = 1401
We use A = 11, B = 12, C = 13, …

CIPHERTEXT DECRYPTING P PLAINTEXT


3065 30651401 mod 4897 23 M
2001 9571401 mod 4897 11 A
957 20011401 mod 4897 30 T
2753 27531401 mod 4897 18 H
RSA PUBLIC-KEY CRYPTOGRAPHY
Encrypt CAB where p = 3 and q = 5.
Use A = 2, B = 3, C = 4, …

How about p = 5 and q = 11??

You might also like