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

Module 2 Cryptography

This document is a module on cryptography that covers the fundamentals, methods of encryption and decryption, and practical applications in securing communication and data protection. It explains concepts like modular arithmetic, shift ciphers, affine ciphers, and the importance of cryptography in modern digital security. The module aims to equip participants with the knowledge to explain cryptographic principles and demonstrate various processes.

Uploaded by

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

Module 2 Cryptography

This document is a module on cryptography that covers the fundamentals, methods of encryption and decryption, and practical applications in securing communication and data protection. It explains concepts like modular arithmetic, shift ciphers, affine ciphers, and the importance of cryptography in modern digital security. The module aims to equip participants with the knowledge to explain cryptographic principles and demonstrate various processes.

Uploaded by

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

CRYPTOGRAPHY

MODULE 2
STEM Teach Mapúa 2024
Introduction
Cryptography
Modular arithmetic plays a crucial role in cryptography which is
used to secure communication and protect information.
The primary goal here is to ensure confidentiality, integrity, and
authenticity of messages and information.
With the rise of wireless communication and extensive use of the
internet, information faces a significant risk of breaches.
Mathematics has devised a solution to this issue through
cryptography.
Introduction
Cryptography
Additionally, modular arithmetic is used in other
cryptographic techniques, such as digital signatures
and hash functions.
Digital signatures use modular arithmetic to verify the
authenticity and integrity of a message, while hash
functions use modular arithmetic to generate unique
and fixed-length representations of data.
Introduction
Cryptography
This module will cover only the fundamentals of
cryptography, some practical applications of
cryptography, data encryption and decryption methods.
The last part of this module will highlight some of the
most important concepts in data protection and
authentication techniques.
Intended Learning Outcomes
At the end of the module, the participants will
be able to:

 explain the basic principles of cryptography;


 describe the different methods of data
encryption and decryption; and
 demonstrate and apply the different
processes of cryptography.
Lesson 1
Cryptography Methods
Cryptology is the study of making and breaking secret
codes.
It is the process of converting data or information into
codes, primarily for the purpose of keeping it secured and
protected.
Plaintext is the original message before it is coded.
Ciphertext is the coded message of a plaintext.
Lesson 1
Cryptography Methods
Cryptology usually involves encryption and decryption
processes.

Encryption basically converts an ordinary message


(plaintext) into meaningless codes (ciphertext) that only the
intended recipient of the message can decode.
Decryption, on the other hand, is the decoding process
which converts the encrypted codes to the original
information or message.
Encryption Methods
If the encrypting code is to shift each letter of the plaintext
message K positions, then the corresponding letter in the
ciphertext message is given by

where P is the numerical equivalent of the plaintext letter


and C is the numerical equivalent of the ciphertext letter.
Cyclical Coding

This is the numerical equivalents of the letters in


the English alphabet using the cyclical coding.

A B C D E F G H I J K L M
1 2 3 4 5 6 7 8 9 10 11 12 13

N O P Q R S T U V W X Y Z
14 15 16 17 18 19 20 21 22 23 24 25 0
Shift Cipher Method

■ On the other hand, the shift cipher method starts


with 0 for A then B is assigned with 1, and so on.
A B C D E F G H I J K L M
0 1 2 3 4 5 6 7 8 9 10 11 12

N O P Q R S T U V W X Y Z
13 14 15 16 17 18 19 20 21 22 23 24 25

Either way, the encryption process will use the


formula
Example 1
Use the shift cipher encrypting code that
shifts each letter 9 positions to code the
message “Let us drink coffee”.
Solution
Cipher : mod 26
For the letter “L”, P=11 ==> C = (11+9) mod 26 =
20
==> the code letter for “L” is “U”
For the letter “T”, P=19 ==> C = (19+9) mod 26 =
2
Example 1

Continue the process until we get the whole


encrypted message.
UNCDBMARWTLXOONN
Original
L E T U S D R I N K C O F F E E
letter
Original
11 4 19 20 18 3 17 8 13 10 2 14 5 5 4 4
position
Shifted
20 13 2 3 1 12 0 17 22 19 11 23 14 14 13 13
position
Code letter U N C D B M A R W T L X O O N N
Decryption

Decryption process uses the concept of the inverse


element in modular arithmetic. The recipient of the
encrypted message can recover the original
message using the following formula.
Decryption Cipher: P = (C + M) mod 26
where M = 26 – K.
Example 2: Decryption

Using the encryption cipher formula, C =(P+9) mod


26
Decrypt the message: RFJWCCXFJCLQVXERN
Example 2: Decryption
The decryption formula: P = (C + M) mod 26
M = 26 – K = 26 – 9 = 17
For the letter “R”, C=17 ==> P = (17+17)mod 26 =
8
==> the corresponding original
letter is “I”
For the letter “C”, C = 2 ==> P=(2+17) mod 26 =
19 (mod 26)
Thus, 19 corresponds to the letter “T”.
Example 2: Decryption

Continue the process until we get the original


message
Encrypted R F J W C C X F J C L Q V X E R N
Position(C) 17 5 9 22 2 2 23 5 9 2 11 16 21 23 4 17 13
Original
position 8 22 0 13 19 19 14 22 0 19 2 7 12 12 21 8 4
(P)
Original
I W A N T T O W A T C H M O V I E
letter

