Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 44

CRYPTOGRAPHY

Dr. Susmita Mandal


Assistant Professor
Center for Payment Systems
IDRBT Hyderabad
Reference Books
Contents
• Introduction to Cryptography
• Objective of Information Security
• Security Attacks, Services and Mechanisms
• Mathematics
Introduction
• In the past cryptography was associated with the military for
warfare.

• Around 1976, the need of commerce for confidentiality has


brought cryptography out of the dominance of government
agencies and has made it a science of study.

• Cryptography has broadened out its scope from traditional


military context into a financial context bridging answers to
the question related to-
 fairness,
 trust,
 privacy and authentication Enigma in World War II

4
Financial Cryptography
• The term Financial Cryptography was invented by Robert Hettinga which includes
cryptographic algorithms necessary for the secure financial transaction.

•  Therefore, it has become an essential component for electronic commerce which refers
to commercial transactions conducted online.
• For example, in an online transaction, the user’s credit card information is transmitted over the internet.
• There is a possibility for a hacker to steal this personal information.
• Therefore, when transmitting confidential information, it is important to use a data protection method.

• One such method is cryptography. It hides the real information when they are
transmitted over the network.
Cryptography
Basic idea of secure communication
• Cryptography is the practice and study of
hiding information. It is the Art or Science of
converting a plain intelligible data into an
unintelligible data and again retransforming
that message into its original form.

• In a broader sense
• Mathematical techniques related to
information security
• About secure communication in the
presence of adversaries

• This is based on methods like encryption,


decryption, signing, generating of pseudo
random numbers, etc.
Objectives of Information Security
• Confidentiality (secrecy): Only the sender and intended receiver should be able to understand the contents
of the transmitted message

• Authentication: Both the sender and receiver need to confirm the identity of other party involved in the
communication

• Data integrity: The content of their communication is not altered, either maliciously or by accident, in
transmission.

• Availability: Timely accessibility of data to authorized entities.

• Non-repudiation: An entity is prevented from denying its previous commitments or actions

• Access control: An entity cannot access any entity that it is not authorized to.

• Anonymity: The identity of an entity if protected from others.


Dimensions of e-commerce security
Security Attacks, Services and Mechanisms
• To assess the security needs of an organization effectively, there must be some
systematic way of defining the requirements for security.

• We consider three aspects of information security:


• Security attack – Any action that compromises the security of information owned by
an organization.
• Security mechanism – A mechanism that is designed to detect, prevent or recover
from a security attack.
• Security service – A service that enhances the security of the data processing
systems and the information transfers of an organization. The services are intended
to counter security attacks and they make use of one or more security mechanisms
to provide the service.
ciphertext only

Exploiting known plaintext


mathematical
Cryptanalytic
weakness in the
algorithm chosen
plaintext/ciphertext

Cryptographic
Attacks
chosen text

Threatens the
security goals-
Non
confidentiality,
Cryptanalytic
integrity, & Security Attacks
authentication

Unauthorized access or interception of data

Information obtained from monitoring online traffic


Services and Mechanism
• The International Telecommunication Union-Telecommunication Standardization
Sector (ITU-T) provides some security services and some mechanisms to
implement those services.

• As mechanism or combination of mechanisms are used to provide a service.


• Security Services
• Security Mechanism
• Relation between Services and Mechanisms
Relationship between services and mechanism
Mathematics of Cryptography
Integer Arithmetic:
Deals with numbers that are positive, negative or zero, but cannot be a fraction.

Set of Integers
The set of integers, represented as “Z“ contains all integral numbers (with no
fraction) from negative infinity to positive infinity.
Binary Operations
• A binary operation takes two inputs and creates one output.
• In cryptography, we are interested in three binary operations i.e.,
addition, subtraction, and multiplication.

Ex:
• 5+(-9)=-4, Note: division doesn’t fit here
• (-5)× 9=-45 bcz it produces 2 output
Example
When we divide two integers we will have an equation that looks like the following:
= q remainder r or a= q × n +r

where a is the dividend, n is the divisor, q is the quotient, and r is the remainder.

Assume that a = 255 and n = 11. We can find q = 23 and R = 2 using the division algorithm.
Restriction on integer division relation
• While using computer or calculator when a is
negative then r and q are also negative.
(so how to impose the restrictions)
The solution is, we decrement the value of q by 1
and we add the value of n to r to make it positive.

n>0 0
-255=(-23 ×11) +(-2)

so decrement -23 to -24 and add 11 to -2 to make


it 9 as

-255=(-24 × 11) +9
Divisibility
• If a is not zero and we let r = 0 in the division relation , we get a = q × n
• When we are not interested in the value of q, we can write-
If the remainder is zero, a | n
If the remainder is not zero, a n

Example:
• The integer 4 divides the integer 32 because 32 = 8 × 4.
We show this as 4 | 32

• The number 8 does not divide the number 42 because 42 = 5 × 8 + 2. There is a remainder, the
number 2, in the equation.
• We show this as 8 42
Properties of divisibility
Greatest Common Divisor
• The greatest common divisor of two positive integers is the largest
integer that can divide both integers.
Euclidean Algorithm
• To be faster while finding the GCD of 2 large numbers.

