SlideShare a Scribd company logo
1 of 29
Download to read offline
IT402 Cryptography and Cyber
Security
S8 B. Tech
Information Technology
ANVER. S. R
Associate Professor, CSE
LBS College of Engineering,
Kasaragod.
Module 5
Public key CryptoSystem
TYPES OF CRYPTOGRAPHY
● SYMMETRIC CRYPTOSYSTEM
− There is a secret(key), which is shared between
two persons.
− Encryption and Decryption are done using the
same key.
− If there are n participating entities, the number
of keys will be ??
− n(n-1)/2
− Based on substitution and permutation of
symbols.
− Made secure by providing confusion and
diffusion.
TYPES OF CRYPTOGRAPHY
● ASYMMETRIC CRYPTOSYSTEM
− There is a personal secret(private key),
which is not shared.
− Encryption and Decryption are done
using the different keys.
− For every private key, there is a
corresponding public key belonging to
each person.
− If there are n participating entities, the
number of keys will be ??
− 2n, n private keys and n public keys
Asymmetric Cryptosystem
● Based on applying
mathematical functions to
numbers.
● Its made secure by providing
mathematically hard problems.
● More secure from cryptanalysis
than symmetric cryptosystem.
● computationally infeasible to
find private key knowing only
algorithm & public key
● computationally easy to
en/decrypt messages when the
relevant (private/public) key
is known.
Public Key
Cryptosystem-Components
● Asymetric Keys
− Two related keys,
− a public key and a private key,
− used to perform complementary
operations,
− encryption and decryption or
− signature generation and
signature verification
● Public Key Certificate
− A digital document issued and
digitally signed by the private key of
a Certification authority that binds
the name of a subscriber to a public
key.
− The certificate indicates that the
subscriber identified in the
certificate has sole control and
− access to the corresponding private
key.
Public key Cryptography –
components.
● Public key cryptographic
algorithm:
− A cryptographic algorithm
that uses two related keys,
− a public key and a private
key
● Public key infrastructure (PKI)
− A set of policies, processes,
server platform, software and
workstations used for the
purpose of administrating
certificates and public-private
key pairs, including the ability to
issue, maintain, and revoke
public certificate.
Public key cryptosystem –
Ingrediants.
● Plaintext
− This is a readable message or
data that is fed into the
algorithm as the input
● Encryption algorithm
− The encryption algorithm
performs various
transformations on the plaintext
● Public and private keys
− this is a pair of keys that have been
selected so that if one is used for
encryption, the other is used for
decryption.
− The exact transformations
performed by the algorithm
depend on the public key and the
private key that is provided as
input.
PKC - Ingredients
● Cipher text
− this is the scrambled
message produced as
output.
● Decryption algorithm
− The algorithm that accepts the
cipher text and matching key
and produces the original plain
text.
PKC-The essential steps.
● Each user generates a pair of keys to be used for the encryption and decryption of
messages
● Each user places one of the two keys in public register or other accessible file. This is
public key. The other key is kept private. Each user maintains a collection of public keys
obtained from others
● If Bob wishes to send a confidential message to Alice, Bob encrypts the message using
Alice’s public key.
● When Alice receives the message, she decrypts it using her private key
● No other recipient can decrypt the message because only Alice knows her private key
Public key cryptography
● Public key cryptography –
authentication.
●
●
●
● Public key cryptography –
secrecy
Public key cryptography – secrecy
and authentication
PKC-Applications
● Applications are divided in three broad categories:
− Encryption/decryption – The sender encrypts the message with the
recipient’s public key.
− Digital Signature – The sender “signs” a message with its private key
− Key exchange – two sides cooperate toexchange a session key
Mathematics for public key
cryptosystem
● Euler’s Phi(Totient) function:
− Euler's totient function counts the
positive integers up to a given integer n
that are relatively prime to n. It is
denoted as ϕ(n)
− Zn* denoted the reduced residue mod n
system.
− ϕ(n) is the cardinality of Zn*
− Example n = 9
− Φ(1)=0, ϕ(p)=p-1.
● Fermat’s little Theorem.
− if p is a prime number, then for
any integer a,which is not
divisible by p,
● ap − 1
≡ 1 ( mod p )
● ap
≡ a ( mod p )
− Example:
● a = 2
● p = 7
Mathematics for Public key
cryptosystem.
● Euler’s Theorem
− Generalization of fermat’s
little theorem.
− In Fermat’s theorem, modulus
p, a prime number
− Here, n is an integer.
− aφ ( n )
≡ 1 ( mod n )
− ak*φ ( n )+1
≡ a ( mod n )
Asymmetric Cryptosystem – hard
problems
● Discrete logarithm problem
− Defined with regard to multiplicative
cyclic groups.
− h=gx
in G, then x is the discrete log of
h to the base g.
− Not always hard, hardness depends
on the groups.
− Zp
*
, p should be a safe prime, a
prime number which equals 2q+1
where q is a large prime number.
● Prime factorization problem
− Prime factorization is a way of
writing a composite number as
a product of prime numbers.
− Is easy if n is the product of
small primes.
− Is hard, if n is the product of
very large primes.
Asymmetric crypto system
● Function:
− A rule that associates (maps)
one element in set A to one
element in set B.
● Invertible function:
− A function that associates each
element in the range with
exactly one element in the
domain.
● One way function(OWF)
− Is a function that satisfies
● f is easy to compute,ie.If x is given, can
compute y = f(x)
● f-1
is difficult to compute, if y is given,
computationally infeasible to calculate
x.
− Example:
● Given p, q, n = p * q
● If given n, very difficult to compute p
and q
Asymmetric Cryprosystem
● Trapdoor function:
− Is a one way function with an
additional property.
− Given y and a trapdoor
(secret), x can be computed
easily.
● Example:
− Given x, k and n
− Easy to calculate
● y = xk
(mod n)
− Given y, k and n, difficult
− Given y, n and k’ such that
k*k’=1 (mod ϕ(n)), then
● x = yk’
(mod n)
RSA Algorithm
● Asymmetric key cryptographic algorithm
● The name RSA is given by taking the firstname of its inventors
Rivest-Shamir-Adleman.
● It uses prime numbers
− This algorithm is based on the fact that it is easy to find and multiply large prime numbers
together, but it is extremely difficult to factor their product
− The private and public keys in RSA are based on very large prime numbers
● The real challenge in RSA is the selection and generation of the public key and
private key
RSA Algorithm
1) Choose two prime numbers p and q
2) Calculate n = p * q
3) Calculate ϕ(n) as (p-1) * (q-1)
4) Select the public key e (i.e. Encryption key) such that it is relatively prime to ϕ(n)
5) Calculate the private key d (i.e. Decryption key) such that d is the multiplicative
inverse of e (mod ϕ(n))
6) Publish (n, e) as public key
7) Keep (p, q, d) as private key
RSA algorithm
● RSA Encryption(Sender Side)
● Alice
− Sender chooses the Plaintext P
− Public Key of recipient = (n, e)
− Ciphertext C = Pe
(mod n)
● RSA Decryption (Receiver
Side)
● Bob
− Receiver reciever the ciphertext
C encrypted using the public key
of recipient.
− Private key = d
− Plaintext P = Cd
(mod n)
RSA algorithm - Example
1) Choose two large prime numbers p and q,
1) let p = 7 and q = 17
2) Calculate n = p * q, n = 7 * 17 = 119
3) Calculate ϕ(n) as (p-1) * (q-1), ϕ(n) = 6 * 16 = 96.
4) Select the public key e (i.e. Encryption key) such that it is relatively prime to ϕ(n)=96
1) The factors of 96 are 2,2,2,2,2 and 3 ( because 96 = 2*2*2*2*2*3)
2) Thus we have to choose E such that none of the factors of E is 2 and 3
3) Lets choose E as 5
RSA Algorithm - Example
1. Calculate the private key d (i.e. Decryption key) such that d is the
multiplicative inverse of e (mod ϕ(n))
ie, (d * e) mod ϕ(n) = 1 We have (D * 5) mod (7-1) * (17-1) = 1
i.e. (d * 5) mod 96 = 1
We can use Extended Euclid algorithm to find the multiplicative inverse of 5 mod 96.
d=77, So that (77 * 5) mod (96) = 385 mod 96 = 1
2. Public key = ( 119, 5)
3. Private key is 77
RSA Algorithm - Example
● Encryption – Sender Side -
Alice
− P = 10
− Public key = (119, 5)
− C = 105
mod 119
− = 100000 mod 119
− = 40.
− Send C=40 to the receiver.
● Decryption – Receiver Side
− Cipher Text Received = 40
− Private key d = 77
− Plaintext P is calculated as
● P = 4077
mod 119
● = 10.
Proof of RSA
● The private key d is unique and d must be co-prime to ɸ (n)
● Proof :
− We have taken e such that e and ɸ (n) are co-prime.
− Therefore, there exists only one unique integer d, such that ed mod ɸ (n) = 1 .
− We have to prove d is unique
● Assume that d is not co-prime so t is the greatest common divisor of d and ɸ (n)
● Let d = c1* t and ɸ (n) = c2* t.
● From ed mod ɸ(n) = 1. We know ed = c3 * ɸ (n) + 1 for some integer c3 .
● Hence: e * c1* t = c3 *c2 * t + 1
● t(e * c1- c3 * c2)=1
− Therefore t=1.
● Hence it is proved that the private key d is unique and co-prime with ɸ (n) .
Proof of RSA
● Let C be the ciphertext recieved by Bob.
● Bob Computes the plaintext as P1.
● We have to prove that P1 = P
− Bob Computes P1 as P1 = Cd
(mod n)
− i.e. P1 = (Pe
)d
(mod n)
− = Ped
(mod n)
− ed = k * ɸ(n) + 1 (Since, ed (mod ɸ(n) = 1)
− P1 = Pk * ɸ(n) + 1
(mod n)
− = P mod n = P
− Hence Proved.
Attacking RSA
● Brute force attacks: try all possible private keys
− As in the other cases defend using large keys: nowadays integers between 1024 and
2048 bits
● Mathematical attacks
− Factor n into its two primes p,q: this is a hard problem for large n
− Determine φ(n) directly without first determining p,q: this math problem is
equivalent to factoring
− Determine d directly, without first determining φ(n): this is believed to be at least as
difficult as factoring
Attacking RSA
● Timing attacks:
− determine a private key by keeping track of how long a computer
takes to decipher a message (ciphertext-only attack) –this is
essentially an attack on the fast exponentiation algorithm but can be
adapted for any other algorithm
− Whenever a bit is 1 the algorithm has more computations to do and
takes more time
Timing Attack - Countermeasures
● Countermeasures:
− Ensure that all exponentiations take the same time before returning a result: degrade
performance of the algorithm
− Add some random delay: if there is not enough noise the attack succeeds
− Blinding: multiply the ciphertext by a randomnumber before performing exponentiation
–in this way the attacker does not know the input to the exponentiation algorithm.
● Choose r between 1 to n-1.
● C1 = C * re
mod n
● P1 = C1d
mod n
● P = P1 * r-1
mod n
Questions?

More Related Content

What's hot

An Analysis of Secure Remote Password (SRP)
An Analysis of Secure Remote Password (SRP)An Analysis of Secure Remote Password (SRP)
An Analysis of Secure Remote Password (SRP)Dharmalingam Ganesan
 
Security of RSA and Integer Factorization
Security of RSA and Integer FactorizationSecurity of RSA and Integer Factorization
Security of RSA and Integer FactorizationDharmalingam Ganesan
 
An Analysis of RSA Public Exponent e
An Analysis of RSA Public Exponent eAn Analysis of RSA Public Exponent e
An Analysis of RSA Public Exponent eDharmalingam Ganesan
 
On deriving the private key from a public key
On deriving the private key from a public keyOn deriving the private key from a public key
On deriving the private key from a public keyDharmalingam Ganesan
 
Computing the Square Roots of Unity to break RSA using Quantum Algorithms
Computing the Square Roots of Unity to break RSA using Quantum AlgorithmsComputing the Square Roots of Unity to break RSA using Quantum Algorithms
Computing the Square Roots of Unity to break RSA using Quantum AlgorithmsDharmalingam Ganesan
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSASrilal Buddika
 
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE Qualcomm
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key CryptographyGopal Sakarkar
 
Public key cryptography
Public key cryptography Public key cryptography
Public key cryptography rinnocente
 
Dependency Analysis of RSA Private Variables
Dependency Analysis of RSA Private VariablesDependency Analysis of RSA Private Variables
Dependency Analysis of RSA Private VariablesDharmalingam Ganesan
 
Implementation of RSA Algorithm for Speech Data Encryption and Decryption
Implementation of RSA Algorithm for Speech Data Encryption and DecryptionImplementation of RSA Algorithm for Speech Data Encryption and Decryption
Implementation of RSA Algorithm for Speech Data Encryption and DecryptionMd. Ariful Hoque
 
How do computers exchange secrets using Math?
How do computers exchange secrets using Math?How do computers exchange secrets using Math?
How do computers exchange secrets using Math?Dharmalingam Ganesan
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyMd. Shafiul Alam Sagor
 
On the Secrecy of RSA Private Keys
On the Secrecy of RSA Private KeysOn the Secrecy of RSA Private Keys
On the Secrecy of RSA Private KeysDharmalingam Ganesan
 

What's hot (20)

An Analysis of Secure Remote Password (SRP)
An Analysis of Secure Remote Password (SRP)An Analysis of Secure Remote Password (SRP)
An Analysis of Secure Remote Password (SRP)
 
Security of RSA and Integer Factorization
Security of RSA and Integer FactorizationSecurity of RSA and Integer Factorization
Security of RSA and Integer Factorization
 
An Analysis of RSA Public Exponent e
An Analysis of RSA Public Exponent eAn Analysis of RSA Public Exponent e
An Analysis of RSA Public Exponent e
 
On deriving the private key from a public key
On deriving the private key from a public keyOn deriving the private key from a public key
On deriving the private key from a public key
 
RSA Two Person Game
RSA Two Person GameRSA Two Person Game
RSA Two Person Game
 
Computing the Square Roots of Unity to break RSA using Quantum Algorithms
Computing the Square Roots of Unity to break RSA using Quantum AlgorithmsComputing the Square Roots of Unity to break RSA using Quantum Algorithms
Computing the Square Roots of Unity to break RSA using Quantum Algorithms
 
Analysis of Shared RSA Modulus
Analysis of Shared RSA ModulusAnalysis of Shared RSA Modulus
Analysis of Shared RSA Modulus
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSA
 
RSA
RSARSA
RSA
 
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptography
 
Public key cryptography
Public key cryptography Public key cryptography
Public key cryptography
 
Dependency Analysis of RSA Private Variables
Dependency Analysis of RSA Private VariablesDependency Analysis of RSA Private Variables
Dependency Analysis of RSA Private Variables
 
Implementation of RSA Algorithm for Speech Data Encryption and Decryption
Implementation of RSA Algorithm for Speech Data Encryption and DecryptionImplementation of RSA Algorithm for Speech Data Encryption and Decryption
Implementation of RSA Algorithm for Speech Data Encryption and Decryption
 
Rsa rivest shamir adleman
Rsa rivest shamir adlemanRsa rivest shamir adleman
Rsa rivest shamir adleman
 
public-key cryptography Shamir
public-key cryptography Shamirpublic-key cryptography Shamir
public-key cryptography Shamir
 
How do computers exchange secrets using Math?
How do computers exchange secrets using Math?How do computers exchange secrets using Math?
How do computers exchange secrets using Math?
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key Cryptography
 
On the Secrecy of RSA Private Keys
On the Secrecy of RSA Private KeysOn the Secrecy of RSA Private Keys
On the Secrecy of RSA Private Keys
 

Similar to Public key CryptoSystem

Similar to Public key CryptoSystem (20)

3 pkc+rsa
3 pkc+rsa3 pkc+rsa
3 pkc+rsa
 
Public Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithm
 
Information and network security 33 rsa algorithm
Information and network security 33 rsa algorithmInformation and network security 33 rsa algorithm
Information and network security 33 rsa algorithm
 
Rsa
RsaRsa
Rsa
 
RSA Algorithm.ppt
RSA Algorithm.pptRSA Algorithm.ppt
RSA Algorithm.ppt
 
Introduction to cryptography
Introduction to cryptographyIntroduction to cryptography
Introduction to cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptxRivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
 
RSA Algm.pptx
RSA Algm.pptxRSA Algm.pptx
RSA Algm.pptx
 
New ppt.ppt
New ppt.pptNew ppt.ppt
New ppt.ppt
 
RSA-W7(rsa) d1-d2
RSA-W7(rsa) d1-d2RSA-W7(rsa) d1-d2
RSA-W7(rsa) d1-d2
 
Ch9
Ch9Ch9
Ch9
 
Unit --3.ppt
Unit --3.pptUnit --3.ppt
Unit --3.ppt
 
RSA & MD5 algorithm
RSA & MD5 algorithmRSA & MD5 algorithm
RSA & MD5 algorithm
 
ch09_rsa_nemo.ppt
ch09_rsa_nemo.pptch09_rsa_nemo.ppt
ch09_rsa_nemo.ppt
 
rsa-1
rsa-1rsa-1
rsa-1
 
rsa-1
rsa-1rsa-1
rsa-1
 
rsa-1
rsa-1rsa-1
rsa-1
 
The rsa algorithm JooSeok Song
The rsa algorithm JooSeok SongThe rsa algorithm JooSeok Song
The rsa algorithm JooSeok Song
 
Ch09
Ch09Ch09
Ch09
 

Recently uploaded

HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 

Recently uploaded (20)

HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 

Public key CryptoSystem

  • 1. IT402 Cryptography and Cyber Security S8 B. Tech Information Technology ANVER. S. R Associate Professor, CSE LBS College of Engineering, Kasaragod. Module 5 Public key CryptoSystem
  • 2. TYPES OF CRYPTOGRAPHY ● SYMMETRIC CRYPTOSYSTEM − There is a secret(key), which is shared between two persons. − Encryption and Decryption are done using the same key. − If there are n participating entities, the number of keys will be ?? − n(n-1)/2 − Based on substitution and permutation of symbols. − Made secure by providing confusion and diffusion.
  • 3. TYPES OF CRYPTOGRAPHY ● ASYMMETRIC CRYPTOSYSTEM − There is a personal secret(private key), which is not shared. − Encryption and Decryption are done using the different keys. − For every private key, there is a corresponding public key belonging to each person. − If there are n participating entities, the number of keys will be ?? − 2n, n private keys and n public keys
  • 4. Asymmetric Cryptosystem ● Based on applying mathematical functions to numbers. ● Its made secure by providing mathematically hard problems. ● More secure from cryptanalysis than symmetric cryptosystem. ● computationally infeasible to find private key knowing only algorithm & public key ● computationally easy to en/decrypt messages when the relevant (private/public) key is known.
  • 5. Public Key Cryptosystem-Components ● Asymetric Keys − Two related keys, − a public key and a private key, − used to perform complementary operations, − encryption and decryption or − signature generation and signature verification ● Public Key Certificate − A digital document issued and digitally signed by the private key of a Certification authority that binds the name of a subscriber to a public key. − The certificate indicates that the subscriber identified in the certificate has sole control and − access to the corresponding private key.
  • 6. Public key Cryptography – components. ● Public key cryptographic algorithm: − A cryptographic algorithm that uses two related keys, − a public key and a private key ● Public key infrastructure (PKI) − A set of policies, processes, server platform, software and workstations used for the purpose of administrating certificates and public-private key pairs, including the ability to issue, maintain, and revoke public certificate.
  • 7. Public key cryptosystem – Ingrediants. ● Plaintext − This is a readable message or data that is fed into the algorithm as the input ● Encryption algorithm − The encryption algorithm performs various transformations on the plaintext ● Public and private keys − this is a pair of keys that have been selected so that if one is used for encryption, the other is used for decryption. − The exact transformations performed by the algorithm depend on the public key and the private key that is provided as input.
  • 8. PKC - Ingredients ● Cipher text − this is the scrambled message produced as output. ● Decryption algorithm − The algorithm that accepts the cipher text and matching key and produces the original plain text.
  • 9. PKC-The essential steps. ● Each user generates a pair of keys to be used for the encryption and decryption of messages ● Each user places one of the two keys in public register or other accessible file. This is public key. The other key is kept private. Each user maintains a collection of public keys obtained from others ● If Bob wishes to send a confidential message to Alice, Bob encrypts the message using Alice’s public key. ● When Alice receives the message, she decrypts it using her private key ● No other recipient can decrypt the message because only Alice knows her private key
  • 10. Public key cryptography ● Public key cryptography – authentication. ● ● ● ● Public key cryptography – secrecy
  • 11. Public key cryptography – secrecy and authentication
  • 12. PKC-Applications ● Applications are divided in three broad categories: − Encryption/decryption – The sender encrypts the message with the recipient’s public key. − Digital Signature – The sender “signs” a message with its private key − Key exchange – two sides cooperate toexchange a session key
  • 13. Mathematics for public key cryptosystem ● Euler’s Phi(Totient) function: − Euler's totient function counts the positive integers up to a given integer n that are relatively prime to n. It is denoted as ϕ(n) − Zn* denoted the reduced residue mod n system. − ϕ(n) is the cardinality of Zn* − Example n = 9 − Φ(1)=0, ϕ(p)=p-1. ● Fermat’s little Theorem. − if p is a prime number, then for any integer a,which is not divisible by p, ● ap − 1 ≡ 1 ( mod p ) ● ap ≡ a ( mod p ) − Example: ● a = 2 ● p = 7
  • 14. Mathematics for Public key cryptosystem. ● Euler’s Theorem − Generalization of fermat’s little theorem. − In Fermat’s theorem, modulus p, a prime number − Here, n is an integer. − aφ ( n ) ≡ 1 ( mod n ) − ak*φ ( n )+1 ≡ a ( mod n )
  • 15. Asymmetric Cryptosystem – hard problems ● Discrete logarithm problem − Defined with regard to multiplicative cyclic groups. − h=gx in G, then x is the discrete log of h to the base g. − Not always hard, hardness depends on the groups. − Zp * , p should be a safe prime, a prime number which equals 2q+1 where q is a large prime number. ● Prime factorization problem − Prime factorization is a way of writing a composite number as a product of prime numbers. − Is easy if n is the product of small primes. − Is hard, if n is the product of very large primes.
  • 16. Asymmetric crypto system ● Function: − A rule that associates (maps) one element in set A to one element in set B. ● Invertible function: − A function that associates each element in the range with exactly one element in the domain. ● One way function(OWF) − Is a function that satisfies ● f is easy to compute,ie.If x is given, can compute y = f(x) ● f-1 is difficult to compute, if y is given, computationally infeasible to calculate x. − Example: ● Given p, q, n = p * q ● If given n, very difficult to compute p and q
  • 17. Asymmetric Cryprosystem ● Trapdoor function: − Is a one way function with an additional property. − Given y and a trapdoor (secret), x can be computed easily. ● Example: − Given x, k and n − Easy to calculate ● y = xk (mod n) − Given y, k and n, difficult − Given y, n and k’ such that k*k’=1 (mod ϕ(n)), then ● x = yk’ (mod n)
  • 18. RSA Algorithm ● Asymmetric key cryptographic algorithm ● The name RSA is given by taking the firstname of its inventors Rivest-Shamir-Adleman. ● It uses prime numbers − This algorithm is based on the fact that it is easy to find and multiply large prime numbers together, but it is extremely difficult to factor their product − The private and public keys in RSA are based on very large prime numbers ● The real challenge in RSA is the selection and generation of the public key and private key
  • 19. RSA Algorithm 1) Choose two prime numbers p and q 2) Calculate n = p * q 3) Calculate ϕ(n) as (p-1) * (q-1) 4) Select the public key e (i.e. Encryption key) such that it is relatively prime to ϕ(n) 5) Calculate the private key d (i.e. Decryption key) such that d is the multiplicative inverse of e (mod ϕ(n)) 6) Publish (n, e) as public key 7) Keep (p, q, d) as private key
  • 20. RSA algorithm ● RSA Encryption(Sender Side) ● Alice − Sender chooses the Plaintext P − Public Key of recipient = (n, e) − Ciphertext C = Pe (mod n) ● RSA Decryption (Receiver Side) ● Bob − Receiver reciever the ciphertext C encrypted using the public key of recipient. − Private key = d − Plaintext P = Cd (mod n)
  • 21. RSA algorithm - Example 1) Choose two large prime numbers p and q, 1) let p = 7 and q = 17 2) Calculate n = p * q, n = 7 * 17 = 119 3) Calculate ϕ(n) as (p-1) * (q-1), ϕ(n) = 6 * 16 = 96. 4) Select the public key e (i.e. Encryption key) such that it is relatively prime to ϕ(n)=96 1) The factors of 96 are 2,2,2,2,2 and 3 ( because 96 = 2*2*2*2*2*3) 2) Thus we have to choose E such that none of the factors of E is 2 and 3 3) Lets choose E as 5
  • 22. RSA Algorithm - Example 1. Calculate the private key d (i.e. Decryption key) such that d is the multiplicative inverse of e (mod ϕ(n)) ie, (d * e) mod ϕ(n) = 1 We have (D * 5) mod (7-1) * (17-1) = 1 i.e. (d * 5) mod 96 = 1 We can use Extended Euclid algorithm to find the multiplicative inverse of 5 mod 96. d=77, So that (77 * 5) mod (96) = 385 mod 96 = 1 2. Public key = ( 119, 5) 3. Private key is 77
  • 23. RSA Algorithm - Example ● Encryption – Sender Side - Alice − P = 10 − Public key = (119, 5) − C = 105 mod 119 − = 100000 mod 119 − = 40. − Send C=40 to the receiver. ● Decryption – Receiver Side − Cipher Text Received = 40 − Private key d = 77 − Plaintext P is calculated as ● P = 4077 mod 119 ● = 10.
  • 24. Proof of RSA ● The private key d is unique and d must be co-prime to ɸ (n) ● Proof : − We have taken e such that e and ɸ (n) are co-prime. − Therefore, there exists only one unique integer d, such that ed mod ɸ (n) = 1 . − We have to prove d is unique ● Assume that d is not co-prime so t is the greatest common divisor of d and ɸ (n) ● Let d = c1* t and ɸ (n) = c2* t. ● From ed mod ɸ(n) = 1. We know ed = c3 * ɸ (n) + 1 for some integer c3 . ● Hence: e * c1* t = c3 *c2 * t + 1 ● t(e * c1- c3 * c2)=1 − Therefore t=1. ● Hence it is proved that the private key d is unique and co-prime with ɸ (n) .
  • 25. Proof of RSA ● Let C be the ciphertext recieved by Bob. ● Bob Computes the plaintext as P1. ● We have to prove that P1 = P − Bob Computes P1 as P1 = Cd (mod n) − i.e. P1 = (Pe )d (mod n) − = Ped (mod n) − ed = k * ɸ(n) + 1 (Since, ed (mod ɸ(n) = 1) − P1 = Pk * ɸ(n) + 1 (mod n) − = P mod n = P − Hence Proved.
  • 26. Attacking RSA ● Brute force attacks: try all possible private keys − As in the other cases defend using large keys: nowadays integers between 1024 and 2048 bits ● Mathematical attacks − Factor n into its two primes p,q: this is a hard problem for large n − Determine φ(n) directly without first determining p,q: this math problem is equivalent to factoring − Determine d directly, without first determining φ(n): this is believed to be at least as difficult as factoring
  • 27. Attacking RSA ● Timing attacks: − determine a private key by keeping track of how long a computer takes to decipher a message (ciphertext-only attack) –this is essentially an attack on the fast exponentiation algorithm but can be adapted for any other algorithm − Whenever a bit is 1 the algorithm has more computations to do and takes more time
  • 28. Timing Attack - Countermeasures ● Countermeasures: − Ensure that all exponentiations take the same time before returning a result: degrade performance of the algorithm − Add some random delay: if there is not enough noise the attack succeeds − Blinding: multiply the ciphertext by a randomnumber before performing exponentiation –in this way the attacker does not know the input to the exponentiation algorithm. ● Choose r between 1 to n-1. ● C1 = C * re mod n ● P1 = C1d mod n ● P = P1 * r-1 mod n