Chapter 5 - Cryptography
Chapter 5 - Cryptography
CRYPTOGRAPHY
RAM VILLAROSA JR.
Objectives
❑Describe the most significant events and discoveries in the
history of cryptography.
❑Understand the basic concepts of cryptography.
❑Learn the processes involved with encryption and
decryption of cipher methods.
❑Perform encryption and decryption using different cipher
methods.
Topics
01 Cryptography
03 Module Arithmetic
02 Cipher methods
01
History of
Cryptography
Cryptography
Cryptography is a method of
communication used to reach the
recipient, with unaltered message and
to protect the content of the message
from the unintended receiver.
The word “cryptography” is derived
from the Greek words “kruptos,” and
“graphein” which means “hidden or
secret” and to “write” respectively.q
Cryptography
Egyptian Hieroglyphic Alphabet
Cryptographic Systems (Julius Ceasar)
Modern Times
Machine Ciphers
Jefferson Cylinder
A manual polyalphabetic substitution cipher cylinder invented by
Thomas Jefferson in 1795.
Wheatstone Disc
A polyalphabetic cipher disc that is said to be originally invented by Decius
Wadsworth and further developed by Charles Wheatstone and named after him.
Enigma Machine
This machine was officially invented by Arthur Scherbius in 1918 and
in 1933 the manufacturing rights was acquired by German Army.
Cryptography
Encryption Decryption
✓ The method of transforming a ✓ The method of transforming
plain or ordinary text into ciphertext into plain or ordinary
ciphertext. text.
✓ The sender is the one who does ✓ The receiver does the
the encryption process. decryption process.
✓ Data is called the ciphertext. ✓ Data is called the plain text.
✓ A public key or secret key is ✓ A secret key or private key is
used. used.
✓ The data or message is sent ✓ The data or message is to be
once it is encrypted. decrypted once it is received.
Basic Functions of Cryptography
1. Confidentiality. This principle adheres to specific policies
implemented in accordance with confidentiality agreements which
guarantee that the information is confined to specific people or places.
2. Authentication. It is the process which guarantees that the data
received was originated from the claimant originator.
3. Integrity. It is the manner of making sure that no alteration took place
anywhere on the transmission path.
Basic Functions of Cryptography
4. Non - Repudiation. The ability to ensure that a person or a party
bound to the agreement or communication cannot deny their signature
over their document or their message sending.
5. Key Exchange. The process of sharing secret keys between the sender
and the receiver.
Possible Attacks on Cryptography
1. Brute Force Attack. It is a direct attack that attempts all the possible
keys.
2. Replay Cryptography Attack. The attack targets the cryptographic
algorithms wherein the attackers try to request authentication while the
data is in transit so they can understand the key and eventually capture
the data.
3. Man in the Middle Attack. The attacker is in between the
communicating parties, intercepting all the information relayed,
including setting up a cryptographic session and the obtained
information is used to hack the data shared.
Possible Attacks on Cryptography
4. Implementation Attack. The attacker checks the weaknesses in the
process and the focus of this attack is on software errors and all those
that are found in the encryption system’s implementation.
5. Statistical Attack. The attack is on the statistical weakness of the
system, basically in the operating system or hardware involved in
hosting cryptography tools.
6. Ciphertext Only Attack. The attacker knows the ciphertext used in
several communications encrypted with the use of similar encryption
algorithm and apply the simple technique such as frequency analysis.
Possible Attacks on Cryptography
7. Chosen Ciphertext Attack. The attacker basically looks for the parts of
the decrypted ciphertext and compares them to the plaintext to figure
out the encryption key that helps to perform the hacking.
8. Known Plaintext. The attacker already knew the encrypted message
as well as the data used for the purpose of creating the ciphertext,
which aid the attack.
9. Chosen Plaintext Attack. The attacker applies gambling by choosing a
plaintext to match the produced ciphertext and analyze both words to
work out the key and figure out the whole encryption process, and allow
him to decrypt other messages.
Division of Cryptography
Classical Cryptography Modern Cryptography
Methods of Encryption Methods of Encryption and
- Substitution Decryption
- Transposition - Stream Cipher
- Block Cipher
02
Modulo Arithmetic
Modulo arithmetic is a special type of arithmetic
that involves only integers, which is also known as
clock arithmetic and the mathematics of
congruences.
A clock of 12 - hour time uses modulo 12. If the
time now is 5 o’clock in 12 hours clock,
determine the time after 18 hours from now
Solution:
5 + 18 = 23 add
23/12 = 1 remainder 11 divide
Modulo arithmetic operates as “wrap around” or “reset to
zero” when the modulus value is reached. It serves as the
cornerstone of almost all crypto algorithms, both the
symmetric and asymmetric key ciphers. Modulo arithmetic
also functions as the remainder function as it is only the
remainder that is considered.
The formula for calculating the modulo is:
A/B = Q remainder R
where:
A = dividend
Q = quotient
B = divisor
R = remainder
To write in modulo notation:
A modulo B =R
where:
B = modulus
Solve for 5 mod 7.
Solution:
Divide A by B to find the remainder.
5 ÷ 7 = 0 Remainder 5
Write = 2 remainder 3 into modulo notation
15/6 mod 6 = 3
Write = 1 remainder 2 into modulo notation
5/3 mod 3 = 2
Properties of Modulo
Let n be an integer greater than 1, and let a and b be any integers, then
• If a mod n = b mod n, then there is an integer k such that a − b = k • n
• (a + b) mod n = ((a mod n) + (b mod n)) mod n
• (a • b) mod n = ((a mod n) • (b mod n)) mod n
• −a mod n = n − (a mod n)
03
Cipher Methods
ATBASH CIPHER
The Atbash cipher is a simple cipher method, believed to be
found in ancient Israel. The process for both the encryption
and decryption uses one key as the alphabet is simply
reversed.
ATBASH CIPHER
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
Z Y X W V U T S R Q P O NM L K J I H G F E D C B A
Decipher the given message using Atbash Cipher:
NZGSVNZGRXH RH GL WL
GOD BLESS US
CEASAR’S CIPHER/ SHIFT CIPHER
A shift cipher is one of the most famous encryption systems,
which is also referred to as Caesar cipher, named after Julius
Caesar who utilized it mainly to communicate to his generals
in the battlefield in order to keep the content of the
message safe from being intercepted by unauthorized
receiver. The process involved is the shifting of a letter to
number of places based on the given key.
CEASAR’S CIPHER/ SHIFT CIPHER
Example: Decrypt this message, which was enciphered using a Caesar Shift: Key =3
a b c d e f g h i j k l mn o p q r s t u v w x y z
D E F GH I J K L MNO P Q R S T U VWX Y Z A B C
a b c d e f g h i j k l mn o p q r s t u v w x y z
QFILZFLJ”
CEASAR’S WHEEL
encrypting and decrypting messages using the decoder
wheel.
Note: ENCIPHERING – Large Circle to Small Circle
DECIPHERING – Small Circle to Large Circle
CEASAR’S WHEEL
Example: Decrypt this message, which was enciphered using a Caesar Shift: Key =3
VRXO
MONO-ALPHABETIC SUBSTITUTION CIPHER
Example: Key = MANUSCRIPT
a b c d e f g h i j k l mn o p q r s t u v w x y z
M A N U S C R I P T B D E F G H J K L O Q V W X Y Z
Decode the message:
AQO PF EY GHPFPGF, MDD OIPFRL PF
KSFS USLNMKOSL
MONO-ALPHABETIC SUBSTITUTION CIPHER
Example: Key = TRIANGLE
a b c d e f g h i j k l mn o p q r s t u v w x y z
MATHEMATICS
POLYBIUS SQUARE
The Polybius cipher is a monoalphabetic substitution cipher,
which uses a 5x5 grid. Each letter of the plaintext is
substituted by coordinates based on the position in the grid.
1 2 3 4 5
1 A B C D E
2 F G H I, J K
3 L M N O P
4 Q R S T U
5 V W X Y Z
POLYBIUS SQUARE 1 2 3 4 5
1 A B C D E
Encrypt the message:
2 F G H I, J K
GOD IS LOVE 3 L M N O P
4 Q R S T U
5 V W X Y Z
POLYBIUS SQUARE 1 2 3 4 5
1 A B C D E
Decrypt the message:
2 F G H I, J K
(2, 1) (5, 1) (3, 2) (1, 1) 3 L M N O P
(5, 3) (5, 3) (4, 5) 4 Q R S T U
5 V W X Y Z
MORSE CODE
Morse Code, either of two systems for
representing letters of the alphabet,
numerals, and punctuation marks by
an arrangement of dots, dashes, and
spaces. The codes are transmitted as
electrical pulses of varied lengths or
analogous mechanical or visual
signals, such as flashing lights.
MORSE CODE
MORSE CODE
Decrypt the message:
TOOAETEIAUHTUBPTVNNTEHCO
AHEGDTRIAUSERYOOENNTTRYO
ADSGDTBETUBANYOHUSHCOY
TRANSPOSITION CIPHER
Key = 8
Decrypt the message:
DONALTTRUEUTNGHERLRHDIES
HISEHVDOEGELEEEFAHLOWYSY
RTFRIOIOTYIDLU
PLAYFAIR CIPHER
In Playfair cipher, initially a key table is created. The key table is a 5×5
grid of alphabets that acts as the key for encrypting the plaintext. Each
of the 25 alphabets must be unique and one letter of the alphabet
(usually J) is omitted from the table as we need only 25 alphabets
instead of 26. If the plaintext contains J, then it is replaced by I. The
sender decide on a particular key word. In a key table, the first
characters (going left to right) in the table is the key word, excluding the
duplicate letters. The rest of the table will be filled with the remaining
letters of the alphabet, in natural order.
Process of Playfair Cipher
1. The plaintext message is fragmented into pairs of letters. The letter Z is added to
complete the pair, in case the last fragment has only 1 letter.
2. If both the letters are in the same column, take the letter below each one (going
back to the top if at the bottom)
3. If both letters are in the same row, take the letter to the right of each one (going
back to the left if at the farthest right
4. If neither of the preceding two rules are true, form a rectangle with the two
letters and take the letters on the horizontal opposite corner of the rectangle.
PLAYFAIR CIPHER
Key = MATHEMATICS
Decrypt the message:
IUYATHCBOBLAEKQMYATHCBMTBX
PLAYFAIR CIPHER
Key = TUTORIALS
Decrypt the message:
WKQOF
Thanks!
CREDITS: This presentation template was created by
Slidesgo Flaticon