• Facts:
 Fact 1: gcd (a, 0) = a
 Fact 2: gcd (a, b) = gcd (b, r), where r is the remainder of dividing a by b
The Fact 2 allows us to change the value of a, b until b becomes 0.
• Example:
gcd (36,10)= gcd (10,6)= gcd (6,4)= gcd(4,2)= gcd(2,0)=2
Euclidean Algorithm

Note: When gcd (a, b) = 1, we say that a and b are relatively prime
Find the greatest common divisor of 25 and 60.

• We have gcd (25, 60) = 5


Extended Euclidean Algorithm
• Given two integers a and b, we often need to find other two integers,
s and t, such that

• The extended Euclidean algorithm can calculate the gcd (a, b) and at
the same time calculate the value of s and t.
Extended Euclidean algorithm, part a
Extended Euclidean algorithm, part b
Given a = 161 and b = 28, find gcd (a, b) and the values of s and t.

• We get gcd (161, 28) = 7, s = −1 and t = 6.


Question
• Find GCD of 88 and 220
• Using extended Euclidean find gcd of 84 and 320 and also find the
value of s & t.
Modular Arithmetic
• It is usual to study cryptography in terms of numbers rather than letters. To do so, we need to use modular
arithmetic.
• Modular arithmetic is concerned with finding the remainder of integer division with respect to some other given
integer n, called the modulus.
Every time you think about “time,” you use modular arithmetic

Our clock system uses


modulo 12 arithmetic. 19 mod 12 = 7 mod 12
However, instead of a 0 7 represents the remainder
we use the number 12.

What will the clock show in 10 hours if its 9.00 AM/PM?


Well, 9 + 10 = 19, but “19 o’clock” is not something that can be displayed on a clock with the numbers 1 to 12.
So, what do we do?
We subtract 12 from 19 and proudly say that the clock will show 7:00.
Modulo Operator
• The modulo operator is shown as mod. The second input (n) is called
the modulus. The output r is called the residue.

Division algorithm and modulo operator


Exercise
• Find the result of the following operations:
a. 27 mod 5
b. 36 mod 12
c. −18 mod 14
d. −7 mod 10
Set of Residues
• The modulo operation creates a set, which in modular arithmetic is
referred to as the set of least residues modulo n, or Zn.

Some Zn sets
Congruence
• In cryptography we use the concept of congruence instead of
equality.
• For example, 2 mod 10 =2, 12 mod 10=2, 22 mod 2=2.
• Therefore, 2,12, and 22 are called congruent mod 10.
• To show that two integers are congruent, we use the congruence
operator ( ≡ ).
Discussion

• When you divide any integer by n, the


remainder is always an integer between 0
and n − 1 inclusive

• Due to the ‘wrap-around’ property of


modular arithmetic, basic operations such
as addition, subtraction and
multiplication behave slightly differently
to standard operations.
Operation in Zn
• The three binary operations (addition, subtraction, multiplication)
that we discussed for the set Z can also be defined for the set Zn. The
result may need to be mapped to Zn using the mod operator.
Example
• Perform the following operations (the inputs come from Zn):
a. Add 7 to 14 in Z15.
b. Subtract 11 from 7 in Z13.
c. Multiply 11 by 7 in Z20.
Properties
• The following shows the application of the above properties:
1. (1,723,345 + 2,124,945) mod 11 = (8 + 9) mod 11 = 6
2. (1,723,345 − 2,124,945) mod 16 = (8 − 9) mod 11 = 10
3. (1,723,345 × 2,124,945) mod 16 = (8 × 9) mod 11 = 6
Inverses
• Additive inverse (relative to an addition operation) or a multiplicative inverse (relative to a
multiplication operation).
• Additive Inverse
• In Zn , two numbers a and b are additive inverses of each other if

• In Zn, The additive inverse of a can be calculated as b=n-a. For example, the additive inverse of 4
in Z10 is 10-4=6
• Find all additive inverse pairs in Z10.
• The six pairs of additive inverses are (0, 0), (1, 9), (2, 8), (3, 7), (4,6), and (5, 5). In this list, 0 is the
additive inverse of itself, so is 5.
Multiplicative inverse
• In Zn , two numbers a and b are the multiplicative inverse of each
other if

• Find the multiplicative inverse of 8 in Z10.


Solution
There is no multiplicative inverse because gcd (10, 8) = 2 ≠ 1. In other
words, we cannot find any number between 0 and 9 such that when
multiplied by 8, the result is congruent to 1.
Use of GCD
• The integer a in Zn has a multiplicative inverse if and only if gcd(n,a)

• The extended Euclidean algorithm finds the multiplicative inverses of


b in Zn when n and b are given and gcd (n, b) = 1. The multiplicative
inverse of b is the value of t after being mapped to Zn.
Using extended Euclidean algorithm to find
multiplicative inverse
Find the multiplicative inverse of 11 in Z 26.
Class Work
• Find the multiplicative inverse of 23 in Z100 manually and coding.

You might also like