The original message is : I WANT TO WATCH MOVIE


Affine Cipher
A coding scheme that is more difficult to break is
based on the following congruence where a and 26
do not have a common factor.
Replace P by the numerical equivalent using the
shift cipher table and determine C.
Encryption Cipher (a, K): C = (aP + K) mod 26
Decryption Cipher (a, K): P = (C + M) mod 26
Affine Cipher
As a reminder, the symbol denotes the
multiplicative inverse of a with respect to modulo
26 operation.
Note also that the pair (a,K) is a valid encryption
cipher parameters if a and 26 are relatively prime.
Example 3: Encryption with Affine
Cipher
Encrypt the message “Let us drink
coffee” using the affine cipher pair (a,K)
= (3,5).
Example 3: Encryption with Affine
Cipher
Encrypt the message “Let us drink
coffee” using the affine cipher pair (a,K)
= (3,5).
Encryption Formula: C = (3P + 5)
mod 26
For letter “L”, P=11 ==> C=[(3)(11)+5]
mod 26
= 38 mod 26
Example 3: Encryption with Affine
Cipher
Continue the process until we get the coded
message.
Original
L E T U S D R I N K C O F F E E
letter
Original
11 4 19 20 18 3 17 8 13 10 2 14 5 5 4 4
position
New
12 17 10 13 7 14 4 3 18 9 11 21 20 20 17 17
position
Code letter M R K N H O E D S J L V U U R R

The Encrypted message is :


MRKNHOEDSJLVUURR
Example 4: Decryption
Use the congruence C 3P + 5) mod 26
and the cyclical coding to decrypt the
message: CXRT
Example 4
We solve for C.
Example 4: Decryption
To decode the letter X, we use P = 9(C-5)
mod 26.
Using the cyclical coding, X = 24.
P = 9(24-5) = 171 15 mod 26
Thus, X is decoded to letter O.
The original message is HOME.
Exercises
1) Encode the message by using cyclical coding and affine
cipher.
K=8 positions: GOLDEN STATE
2) use cyclical coding and affine cipher coding that shifts the
letters the stated number of positions to decode the
encrypted message.
K=18 positions: SYW GX WFDAYZLWFEWFL
Lesson 2
Other Practical Applications of
Cryptography
Cryptography is an essential tool in the
modern digital world, providing various
methods to secure communication,
protect data, and authenticate users.
Here are some of the practical
applications of cryptography:
Enabling Secure Communication
Cryptography makes sure that information shared over a digital network
remains confidential and is accessible only to the intended recipients.
This is achieved through encryption algorithms that convert plain text
into cipher text, making it unreadable to unauthorized parties.
Example:
The SSL (Secure Socket Layer) and TLS (Transport Layer Security)
protocols are two of the most popular cryptographic protocols that are
used to secure data transmitted over the internet, such as those in the
online banking, ticketing and shopping.
Data Protection
The main purpose of cryptography is to protect sensitive
data from unauthorized access and breaches. By encrypting
data stored in databases or on devices, cryptography
ensures that even if the data is accessed, it cannot be
understood without the decryption key.
Example:
The Advanced Encryption Standard (AES) encryption is
widely used to encrypt data in storage, ensuring its
confidentiality.
Data Protection
Symmetric Encryption:
The concept of symmetric encryption is to
use single key for both encryption and decryption.
Example:
Using AES to encrypt a file containing sensitive
information. Only those with the key can decrypt
and read the file.
Data Protection
Asymmetric Encryption:
This concept uses a pair of keys, a public key
for encryption and a private key for decryption.
Example:
Encrypting an email with the recipient's public key
ensures that only the recipient, who possesses the
private key, can decrypt and read the file.
Authentication
Cryptography verifies the identities of users and devices, ensuring that
only authorized parties can access resources.
Techniques like digital signatures and certificates authenticate the
sender of a message or the identity of a user.
Example:
Digital signatures provide a way to verify the authenticity of digital
messages or documents.
A sender can sign a message with their private key, and the recipient can
verify it using the sender’s public key.
The Hash Functions
The concept is to convert data into a fixed-size
string of characters, which is typically a digest that
uniquely represents the data.
Example: Storing passwords as hashed values in a
database. When a user logs in, the entered
password is hashed and compared to the stored
hash.
Digital Certificates
In this concept, the Certificate Authority (CA) will
issue a digital certificate to verify the ownership of a
public key.
Example: Websites use SSL certificates to
authenticate their identity to visitors, ensuring that
users are communicating with the legitimate site.
Conclusion
Cryptography plays a crucial role in securing digital
communications, protecting sensitive data, and
authenticating users and devices.
Techniques such as encryption (both symmetric and
asymmetric), hash functions, and digital signatures
are fundamental to these processes, providing the
necessary tools to maintain privacy, integrity, and
trust in digital interactions.
References
■ Mathematical Excursions, Third Edition Richard N.
Aufmann, Joanne S. Lockwood, Richard D. Nation, Daniel
K. Clegg
■ Mathematics in the Modern World, 2nd Edition, Richard
Earnhart, Edgar Adina

You might also like