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

publickeysystem

The document covers the fundamentals of public key cryptography, including key distribution, digital signatures, and the RSA algorithm. It explains the principles of asymmetric cryptography, detailing how public and private keys are used for secure communication and authentication. Additionally, it discusses applications of public-key cryptosystems and provides examples of RSA encryption and decryption processes.

Uploaded by

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

publickeysystem

The document covers the fundamentals of public key cryptography, including key distribution, digital signatures, and the RSA algorithm. It explains the principles of asymmetric cryptography, detailing how public and private keys are used for secure communication and authentication. Additionally, it discusses applications of public-key cryptosystems and provides examples of RSA encryption and decryption processes.

Uploaded by

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

MODULE –2: Elementary

Cryptography
🠶Number theory fundamentals
🠶Principles of public key crypto
systems
🠶RSA algorithm
🠶Diffi e Hellman Key exchange
Need of public key cryptography
🠶 To address 2 key issues
🠶 1. Key distribution
🠶 How to have secure communications in general
without having to trust a KDC with your key
🠶 2. Digital signature
🠶 How to verify a message comes intact from the
claimed sender
Principles of public key crypto
systems
 public-key/two-key/asymmetric cryptography involves the
use of two keys:

a public-key, which may be known by anybody, and
can be
used to encrypt messages, and verify signatures

a related private-key,known only to the recipient,
used to decrypt messages, and sign (create)
signatures
 Infeasible to determine private key from public
 Asymmetric because

those who encrypt messages or verify signatures cannot
decrypt messages or create signatures
Public key crypto
systems
🠶 A public-key encryption scheme has 6
ingredients
🠶 Plaintext: This is the readable message or data
that is fed
into the algorithm as 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.
Public key crypto systems

🠶 Exact transformations performed by the


algorithm depend on public or private key
that is provided as input.
🠶 Ciphertext: This is the encrypted message
produced as output. It depends on the plaintext
and the key.
🠶 For a given message, two different keys will
produce two different ciphertexts.
🠶 Decryption algorithm: This algorithm accepts
ciphertext and matching key and produces
original plaintext.
Symmetr VS Public
ic key
Public key Cryptography
Public key crypto systems
🠶 The essential steps are the following.
🠶 1. Each user generates a pair of keys for
encryption and decryption of messages.
🠶 2. Each user places one of the 2 keys in a
public register or other accessible file. This is
public key. The companion key is kept private.
🠶 3. If Bob wishes to send a confidential message
to Alice, Bob encrypts the message using Alice’s
public key.
Public key crypto
systems
🠶 When Alice receives the message, she decrypts
it using her private key. No other recipient
can decrypt the message because only Alice
knows Alice’s private key.
🠶 With this approach, all participants have
access to public keys, and private keys are
generated locally by each participant and
therefore need never be distributed.
🠶 As long as a user’s private key remains
protected and secret, incoming communication
is secure. At any time, a system can change
its private key and publish the companion
public key to replace its old public key.
Public key cryptosystem :
Confidentiality
Public key cryptosystem :
Confidentiality
🠶 There is some source A that produces a message in plaintext, X = [X , 1
X2, …, XM].
🠶 The M elements of X are letters in some finite alphabet.
🠶 The message is intended for destination B.
🠶 B generates a related pair of keys: a public key, PUb, and a private
key, PRb .
🠶 PRb is known only to B, whereas PUb
is publicly available and therefore accessible by
A.
🠶 With message X and the encryption key PUb as input,
🠶 A forms the ciphertext Y = [Y1, Y2, …, YN]:
🠶 Y = E(PRb , X)
🠶 The intended receiver, in possession of the matching private key,
is able to invert the transformation:
🠶 X = D(PRb ,Y)
Public key cryptosystem :
Authentication
Public key cryptosystem :
Authentication
🠶 Here, A prepares a message to B and encrypts
it using A’s private key before transmitting it.
🠶 B can decrypt the message using A’s public key.
🠶 As the message was encrypted using A’s
private key, only A could have prepared the
message.
🠶 Entire encrypted message serves as a digital
signature.
🠶 In addition, it is impossible to alter the message
without access to A’s private key, so the
message is authenticated both in terms of
source and in terms of data integrity.
Public key cryptosystem :
Authentication and Secrecy
Public key cryptosystem :
Authentication and Secrecy
🠶 It is possible to provide both the authentication
function and confidentiality by a double use of the
public-key scheme (Figure below):
🠶 Z = E(PUb , E(PRa,X)) and X = D(PUa, D(PRb,Z))
🠶 Here we begin by encrypting a message, using the
sender’s private
key and this provides digital signature.
🠶 Next, we encrypt again, using the receiver’s public key.
🠶 The final ciphertext can be decrypted only by intended
receiver,
who alone has the matching private key.
🠶 Thus, confidentiality is provided.
Applications for Public-Key
Cryptosystems
🠶Public-key systems are
characterized by cryptographic
algorithms with 2 keys, one is private
and one is public.
🠶Depending on the application, the
sender uses either the sender’s private
key or receiver’s public key, or both,
to perform some type of cryptographic
function.
Applications for Public-Key
Cryptosystems
🠶 We can use 3 kinds of public-key cryptosystems.
🠶 Encryption/decryption: The sender encrypts a message
with the recipient’s public key, and recipient
decrypts message with recipient’s private key.
🠶 Digital signature: Sender “signs” a message with its
private key. Signing is done by a cryptographic algorithm
applied to message or to a small block of data that is a
function of the message.
🠶 Key exchange: 2 sides cooperate to exchange a session
key, which is a secret key for symmetric encryption
generated for use for a transaction (or session) and valid
for a short period of time.
🠶 Some algorithms are suitable for all three applications,
whereas others can be used only for one or two of these
applications.
Applications for Public-Key
Cryptosystems
RSA
algorithm
🠶 RSA (Rivest Shamir Adleman) is an
algorithm used to encrypt and decrypt
messages.
🠶 This algorithm was developed in 1977.
🠶 It is an asymmetric cryptographic algorithm .
🠶 This is also called public key cryptography
because one of the keys can be given to
anyone.
RSA
algorithm
RSA
algorithm
Example

