Professional Documents
Culture Documents
OF CIPHER
AND ITS
APPLICATION
P R E S E N T E D B Y:
A L I A M A E M . A R C E TA
BACHELOR OF SCIENCE IN CIVIL ENGINEERING
Learning Objectives
In the end of the lesson:
STUDENTS WILL BE ABLE TO
UNDERSTAND THE DIFFERENT
TYPES OF CIPHER AND ITS
MEANING
STUDENTS WILL BE ABLE TO KNOW
HOW TO ENCRYPT AND DECRYPT
Source: https://www.changstaekwondo.ca/train-martial- THE DIFFERENT TYPES OF CIPHER
arts/martial-arts-training-key-point-focus/
3
What is Cipher?
Ciphers, also called encryption algorithms, are systems
for encrypting and decrypting data. A cipher converts the
original message, called plaintext, into ciphertext using a
key to determine how it is done.
In cryptography, a cipher (or cypher) is an algorithm for
performing encryption or decryption —a series of well-
defined steps that can be followed as a procedure. An
alternative, less common term is encipherment. To encipher
or encode is to convert information into cipher or code. In
common parlance, "cipher" is synonymous with "code", as
they are both a set of steps that encrypt a message;
however, the concepts are distinct in cryptography,
especially classical cryptography.
4
EXAMPLE
OF For example, "GOOD DOG" can
7
Caesar Cipher
The Caesar cipher (or Caesar code) is a monoalphabetic
substitution cipher, c. The shift distance is chosen by a number called the
offset, which can be right (A to B) or left (B to A).
8
Example of Caesar Cipher
For example, with a left shift of 3, D would be replaced by A, E would become B, and so
on. The method is named after Julius Caesar, who used it in his private correspondence.
Plain 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
Cipher X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
When encrypting, a person looks up each letter of the message in the "plain" line and writes down the
corresponding letter in the "cipher" line.
Plaintext: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
C i p h e r t e x t : Q E B N R F Z H Y O LT K C L U G R J M P L S B O Q E B I X W V A L D
9
Example of Caesar Cipher
Encryption with Caesar code is based on an alphabet shift. The most commonly used
shift/offset is by 3 letters.
2/1/20XX 13
Example of Shifting Cipher
The letter A shifted by 1 place in the alphabet becomes B
Take the letter E in position 5 in the alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZ, it will be encrypted by a
shift of 3 in position 8 or H.
To encrypt the plaintext “Beware the ides of March” we shift each letter down three letters in the alphabet.
B E W A R E T H E I D E S O F M A R C H
C F X B S F U I F J E F T P G N B S D I
D G Y C T G V J G K F G U Q H O C T E J
E H Z D U H W K H L G H V R I P D U F K
2/1/20XX 14
Tripling Cipher
More correctly known as Triple In cryptography, Triple Triple Data Encryption Standard
Data Encryption DES (3DES or TDES), officially (DES) is a type of computerized
Algorithm (TDEA). A block cipher the Triple Data Encryption cryptography where block cipher
encryption method that uses the Algorithm (TDEA or Triple algorithms are applied three times
DES encryption algorithm to DEA), is a symmetric-key block to each data block.
encrypt message blocks three cipher, which applies
times, using three different 56-bit the DES cipher algorithm three
keys. Triple DES is highly secure, times to each data block.
but slow, and largely has been
superseded by Advanced
Encryption Standard (AES).
2/1/20XX 15
Example of
Tripling Cipher
Encrypt Decrypt
• Encrypt DCODE with the • The ciphered
alphabet A=AAA, B=AAB, C=AAC, D=AB message ABAAACBBCABAABB have been
A, etc. The encrypted message is: ABA AAC encoded with the
BBC ABA ABB alphabet A=AAA, B=AAB, C=AAC, D=ABA,
etc. The original plain text is DCODE.
16
Affine Cipher
Affine encryption is the name The Affine Cipher is a type
given to a substitution cipher of monoalphabetic substitution
whose correspondence is given cipher, where each letter in an
by an affine function endowed alphabet is mapped to its numeric
with 2 coefficients A and B. equivalent, encrypted using a simple
mathematical function, and converted
back to a letter.
17
Example of Affine Cipher
As an example, let us encrypt the plaintext "affine cipher", using the key a = 5, b = 8. Firstly we
must find the integer value of each of the letters in the plaintext alphabet (the standard alphabet of
26 letters in this case). The table below gives these values.
The standard values for the alphabet of 26 letters. Notice we start at 0, not 1.
With the integer values of the plaintext letters found, the next step is to perform the calculations on
those values. In this instance, the calculation needed is (5x+8 )
18
The affine cipher with
a = 5 , b = 8 . We w o r k
out values of letters,
then do the
calculations, before
converting numbers
back to letters.
Thus the ciphertext
produced is
"IHHWVC SWFRCP”
SWFRCP".
2/1/20XX 19
Decimation Cipher
The decimation cipher A Decimation Cipher encrypts Decimation Cipher is similar
encrypts a message by using by multiplying each letter’s to a Caesar Cipher but it uses
modular arithmetic. Each letter position by a fixed amount multiplication, rather than
in the message is replaced by addition, by a number key.
its position in the alphabet (a
→ 0, b → 1, …, z → 25).
2/1/20XX 20
Example of Decimation Cipher
How to Decimate by Three
PT A B C D E F G ⋯⋯
CT A B C ⋯
PT 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
C
A J S B K T C L U D M V E N W F O X G P Y H Q Z I R
T
Let's encrypt according to the formula
CT≡3×PT(mod26) PT=USE CODE B = PTNum=[20,18,4,2,14,3,4,1]
20×3=60 60/26=2 26×2=52 60-52=8(mod26)
18×3=54 54/26=2 26×2=52 54-52=2(mod26).
Thus, the numbers for the ciphertext are CTNum=[8,2,12,6,16,9,12,3].
22
Example of Mono-alphabetic Cipher
24
Homophonic
Cipher
A homophonic cipher is a This cipher will require an alphabet
substitution cipher that uses a of more than 26 letters, as each letter
correspondence table between needs at least one ciphertext letter,
the letters / characters of the and many need more than this. The
plain message and one or more standard way to do this is to include
letters / numbers / groups of
the numbers in the ciphertext
characters.
alphabet, but you can also use a
mixture of uppercase, lowercase and
upside down letters. Some people
even design artistic symbols to use.
25
Example of Homophonic Cipher
Any of the symbols R, 3, or 9 can be substituted for a plaintext
E, and either Y or 6 can be substituted for plaintext L.
PLAINTEX 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
T
CIPHERTE N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
XT
8 9 1 6 4
3 5
26
Polygram Cipher
In Polygram substitution In Polygram substitution
cipher technique, rather cipher, the replacement of
than replacing one plain plain text happens block – by
text alphabet with one – block, rather than character
cipher text alphabet at a – by – character.
time, a block of alphabets
is replaced with another
block.
27
Example of
Polygram Cipher
BECAUSE could be replaced
For example, HELLO
by XAYWQOA, but CAUSE
could be replaced by could be replaced by totally
Y U Q Q W, b u t H E L L different cipher IGAYK. This is
could be replaced by true despite the last five characters
a totally different of the two blocks of text
cipher text block (CAUSE) being the same.
TEUI
28
Vigenère Cipher
Vigenère Cipher is a Vigenère cipher is Vigenère Cipher type
method of encrypting probably the best-known of substitution cipher used
alphabetic text. It uses a example of a for data encryption in
simple form polyalphabetic cipher, which the original plaintext
structure is somewhat
of polyalphabetic though it is a simplified
concealed in the ciphertext
substitution. special case
by using several different
monoalphabetic substitutio
n ciphers rather than just
one
29
Example of Vigenère Cipher
The encryption of the original text is done
using the Vigenère square or Vigenère table.
31
Example of Playfair Cipher
The Algorithm consists of 2 steps:
1. Generate the key Square(5×5):
The key square 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 the table can hold only 25 alphabets). If the plaintext contains J,
then it is replaced by I.
The initial alphabets in the key square are the unique alphabets of the key in the order in
which they appear followed by the remaining letters of the alphabet in order.
32
Example of Playfair Cipher
2.Algorithm to encrypt the plain text:
The plaintext is split into pairs of two letters PlainText: "instruments"
(digraphs). If there is an odd number of
After Split: 'in' 'st' 'ru' 'me' 'nt' 'sz'
letters, a Z is added to the last letter.
Pair cannot be made with same letter. Break Plain Text: “hello”
the letter in single and add a bogus letter to
After Split: ‘he’ ‘lx’ ‘lo’
the previous letter.
Here ‘x’ is the bogus letter.
If the letter is standing alone in the process of Plain Text: “helloe”
pairing, then add an extra bogus letter with
AfterSplit: ‘he’ ‘lx’ ‘lo’ ‘ez’
the alone letter
Here ‘z’ is the bogus letter.
33
Example of Playfair Cipher
Rules for Encryption:
•If both the letters are in the same row: Take the letter
•If both the letters are in the same column: Take the letter below
to the right of each one (going back to the leftmost if at
each one (going back to the top if at the bottom). the rightmost position).
For example: •For example:
Diagraph: "me"
Encrypted Text: cl Diagraph: "st"
Encryption: Encrypted Text: tl
m -> c Encryption:
e -> l s -> t
t -> l
34
•I f n e i t h e r o f t h e a b o v e r u l e s
is true: Form a rectangle with
the two letters and take the
letters on the horizontal
opposite corner of the
rectangle.
For example:
Diagraph: "nt"
E n c r y p t e d Te x t : r q
Encryption:
n -> r
t -> q
Example of Playfair 35
Example of Playfair Cipher
For example:
37
Hill Cipher Example
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
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
We have to encrypt the message ‘ACT’ (n=3).The key is The message ‘ACT’ is written as vector :
‘GYBNQKURP’ which can be written as the nxn matrix:
38
Hill Cipher Example
The enciphered vector is given as:
In this, we just do the multiple matrices we just multiple the 1 row with 1 column
as we can say 6*0+24*2+1*19=67 same
as 13*0+16*2+10*19=222 and 20*0+17*2+15*19=319.
And that matrix does the mod 26 with particular column and made again
the 3*1 matrix and we alphabetically write them with called ciphertext i.e "POH".
39
Application of Ciphers
1.Secure 2.End-to-end 3. Storing Data 4. Storing Password
communications Encryption
The most obvious use of Email is one area where We all store a large One of the main uses of
cryptography, and the one encryption is not widely in amount of data, and any this is to store passwords.
that all of us use use. When email moves data is valuable to at least It is very risky to store
frequently, is encrypting from server to server, and the person who generated passwords in an accessible
communications between from server to you, it is it. way. If stored in plaintext
us and another system. encrypted. on a system, anyone who
has access to the system –
legitimate or malicious –
can read the password.
40
Application of Ciphers in Everyday Life
1. Authentication/ 2. Time Stamping: 3. Electronic Money: 4. . Encryption/
Digital Signatures: Decryption in email:
Authentication is any process Time stamping is a The definition of electronic Email encryption is a
through which one proves and technique that can certify money (also called electronic method of securing the content
verifies certain information. that a certain electronic cash or digital cash) is a term of emails from anyone outside
document or that is still evolving. It of the email conversation
communication existed or includes transactions carried looking to obtain a
was delivered at a certain out electronically with a net participant’s information. In its
time. transfer of funds from one encrypted form, an email is no
party to another, which may be longer readable by a human.
either debit or credit and can Only with your private email
be either anonymous or key can your emails be
identified. unlocked and decrypted back
into the original message.
41
SUMMARY
A cipher converts the original message, called plaintext, into ciphertext using a key to determine how it is done. There are different
types of cipher which is the Caesar Cipher where a cipher converts the original message, called plaintext, into ciphertext using a key to
determine how it is done. Next is Credit Card Cipher encryption method scrambles the transaction information based on a certain algorithm
making it unusable by any fraudster without the corresponding encryption key. There are also called Shifting Cipher which is
involves replacing each letter in the message by a letter that is some fixed number of positions further along in the alphabet. Tripling Cipher
is a type of computerized cryptography where block cipher algorithms are applied three times to each data block. Next is A ffine Cipher
where each letter in an alphabet is mapped to its numeric equivalent, encrypted using a simple mathematical function, and converted back to
a letter.
Cipher also have Decimation Cipher which encrypts by multiplying each letter’s position by a fixed amount. Also, we have Mono
Alphabetic cipher is a substitution cipher where each letter of the plain text is replaced with another letter of the alphabet. Homophonic
Cipher is also a substitution cipher that uses a correspondence table between the letters / characters of the plain message and one or more
letters / numbers / groups of characters. In Polygram Cipher the replacement of plain text happens block – by – block, rather than character –
by – character. The Vigenère Cipher is a type of substitution Cipher which the original plaintext structure is somewhat concealed in the
ciphertext by using several different monoalphabetic substitution ciphers rather than just one, next is Playfair Cipher is a written code or
symmetric encryption technique that was the first substitution cipher used for the encryption of data. Last type is Hill Cipher which is a poly
graphic substitution cipher based on linear algebra. Each letter is represented by a number modulo 26. Lastly is the application of cipher in
common and in real life. Application of cipher includes Secure communications, End-to-end Encryption, Storing Data, and Storing
Password and the real life application of it is Authentication/ Digital Signatures, Time Stamping, Electronic Money, Encryption/ Decryption
in email.
42
ASSESMENT
◦ 1. How do you describe cipher?
◦ 2. What is the importance of cipher?
◦ 3. Do you use cipher in you life? In what ways?
◦ 4. Encrypt the word “NATURE IS BEAUTIFUL” using the table below.
Plain 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
Cipher X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
PLAINTEX 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
T
CIPHERTE N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
XT
8 9 1 6 4
3 5
43
REFERENCES
blogs.ucl.ac.uk/infosec/2017/03/12/applications-of-cryptography/
cleartax.in/g/terms/credit-card-encryption
crypto.interactive-maths.com/affine-cipher.html
crypto.interactive-maths.com/caesar-shift-cipher.html
crypto.interactive-maths.com/homophonic-substitution.html
demonstrations.wolfram.com/TheDecimationCipher/
dharmamerchantservices.com/faq/what-is-credit-card-encryption/
en.wikipedia.org/wiki/Affine_cipher
en.wikipedia.org/wiki/Caesar_cipher
en.wikipedia.org/wiki/Cipher
en.wikipedia.org/wiki/Jefferson_disk
en.wikipedia.org/wiki/Triple_DES
en.wikipedia.org/wiki/Vigen%C3%A8re_cipher
facweb1.redlands.edu/fac/Tamara_Veenstra/cryptobook/intro-deci.html
hmong.es/wiki/Encipherment
http://facweb1.redlands.edu/fac/Tamara_Veenstra/cryptobook/Shift-Ciphers.html#:~:text=To%20encrypt%20the%20plaintext%20%E2%80%9CBew
are,three%20letters%20in%20the%20alphabet.&text=Thus%2C%20our%20cipher%20text%20is%20EHZDUH%20WKH%20LGHV%20RI%20PDU
FK
.
44
REFERENCES
http://www.crypto-it.net/eng/simple/vigenere-cipher.html#:~:text=The%20cipher%20was%20invented%20by,his%20book%20%22La%20cifra%20del .
http://www.cs.sjsu.edu/faculty/stamp/RUA/homophonic.pdf
interestingengineering.com/11-cryptographic-methods-that-marked-history-from-the-caesar-cipher-to-enigma-code-and-beyond
medium.com/@prashanthreddyt1234/real-life-applications-of-cryptography-162ddf2e917d
www.101computing.net/mono-alphabetic-substitution-cipher/
www.britannica.com/topic/cipher
www.dcode.fr/affine-cipher
www.dcode.fr/caesar-cipher
www.dcode.fr/homophonic-cipher
www.dcode.fr/shift-cipher
www.dcode.fr/triliteral-cipher
www.educba.com/types-of-cipher/
www.geeksforgeeks.org/hill-cipher/
www.geeksforgeeks.org/playfair-cipher-with-examples/
www.geeksforgeeks.org/vigenere-cipher/
www.hypr.com/cipher/
www.investopedia.com/terms/c/credit-card-encryption.asp#:~:text=Key%20Takeaways-,Credit%20card%20encryption%20is%20a%20security%20measure%
20used%20to%20reduce,financial%20institution%20conduct%20their%20transactions
45
Thank you
for listening!
2/1/20XX 46