0% found this document useful (0 votes)
5 views37 pages

Chapter 2 Part1

Chapter 2 covers the fundamentals of cryptography, including its definitions, goals, and services such as confidentiality, integrity, authentication, and non-repudiation. It discusses various cryptographic algorithms, particularly symmetric block ciphers like the Caesar Cipher, DES, and AES, along with encryption and decryption processes. Additionally, it addresses cryptanalysis, types of attacks, and the importance of understanding vulnerabilities in cryptographic systems.

Uploaded by

ETHIOPIA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views37 pages

Chapter 2 Part1

Chapter 2 covers the fundamentals of cryptography, including its definitions, goals, and services such as confidentiality, integrity, authentication, and non-repudiation. It discusses various cryptographic algorithms, particularly symmetric block ciphers like the Caesar Cipher, DES, and AES, along with encryption and decryption processes. Additionally, it addresses cryptanalysis, types of attacks, and the importance of understanding vulnerabilities in cryptographic systems.

Uploaded by

ETHIOPIA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Chapter-2:

Cryptographic Protocols, Tools and

Algorithms

12/14/2024 1
Outline

▪ Introduction to cryptography ▪ Cryptographic Algorithms


▪ Goal and services of cryptography ▪ Symmetric Block Cipher Algorithms
▪ Components of Cryptography ▪ Caesar Cipher Algorithm
▪ Encryption and Decryption in ▪ DES (Data Encryption Standard)
Cryptography ▪ 3DES (Triple DES)
▪ Types of Cryptography ▪ Digital Signature
▪ Building blocks of Encryption ▪ AES
Techniques
▪ DH-Key Exchange Algorithm
▪ Cryptanalysis and Types of Attacks
▪ SHA-1

12/14/2024 2
Chapter Objectives
▪ At the end of this chapter, students will be able to understand:
▪ Basics of cryptography

▪ Encryption Decryption Techniques

▪ Different types of attacks


▪ Different types of cryptographic algorithms

▪ Basic Components of cryptography

12/14/2024 3
Introduction to Cryptography
▪ Definition

▪ Cryptography is the science of using mathematics to encrypt and decrypt


data.

▪ It is technique of securing information and communications through use


of codes so that only those person for whom the information is intended
can understand it and process it.

▪ It is the design, analysis, and implementation of mathematical techniques


for securing information, systems, and distributed computations against
adversarial attack.
12/14/2024 4
Introduction to Cryptography…
▪ Terminology

▪ A message is plaintext (sometimes called clear text).

▪ The process of hiding a message in such a way as to hide its substance is


encryption.

▪ An encrypted message is called a ciphertext.

▪ The process of turning ciphertext back into plaintext is called decryption.

▪ 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.
12/14/2024 5
Introduction to Cryptography…
▪ Terminology…

12/14/2024 6
Goal and Services of Cryptography

▪ The primary goal of cryptography is to:

▪ Secure stored information - regardless if access obtained

▪ Secure transmitted information - regardless if transmission has

been monitored

12/14/2024 7
Goal and Services of Cryptography…

▪ Cryptography can provide the following services:

▪ Confidentiality (secrecy)

▪ Integrity (anti-tampering)

▪ Authentication

▪ Non-repudiation.

12/14/2024 8
Goal and Services of Cryptography…
1. Confidentiality (secrecy)

▪ Ensuring that no one can read the message except the intended receiver

▪ Data is kept secret from those without the proper credentials, even if
that data travels through an insecure medium.

▪ The principle of confidentiality specifies that only the sender and


the intended recipient should be able to access the content
of the message.

▪ Example: Encryption, access control lists, and file permissions

12/14/2024 9
Goal and Services of Cryptography…
2. Integrity (anti-tampering)

▪ Assuring the receiver that the received message has not been altered in
any way from the original.

▪ The information cannot be altered in storage or transit between


sender and intended receiver without the alteration being detected.

▪ Examples: MD5, digital signature, digital certificates

12/14/2024 10
Goal and Services of Cryptography…
3. Authentication

▪ Cryptography can help establish identity for authentication purposes

▪ The process of proving one's identity. (The primary forms of host-to-host


authentication on the Internet today are name-based or address-based,
both of which are notoriously weak.). Example: Secret Key, Digital
Signature, Digital certificates
4. Non-repudiation
▪ A mechanism to prove that the sender really sent this message
▪ Example: Digital Signature

12/14/2024 11
Components of Cryptography
▪ Cryptography has five basic components:
1. Plain text: the message that you want to encrypt
2. Cipher text: the encrypted output (transformed message)

3. Encryption algorithm: The sequence of data processing steps that