🠶 User A wants to send a number 4 to User B


🠶 Select two prime numbers p = 3, q = 11
🠶 n = p * q = 3 * 11 = 33
🠶 ø(n) = 2 * 10 = 20
🠶 Public key generation
🠶 Select a number e such that e is 1 < ø(n) and
gcd(e, ø(n)) = 1
🠶 Let e = 13, such that gcd(13,20) = 1
🠶 The public key is {e,n} = {13,33}
Exampl
e
🠶 Private key generation
🠶 Find a number d such 1 = 7 -1 * 6
that e * d mod ø(n) = = 7 – 1(13 -1*7)
1 = 2 * 7 -1 * 13
🠶 d is modular = 2 (20 -1*13) -1
multiplicative inverse *13
🠶 13d mod 20 = 1 = 2 * 20 -3 *13
🠶 20 = 1* 13 + 7 = -3 + 20 = 17
🠶 13 = 1 *7 + 6 Private key =
{17,33}
🠶7=1*6+1
🠶
Example

🠶 User A know the public key


{13,33}
🠶
🠶 Important
Cipher textp=< n mod
ie 4 < 33
413 33
🠶 (43)4 * 4 mod
33
🠶 (31)4 * 4 mod
33
🠶
🠶 User
(-2)4 *A 4sends
mod cipher text 31 to
User
33 B
🠶 64 mod 33 =
31
Example
🠶 User B decrypt the message using private key
{ 17,33}
🠶 Plaintext = 31 17 mod 33
🠶 ((-2) 5)3 * 22 mod 33
🠶 -((2) 5)3 * 22 mod 33
🠶 -(-1)3 * 22 mod 33
🠶4
Exercise
s
🠶 Perform the encryption and decryption
using RSA algorithm for the following data
🠶 1. p = 3 q = 11 e = 7 m = 5
🠶 2. p = 5 q = 11 e = 3m = 9
🠶 3. p = 7 q = 11 e = 17 m = 8
🠶 4. p = 11 q = 13 e = 11 m = 7
🠶 5. p = 17 q = 31 e = 7 m = 2
Euler's theorem
• Euler's theorem, we need to introduce an important
quantity in number theory, referred to as Euler's
Totient function and written
• Euler's Totient function - φ(n),
• φ(n) is defined as the number of positive integers less
than n and relatively prime to n.
• By convention, φ(1) = 1.
• Ex: Determine φ(37) and φ(35)

01/28/2025 27
Determine φ(37) and φ(35)
Because 37 is prime, all of the positive integers
from 1 through 36 are relatively prime to 37.
Thus φ(37) = 36.
To determine φ(35),
List all of the positive integers less than 35 that
are relatively prime to it:
1, 2, 3, 4, 6, 8, 9, 11, 12, 13, 16, 17, 18, 19, 22, 23,
24, 26, 27, 29, 31, 32, 33, 34.
There are 24 numbers on the list, so φ(35) =
24.

01/28/2025 28
Euler’s Totient Function

(1) If n is a prime number ,


φ(n) = n-1
(2) If n = p x q , where p and q are prime
numbers
φ(n) = (p-1) x (q -1)
(3) n = a x b , where a or b is composite or both
a and b is composite
φ(n) = n ( 1- ) ( 1- ) .. … ( 1- )
Where p are distinct prime numbers
01/28/2025 29
Ex 2 φ(n) = (p-1) x (q -1)
When n = 21 ,what is φ(n)

To see that φ(n) = (p-1) (q-1)

= φ(3) x φ(7)

= (3- 1) x (7- 1) = 2 x 6 = 12

where the 12 integers are


{1,2,4,5,8,10,11,13,16,17,19,20}

01/28/2025 30
Ctd.. EX 2
When n = 35 ,Find φ(35)
To see that φ(n) = (p-1) (q-1)

35 = 5 x 7 : 5,7 both are prime numbers


= (5- 1) x (7- 1) = 4 x 6 = 24

where the 24 integers are relatively prime to 35


{1,2,3,4,6,8,9,11,12,13,16,17,18,19,22,23,24,26,2
7,29,31,32,33,34}

01/28/2025 31
EX 3 : φ(n) = n ( 1- ) ( 1- ) .. … ( 1- )

Find : φ(1000)
Here n = 1000
So n = 23 x 53 which is ( 8 x 125) = 1000
Both
2 and 5 are prime no's so
: φ(n) = n ( 1- ) ( 1- )
: φ(1000) = 1000 ( 1- ) ( 1- ) = 1000 ( ) ( )
φ(1000) = 400

01/28/2025 32
CtdFind : φ(7000)
Here n = 7000
So n = 23 x 53 x 71 which is ( 8 x 125 x 7) = 7000
Both
2 and 5 are prime no's so
: φ(n) = n ( 1- ) ( 1- ) ( 1- )
: φ(1000) = 1000 ( 1- ) ( 1- ) ( 1- ) = 1000 ( ) ( ) ( )

φ(1000) = 2400

01/28/2025 33
From a negative integer, it is not possible to
calculate the Euler’s Totient Function.

The principle, in this case, is that for ϕ(n), the


multiplicators called m and n should be greater
than 1.

Hence denoted by 1<m<n and gcd (m, n) = 1. Sign


ϕ is the sign used

01/28/2025 34

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy