0% found this document useful (0 votes)
2 views

Chapter 5 - Cryptography

The document provides an overview of cryptography, including its history, basic concepts, and various cipher methods used for encryption and decryption. It outlines the essential functions of cryptography such as confidentiality, authentication, and integrity, as well as potential attacks on cryptographic systems. Additionally, it covers mathematical concepts like modulo arithmetic and details specific cipher techniques, including Atbash, Caesar, and transposition ciphers.

Uploaded by

duyanjeo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Chapter 5 - Cryptography

The document provides an overview of cryptography, including its history, basic concepts, and various cipher methods used for encryption and decryption. It outlines the essential functions of cryptography such as confidentiality, authentication, and integrity, as well as potential attacks on cryptographic systems. Additionally, it covers mathematical concepts like modulo arithmetic and details specific cipher techniques, including Atbash, Caesar, and transposition ciphers.

Uploaded by

duyanjeo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

GEMMW

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:

“GSV LMOB DZB GL OVZIM

NZGSVNZGRXH RH GL WL

NZGSVNZGRXH” - KZFO SZONLH


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:

BLFI KZHG WLVH MLG WVURMV

DSL BLF ZIV


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
Encrypt the given message using Atbash Cipher:

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

PDWK JLYHV XV KRSH WKDW HYHUB

SUREOHPV KDV D VROXWLRQ


CEASAR’S CIPHER/ SHIFT CIPHER
Example: Decrypt this message, which was enciphered using a Caesar Shift: Key =5

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

“SFYZWJ NX BWNYYJS NS RFYMJRFYNHFQ

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

WKH HBHV DUH WKH PLUURU RI WKH

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

FMOQKS GNNQK EMOISEMOPNMDDY -

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

Encrypt the message:


GOOD LUCK AND GOD BLESS
THE PIGPEN CIPHER
The Pigpen cipher is also referred to as the masonic cipher,
Freemason’s cipher, Napoleon cipher and tic-tac-toe cipher.
It is a simple substitution cipher which use symbols instead
of letters and was used in the 18th century by a secret
society called Freemasons.
THE PIGPEN CIPHER
Decode the message:
THE PIGPEN CIPHER
Encrypt the message:

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:

.. _. / _ .... . / _ _ .. _.. _..


._.. . / _ _ _ .._. / _.. .. .._. .._.
.. _._. .._ ._.. _ _._ _ / ._.. .. .
…/___ ._ _. ._ _. _ _ _ ._.
_ .._ _. .. _ _._ _
MORSE CODE
Encrypt the message:

GOD BLESS US ALL


FRANCIS BACON CIPHER A
B
*****
****B
N
O
*BB*B
*BBB*
Bacon's cipher or the Baconian cipher is a C ***B* P *BBBB
method of steganographic message encoding D ***BB Q B****
devised by Francis Bacon in 1605. A message E **B** R B***B
is concealed in the presentation of text, rather F **B*B S B**B*
than its content. Bacon cipher is categorized G **BB* T B**BB

as both a substitution cipher (in plain code) H **BBB U B*BB*

and a concealment cipher (using the two I *B*** V B*B*B


J *B**B W B*BB*
typefaces).
K *B*B* X B*BBB
L *B*BB Y BB***
M *BB** Z BB**B
A AAAAA N ABBAB
FRANCIS BACON CIPHER B AAAAB O ABBBA
C AAABA P ABBBB
Encrypt the message: D AAABB Q BAAAA
E AABAA R BAAAB
BAABA BAABB AAAAA BBAAA F AABAB S BAABA
AABBB AABAA AAAAA ABABB G AABBA T BAABB
BAABB AABBB BBAAA AAAAA H AABBB U BABBA
ABBAB AAABB BAABB AAAAA I ABAAA V BABAB
ABABA AABAA AAABA AAAAA J ABAAB W BABBA

BAAAB AABAA K ABABA X BABBB


L ABABB Y BBAAA
M ABBAA Z BBAAB
TRANSPOSITION CIPHER
Transposition cipher (also known as a permutation cipher) is a method
of encryption which scrambles the positions of characters
(transposition) without changing the characters themselves.
Transposition ciphers reorder units of plaintext (typically characters or
groups of characters) according to a regular system to produce a
ciphertext which is a permutation of the plaintext. They differ from
substitution ciphers, which do not change the position of units of
plaintext but instead change the units themselves.
Process of Transposition Cipher
1. Prepare a table with the number of columns equal to the given Key value.
The number of rows is obtained by dividing number of total cipher text alphabets by
the key value and rounding off the quotient to next integer value.
2. The message is written vertically down, from left to right in each cell of the table.
3. The cipher text to be sent is done by copying the letters on the table from left to
right of each row.
4. To decrypt, the receiver follows step 1 to make the table.
5. The receiver then writes the cipher text horizontally from left to right.
To obtain the plain text, the message is read vertically down from left to right
TRANSPOSITION CIPHER
Key = 7
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:

ZEFM CUGF HFOA URI FBTK AS


FADKF, MPFWME
AFFINE CIPHER
The Affine cipher is a monoalphabetic substitution cipher
where each letter of the alphabet has assigned numerical
value and encrypted with a mathematical function then
decrypted. By default, the assigning of numerical value is, A
= 0, B = 1, C = 2 and so on.
AFFINE CIPHER
In affine cipher each letter in an alphabet is mapped to its
numeric equivalent, encrypted using a simple mathematical
function, and converted back to a letter. Each letter is
enciphered with the function (ax + b) mod 26.
AFFINE CIPHER
Key = SLOPE (a) = 3 Intercept (b) = 2
Decrypt the message:

MCGO WSKB MAEHCGOE QSBG RSB WSK FW


JOCBPAPU RBSM HXOM
AFFINE CIPHER
Key = SLOPE (a) = 4 Intercept (b) = 5
Decrypt the message:

HBCAP WSKB MAPL HS EOO ESMOHXAPU USSL


AP ONOBWLCW
QUERTY CODE
QWERTY is a keyboard layout for Latin-script alphabets. The
name comes from the order of the first six keys on the top
left letter row of the keyboard (Q W E R T Y). The QWERTY
design is based on a layout created for the Sholes and
Glidden typewriter and sold to E. Remington and Sons in
1873.
QUERTY CODE
Decrypt the message
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
QW E R T Y U I O P A S D F G H J K L Z X C V B NM

DQZITDQZOEL OL TBTKEOLT YGK NGXK STYZ

WKQOF
Thanks!
CREDITS: This presentation template was created by
Slidesgo Flaticon

Slidesgo, and includes icons by Flaticon, and


Freepik

infographics & images by Freepik

You might also like