go into transforming plaintext into ciphertext.
4. Decryption algorithm: The sequence of data processing steps that
go into transforming ciphertext back into plaintext.
5. Secret Key: is used to set some or all of the various parameters
used by the encryption algorithm.
12/14/2024 12
Components of Cryptography
▪ Cryptography has five basic components:

▪ [Fig. from Ref1, Stallings & Brown, Figure 2.1 Simplified Model of Symmetric Encryption , P42.]

12/14/2024 13
Components of Cryptography…
▪ Secret Key…
▪ A key can be thought of as simply a collection of
0101001110
bits
10111101110
▪ The more bits, the stronger the key 1100101

▪ Keys are tied to specific encryption algorithms

▪ Lengths vary depending on the encryption


algorithm

▪ Example: 128 bits is long for some


algorithms, but short for others

12/14/2024 14
Encryption and Decryption in Cryptography
▪ Encryption

It is the process of taking some data Data


and a key and feeding it into a
function and getting encrypted data Encryption Function
out.

Encrypted data is, in principle,


unreadable unless decrypted.
Cipher text

12/14/2024 15
Encryption and Decryption in Cryptography…
▪ Decryption

It is the process of taking Cipher text

encrypted data and a key and


feeding it into a function and
getting out the original data.

Encryption and decryption Decryption Function

functions are linked.

Data
12/14/2024 16
Classical cryptographic systems

• Are single key/symmetric cryptosystems


• Same key is used in deciphering
• Two types: transposition and substitution
• Transposition – ciphertext is created by rearranging characters
• E.g. rail fence: plain text – “HELLO WORLD, key=2
ciphter text – HLOOL
“HLOOLELWRD.” h l o o L
ELWRD e l w r d

• Substitution – ciphertext is created by changing characters


• E.g. Caesar cipher
Rail fence cipher - example

• E.g. 2: message = “hello world”, key = 3


=> Imaginary fence – 3 rows by 10 columns, shown below:

h o l Cipher text:
e l w r d
hol elwrd lo
l o
Caesar Cipher
▪ The Caesar Cipher technique is one of the earliest and simplest
methods of encryption technique.

▪ It’s simply a type of substitution cipher, i.e., each letter of a given


text is replaced by a letter with a fixed number of positions down
the alphabet.

▪ For example with a shift of 1, A would be replaced by B, B would


become C, and so on.

12/14/2024 19
Caesar Cipher…

▪ Thus to cipher a given text we need an integer value, known as a shift

which indicates the number of positions each letter of the text has been

moved down.

▪ The encryption can be represented using modular arithmetic by first

transforming the letters into numbers, according to the scheme, A = 0,

B = 1,…, Z = 25.

12/14/2024 20
Caesar Cipher…
▪ Encryption of a letter by a shift n can be described mathematically as:

𝐸𝑛 𝑥 = 𝑥 + 𝑛 𝑚𝑜𝑑(26)
(Encryption Phase with shift n)

𝐷𝑛 𝐸𝑛 𝑥 = 𝑥 − 𝑛 𝑚𝑜𝑑(26)

(Decryption Phase with shift n)

Note: If any case (Dn) value becomes negative (-ve), in this case, we will
add 26 in the negative value.
12/14/2024 21
Caesar Cipher…
▪ Use the Caesar cipher to encrypt and decrypt the message “MEET ME AT
TOGA PARTY" and the key (shift) value of this message is 3.

Letter value Letter Value Letter Value Letter Value


A 0 H 7 O 14 V 21
B 1 I 8 P 15 W 22
C 2 J 9 Q 16 X 23
D 3 K 10 R 17 Y 24
E 4 L 11 S 18 Z 25
F 5 M 12 T 19
G 6 N 13 U 20

Plain Text M->12


Key ->3
Cypher=> (12+3)mod26->15(P)

12/14/2024 22
Cont. …

Plain text=M En (12+3)mod 26 Cipher Text:15->P Plain text=T En (19+3)mod 26 Cipher Text:22->W
Plain text=E En (4+3)mod 26 Cipher Text:7->H Plain text=T En (19+3)mod 26 Cipher Text:22->W
Plain text=E En (4+3)mod 26 Cipher Text:7->H Plain text=O En (14+3)mod 26 Cipher Text:17->R
Plain text=T En (19+3)mod 26 Cipher Text:22->W Plain text=G En (6+3)mod 26 Cipher Text:9->J
Plain text=M En (12+3)mod 26 Cipher Text:15->P Plain text=A En (0+3)mod 26 Cipher Text:3->D
Plain text=E En (4+3)mod 26 Cipher Text:7->H Plain text=P En (15+3)mod 26 Cipher Text:18->S
Plain text=A En (0+3)mod 26 Cipher Text:3->D Plain text=A En (0+3)mod 26 Cipher Text:3->D
E_n(x)=(x+n)mod\ 26 Plain text=R En (17+3)mod 26 Cipher Text:20->U
The cypher message will be Plain text=T En (19+3)mod 26 Cipher Text:22->W
“PHHWPHDWWRJDSDUWB”
Plain text=Y En (24+3)mod 26 Cipher Text:27->B
Exercise
Prepare a cypher text for the following message
‘’we are running out of bullet and food the enemy is approaching we can’t keep our position more
than two days”
Caesar Cipher…
▪ Weakness of Caesar Cipher

▪ The Caesar Cipher is a secret/symmetric key cryptosystem; that is,


revealing the enciphering key makes decryption simple.

▪ In the Caesar cipher, the shift value is the enciphering key.

▪ Anyone knowing the shift value can immediately decrypt, so it must be


protected from unauthorized persons.

12/14/2024 24
Caesar Cipher…
▪ Weakness of Caesar Cipher…

▪ Exhaustive Key Search. There is yet another method for breaking


the Caesar cipher:

▪ Simply try all the possible keys!

▪ After all, there are only 26 viable keys in the ordinary alphabet, and
only 255 useful keys in the ASCII alphabet!

▪ This kind of attack is called an exhaustive search.

12/14/2024 25
Caesar Cipher…
▪ Weakness of Caesar Cipher…

▪ An exhaustive search is rarely effective against all but the simplest of


cryptosystems.

▪ Seeing that the Caesar cipher is so vulnerable, we attempt to see


stronger cryptosystems.

12/14/2024 26
Cryptanalysis and Types of Attacks
▪ Cryptology has two parts namely, Cryptography which focuses on
creating secret codes and Cryptanalysis which is the study of the
cryptographic algorithm and the breaking of those secret codes.

▪ The person practicing Cryptanalysis is called a Cryptanalyst.

▪ It helps us to better understand the cryptosystems and also helps us


improve the system by finding any weak point and thus work on the
algorithm to create a more secure secret code.

12/14/2024 27
Cryptanalysis and Types of Attacks…

▪ For example, a Cryptanalyst might try to decipher a ciphertext to

derive the plaintext.

▪ It can help us to deduce the plaintext or the encryption key.

12/14/2024 28
Cryptanalysis and Types of Attacks…
▪ Types of Cryptanalytic Attacks: cryptanalyst knows [at least] ciphertext &
encryption algorithm
▪ One possible attack: Brute-force – trying all keys, but impractical for large
key space

Table below: Average Time Required for Exhaustive Key Search [from Ref1, P 44]

12/14/2024 29
Cryptanalysis and Types of Attacks…
▪ Types of Cryptanalytic Attacks:
1. Known plain text analysis (KPA)

2. Chosen plain text analysis (CPA)

3. Cipher text only analysis (COA)

4. Man in the middle attack (MITM)

5. Adaptive chosen plain text analysis (ACPA)

12/14/2024 30
Cryptanalysis and Types of Attacks…
▪ Types of Cryptanalytic Attacks:

1. Known-Plaintext Analysis (KPA) :

▪ In this type of attack, some (one/more) plaintext-ciphertext pairs are


already known (or knows some plain text patterns will appear in the msg).
E.g headers of encoded messages

▪ Attacker maps them in order to find the encryption key.

▪ This attack is easier to use as a lot of information is already available.

12/14/2024 31
Cryptanalysis and Types of Attacks…
▪ Types of Cryptanalytic Attacks:

2. Chosen-Plaintext Analysis (CPA) :

▪ In this type of attack, the attacker chooses random plaintexts and obtains
the corresponding ciphertexts and tries to find the encryption key.

▪ Happens if analyst is able to get into source and insert chosen text
patterns that can reveal structure of the key

▪ Its very simple to implement like KPA but the success rate is quite low.

12/14/2024 32
Cryptanalysis and Types of Attacks…

▪ Types of Cryptanalytic Attacks:

3. Ciphertext-Only Analysis (COA) :

▪ In this type of attack, only some cipher-text is known and the attacker

tries to find the corresponding encryption key and plaintext.

▪ It is the hardest to implement but is the most probable attack as only

ciphertext is required.

12/14/2024 33
Cryptanalysis and Types of Attacks…
▪ Types of Cryptanalytic Attacks:

4. Man-In-The-Middle (MITM) attack :

▪ In this type of attack, attacker intercepts the message/key between two


communicating parties through a secured channel.

5. Adaptive Chosen-Plaintext Analysis (ACPA) :

▪ This attack is similar CPA. Here, the attacker requests the cipher texts

of additional plaintexts after they have ciphertexts for some texts.

12/14/2024 34
Cryptanalysis and Types of Attacks…
▪ Types of Attacks on Encrypted Messages :

12/14/2024 35
• THANK YOU
quiz
• What is cryptography and cryptoanalysis?
• What are advantages and problems with Caesar Cipher?

You might also like