SlideShare une entreprise Scribd logo
1  sur  73
“Public Key Cryptography
and RSA”
Presented By,
Er. Swapnil V. Kaware
svkaware@yahoo.co.in
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Private-Key Cryptography
• Traditional private/secret/single key cryptography
uses one key
• Key is shared by both sender and receiver
• if the key is disclosed communications are
compromised
• also known as symmetric, both parties are equal
– hence does not protect sender from receiver forging a
message & claiming is sent by sender .

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Public-Key Cryptography
• Probably most significant advance in the 3000 year
history of cryptography
• uses two keys – a public key and a private key
• asymmetric since parties are not equal
• uses clever application of number theory concepts to
function
• complements rather than replaces private key
cryptography

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Public-Key Cryptography
• 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 private-key, known only to the recipient, used to decrypt
messages, and sign (create) signatures

• is asymmetric because
– those who encrypt messages or verify signatures cannot
decrypt messages or create signatures

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Public-Key Cryptography

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Why Public-Key Cryptography?
• developed to address two key issues:
– key distribution – how to have secure
communications in general without having to trust
a KDC with your key
– digital signatures – how to verify a message
comes intact from the claimed sender

• public invention due to Whitfield Diffie &
Martin Hellman at Stanford U. in 1976
– known earlier in classified community
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Public-Key Characteristics
• Public-Key algorithms rely on two keys with
the characteristics that it is:
– computationally infeasible to find decryption key
knowing only algorithm & encryption key
– computationally easy to en/decrypt messages
when the relevant (en/decrypt) key is known
– either of the two related keys can be used for
encryption, with the other used for decryption (in
some schemes)

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Public-Key Cryptosystems

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Public-Key Applications
• can classify uses into 3 categories:
– encryption/decryption (provide secrecy)
– digital signatures (provide authentication)
– key exchange (of session keys)

• some algorithms are suitable for all uses,
others are specific to one

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Security of Public Key Schemes
• like private key schemes brute force exhaustive
search attack is always theoretically possible
• but keys used are too large (>512bits)
• security relies on a large enough difference in
difficulty between easy (en/decrypt) and hard
(cryptanalyse) problems
• more generally the hard problem is known, its just
made too hard to do in practise
• requires the use of very large numbers
• hence is slow compared to private key schemes
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Diffie-Hellman
The Diffie–Hellman (DH) key exchange technique was first defined
in their seminal paper in 1976.
DH key exchange is a method of exchanging public (i.e. non-secret)
information to obtain a shared secret.
DH is not an encryption algorithm.

DH key exchange has the following important properties:
1. The resulting shared secret cannot be computed by either of the
parties without the cooperation of the other.
2. A third party observing all the messages transmitted during DH
key exchange cannot deduce the resulting shared secret at the
end of the protocol.
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Principle behind DH
DH key exchange was first proposed before there were any known
public key algorithms, but the idea behind it motivated the hunt for
practical public key algorithms.

DH key exchange is not only a useful and practical key
establishment technique, but also a significant milestone in the
history of modern cryptography.
DH key exchange assumes first that there exists:
1. A public key cipher system that has a special property (we come to
this shortly).
2. A carefully chosen, publicly known function F that takes two
numbers x and y as input, and outputs a third number F(x,y) (for
example, multiplication is such a function).
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Principle behind DH
Assume that Alice and Bob are the parties who wish to establish a
shared secret, and let their public and private keys in the public key
cipher system be denoted by (PA , SA) and (PB , SB) respectively.

The basic principle behind Diffie–Hellman key exchange is as follows:
1. Alice and Bob exchange their public keys PA and PB.
2. Alice computes F(SA , PB)

3. Bob computes F(SB, PA)
4. The special property of the public key cipher system, and the choice
of the function F, are such that F(SA , PB) = F(SB, PA). If this is the
case then Alice and Bob now share a secret.

5. This shared secret can easily be converted by some public means
into a bitstring suitable for use as, for example, a DES key.
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Diffie-Hellman key exchange
The most commonly described implementation of DH key exchange uses
the keys of the ElGamal cipher system and a very simple function F.

The system parameters (which are public) are:
• a large prime number p – typically 1024 bits in length
• a primitive element g
a
1. Alice generates a private random value a, calculates g (mod p)
and sends it to Bob. Meanwhile Bob generates a private random
b
value b, calculates g (mod p) and sends it to Alice.
b

2. Alice takes g and her private random value a to compute
b a
ab
(g ) = g (mod p).
a

3. Bob takes g and his private random value b to compute
a b
ab
(g ) = g (mod p).
ab

4. Alice and Bob adopt g

(mod p) as the shared secret.

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Diffie-Hellman
• Based on a special case of the
subset-sum, or knapsack, problem

20

11
8
5

6
4

Subset-sum Problem

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Diffie-Hellman Example
• Block cipher
• Block size of 7 bits. Possible 27 combinations
• Private key (a’1, a’2, … , a’n) of 7 integers: (1, 2, 5, 11, 32, 87, 141)
• Chose two special integers, w and m, such that w and m are relatively prime,
meaning gcd(w,m) = 1: w = 901, m = 1234
• Public key (a1, a2, … , an) of 7 integers using the equation: ai = w * a’i mod m:
(901, 568, 803, 39, 450, 645, 1173)
• Partition SECRET into 7 bit blocks each block consisting of xn bits (x1, x2, …, xn)
S
1010011

E
1000101

C
1000011

R
1010010

E
1000101

T
1010100

n

• Bx = ∑ xiai
i=1

• S = 1 X (901) + 0 X (568) + 1 X (803) + 0 X (39) + 0 X (450) + 1 X (645) + 1 X (1173)
• S = 3522

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Diffie-Hellman Example
• Encrypted blocks Bx received. Special version of subset-sum problem
• Which subset of (a’1, a’2, … , a’n) sums to B’x where B’x = Bx * w-1 mod m
• w-1 is the modular inverse of w for m, w * w-1 mod m = 1
• B’x = 3522 X (901)-1 mod 1234
• B’x = 3522 X 1171 mod 1234
• B’x = 234
1. sum ← 0
2. for i = n step -1 until 1 do
if ai + sum <= B’x
then sum ← sum + ai;
subset(i) ← 1
else subset(i) ← 0
3. if sum = B’x then exit with subset
else exit with “failure”
• Private key (1, 2, 5, 11, 32, 87, 141), B’x = 234, find subset (1, 0, 1, 0, 0, 1, 1) = S
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Diffie-Hellman
• Two possible points of vulnerability
• An algorithm which solves NP-complete
problems quickly
• An algorithm that solves the particular
problem on which a cryptographic system
is based.

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
RSA
• by Rivest, Shamir & Adleman of MIT in 1977
• best known & widely used public-key scheme
• based on exponentiation in a finite (Galois) field over
integers modulo a prime
– nb. exponentiation takes O((log n)3) operations (easy)

• uses large integers (eg. 1024 bits)
• security due to cost of factoring large numbers
– nb. factorization takes O(e log n log log n) operations (hard)

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
The RSA Algorithm
• Pick two large (100 digit) primes p and q.
• Let n = pq
• Select a relatively small integer d that is prime to
(p-1)(q-1)
• Find e, the multiplicative inverse of d mod (p-1)(q-1)
• (d,n) is the public key. To encrypt M, compute
– En(M) = Me(mod n)

• (e,n) is the private key. To decrypt C, compute
– De(C) = Cd(mod n)
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
RSA example
•
•
•
•
•
•
•
•
•

Let p = 11, q = 13
n = pq = 143
(p-1)(q-1) = 120 = 3 x 23 x 5
Possible d: 7, 11, 13, 17, … (let’s use 7)
Find e: e*7 = 1(mod 120) = 103
Public key: (7, 143)
Private key: (103, 143)
En(42) = 427 (mod 143) = 81
De(81) = 81103(mod 143) = 42
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Correctness of RSA
• To show RSA is correct, we must show that
encryption and decryption are inverse
functions:
– En(De(M)) = De(En(M)) = M = Med (mod n)
– Since d and e are multiplicative inverses, there
is a k such that:
•
•
•
•

ed=1+ kn = 1 + k(p-1)(q-1)
Med = M1+k(p-1)(q-1) = M*(Mp-1)k(q-1)
By Fermat: Mp-1=1(mod p)
Med = M(1)k(q-1)(mod p) = M(mod p)
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Correctness of RSA
•
•
•
•

Med = M(1)k(q-1)(mod p) = M(mod p)
Med = M(1)k(q-1)(mod q) = M(mod q)
By Chinese Remainder Thm, we get:
M^{ed} = M (mod p) M (mod q) =
M (mod pq) = M (mod n)

• Therefore, RSA reproduces the original
message and is correct.
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Strengths of RSA
•
•
•
•

No prior communication needed
Highly secure (for large enough keys)
Well-understood
Allows both encryption and signing

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Weaknesses of RSA
• Large keys needed (1024 bits is current
standard)
• Relatively slow
– Not suitable for very large messages

• Public keys must still be distributed safely.

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
RSA Key Setup
• each user generates a public/private key pair by:
• selecting two large primes at random - p, q
• computing their system modulus N=p.q
– note ø(N)=(p-1)(q-1)

• selecting at random the encryption key e
• where 1<e<ø(N), gcd(e,ø(N))=1

• solve following equation to find decryption key d
– e.d=1 mod ø(N) and 0≤d≤N

• publish their public encryption key: KU={e,N}
• keep secret private decryption key: KR={d,p,q}
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
RSA Use
• to encrypt a message M the sender:
– obtains public key of recipient KU={e,N}
– computes: C=Me mod N, where 0≤M<N

• to decrypt the ciphertext C the owner:
– uses their private key KR={d,p,q}
– computes: M=Cd mod N

• note that the message M must be smaller
than the modulus N (block if needed)
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Why RSA Works
• because of Euler's Theorem:
• aø(n)mod N = 1
– where gcd(a,N)=1

• in RSA have:
–
–
–
–

N=p.q
ø(N)=(p-1)(q-1)
carefully chosen e & d to be inverses mod ø(N)
hence e.d=1+k.ø(N) for some k

• hence :
Cd = (Me)d = M1+k.ø(N) = M1.(Mø(N))q = M1.(1)q =
M1 = M mod N

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
RSA Example
Select primes: p=17 & q=11
Compute n = pq =17 11=187
Compute ø(n)=(p–1)(q-1)=16 10=160
Select e : gcd(e,160)=1; choose e=7
Determine d: de=1 mod 160 and d < 160
Value is d=23 since 23 7=161= 10 160+1
6. Publish public key KU={7,187}
7. Keep secret private key KR={23,17,11}
1.
2.
3.
4.
5.

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
RSA Example cont
• sample RSA encryption/decryption is:
• given message M = 88 (nb. 88<187)
• encryption:
C = 887 mod 187 = 11

• decryption:
M = 1123 mod 187 = 88

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Exponentiation
•
•
•
•

can use the Square and Multiply Algorithm
a fast, efficient algorithm for exponentiation
concept is based on repeatedly squaring base
and multiplying in the ones that are needed to
compute the result
• look at binary representation of exponent
• only takes O(log2 n) multiples for number n
– eg. 75 = 74.71 = 3.7 = 10 mod 11
– eg. 3129 = 3128.31 = 5.3 = 4 mod 11

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Exponentiation

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
RSA Key Generation
• users of RSA must:
– determine two primes at random - p, q
– select either e or d and compute the other

• primes p,q must not be easily derived from
modulus N=p.q
– means must be sufficiently large
– typically guess and use probabilistic test

• exponents e, d are inverses, so use Inverse
algorithm to compute the other

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
RSA Security
• three approaches to attacking RSA:
– brute force key search (infeasible given size of
numbers)
– mathematical attacks (based on difficulty of
computing ø(N), by factoring modulus N)
– timing attacks (on running of decryption)

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Factoring Problem
• mathematical approach takes 3 forms:
– factor N=p.q, hence find ø(N) and then d
– determine ø(N) directly and find d
– find d directly

• currently believe all equivalent to factoring
– have seen slow improvements over the years
• as of Aug-99 best is 130 decimal digits (512) bit with GNFS

– biggest improvement comes from improved algorithm
• cf “Quadratic Sieve” to “Generalized Number Field Sieve”

– barring dramatic breakthrough 1024+ bit RSA secure
• ensure p, q of similar size and matching other constraints
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Timing Attacks
• developed in mid-1990’s
• exploit timing variations in operations
– eg. multiplying by small vs large number
– or IF's varying which instructions executed

• infer operand size based on time taken
• RSA exploits time taken in exponentiation
• countermeasures
– use constant exponentiation time
– add random delays
– blind values used in calculations
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
What Is Message Authentication
• It’s the “source,” of course!
• Procedure that allows communicating parties to
verify that received messages are authentic(可
信的)
• Characteristics:
–

source is authentic – masquerading

–

contents unaltered – message modification

–

timely sequencing – replay
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Approaches to Message
Authentication
• Authentication Using Conventional Encryption

– Assume only sender and receiver share a key
– Then a correctly encrypted message should be
from the sender

• Usually also contains error-detection
code, sequence number and time stamp

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Message Authentication
•

Without Encryption

•

No confidentiality is preferred when:

1.

Same message is broadcast to many destinations

2.

Heavy load and cannot decrypt all messages – some
chosen at random

3.

No danger in sending plaintext

Append authentication tag to each message

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Approaches to Message
Authentication
• Message Authentication without Message
Encryption
– An authentication tag is generated and appended to
each message-Message Authentication Code (MAC)
–
–
–
–

MAC is generated by using a secret key
Assumes both parties A,B share common secret key KAB
Code is function of message and key MACM= F(KAB, M)
Message plus code are transmitted
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Using Symmetric Ciphers for MACs
• can use cipher block chaining mode and use
final block as a MAC
• Data Authentication Algorithm (DAA) is a
widely used MAC based on DES-CBC
– using IV=0 and zero-pad of final block
– encrypt message using DES in CBC mode

– and send just the final block as the MAC
• or the leftmost M bits (16≤M≤64) of final block
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
What Is Message Authentication
• It’s the “source,” of course!
• Procedure that allows communicating parties to
verify that received messages are authentic
• Characteristics:
–

source is authentic – masquerading

–

contents unaltered – message modification

–

timely sequencing – replay
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Approaches to Message
Authentication
• Authentication Using Conventional Encryption

– Assume only sender and receiver share a key
– Then a correctly encrypted message should be
from the sender

• Usually also contains error-detection
code, sequence number and time stamp

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Message Authentication
•

Without Encryption

•

No confidentiality is preferred when:

1.

Same message is broadcast to many destinations

2.

Heavy load and cannot decrypt all messages – some
chosen at random

3.

No danger in sending plaintext

Append authentication tag to each message

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Approaches to Message
Authentication
• Message Authentication without Message
Encryption
– An authentication tag is generated and appended to
each message-Message Authentication Code (MAC)
–
–
–
–

MAC is generated by using a secret key
Assumes both parties A,B share common secret key KAB
Code is function of message and key MACM= F(KAB, M)
Message plus code are transmitted
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Using Symmetric Ciphers for MACs
• can use cipher block chaining mode and use
final block as a MAC
• Data Authentication Algorithm (DAA) is a
widely used MAC based on DES-CBC
– using IV=0 and zero-pad of final block
– encrypt message using DES in CBC mode

– and send just the final block as the MAC
• or the leftmost M bits (16≤M≤64) of final block
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Data Authentication Algorithm (DAA)

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
One-way HASH function
• Alternative to Message Authentication Code
• Accepts a variable size message M as input and
produces a fixed-size message digest H (M) as
output

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
One-way HASH function

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
One Way Hash Function
Ideally We Would Like To Avoid Encryption
• Encryption software is slow

• Encryption hardware costs aren’t cheap
• Hardware optimized toward large data sizes

• Algorithms covered by patents
• Algorithms subject to export control
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
One-way HASH function
• Secret value is added before the hash and
removed before transmission.

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Secure HASH Functions
•

Purpose of the HASH function is to produce a “fingerprint”.

•

Properties of a HASH function H :
1.

H can be applied to a block of data at any size

2.

H produces a fixed length output

3.

H(x) is easy to compute for any given x.

4.

For any given block h, it is computationally infeasible to find x such
that H(x) = h

5.

For any given block x, it is computationally infeasible to find
H(y) = H(x).

6.

It is computationally infeasible to find any pair (x, y) such that H(x) =
H(y)

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)

with
Simple Hash Function
• General principle
– Input is a sequence of n-bit blocks
– Input is processed one block at a time to produce
an n-bit hash function
– A simple example is the bit-by-bit XOR of each
block
Ci = bi1 ⊕bi2⊕ … ⊕bim
Ci is ith bit of hash code 1 <= i <= n
m is number of n-bit block in input
bij is ith bit in jth block
⊕ is the XOR CNS Notes by, Er. Swapnil V. Kaware
operation
(svkaware@yahoo.co.in)
Simple Hash Function

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
SHA-1 Secure Hash Function
• The Secure Hash Algorithm( SHA) was developed by the
National Institute of Standards and Technology and
published in 1993. SHA-1 is 1995 revised version.
• It takes as input a message with maximum length < 264

bits and produces a 160-bit message digest.
• It is processed in 512-bit blocks.

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
SHA-1 Secure Hash Function
K

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
SHA-1 Processing of single 512-Bit Block

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
SHA-1 -Creation of 80-word

Wt=(Wt-16 Wt-14 Wt-8 Wt-3) <<1
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Other Secure HASH functions
SHA-1

MD5

RIPEMD-160

Digest length

160 bits

128 bits

160 bits

Basic unit of
processing

512 bits

512 bits

512 bits

Number of steps

80 (4 rounds of
20)

64 (4 rounds
of 16)

160 (5 paired
rounds of 16)

Maximum message
size

264-1 bits

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Public-Key Cryptography Principles
• The use of two keys has consequences in: key
distribution, confidentiality and authentication.
• The scheme has six ingredients (see Figure 3.7)
– Plaintext

– Encryption algorithm
– Public and private key
– Ciphertext

– Decryption algorithm
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Encryption using Public-Key system

Encryption
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Authentication using Public-Key
System

Authentication
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Applications for Public-Key
Cryptosystems
• Three categories:
– Encryption/decryption: The sender encrypts a
message with the recipient’s public key.
– Digital signature: The sender ”signs” a message
with its private key.
– Key echange: Two sides cooperate two exhange a
session key.
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Public-Key Cryptographic Algorithms
• RSA - Ron Rives, Adi Shamir and Len Adleman
at MIT, in 1977.
– RSA is a block cipher
– The most widely implemented
– based on exponentiationin a finite field over
integers modulo a prime
– uses large integers (eg. 1024 bits)
– security due to cost of factoring large numbers
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Prime and Composite Numbers
• An integer p is prime if its divisors are 1 and p
only.
• Otherwise, it is a composite number.
• E.g. 2,3,5,7 are prime; 4,6,8,9,10 are not
• List of prime number less than 200:
2 3 5 7 11 13 17 19 23 29 31 37
41 43 47 53 59 61 67 71 73 79 83 89
97 101 103 107 109 113 127 131 137
139 149 151 157 163 167 173 179 181
191 193 197 199
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Prime Factorization ()
• To factor a number n is to write it as a product of other numbers:
n=a×b×c
• The prime factorization of a number n is when it is written as a product of
primes
• E.g. 91=7×13; 3600=24×32×52
• It is generally hard to do (prime) factorization when the number is large
• E.g. factorize
93874093217498173983210748123487143249761

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Relatively Prime Numbers & GCD
• two numbers a, b are relatively primeif have no common divisorsapart
from 1
– eg.
8 & 15 are relatively prime since factors of 8 are 1,2,4,8 and of 15 are
1,3,5,15 and 1 is the only common factor
• conversely can determine the GCD(greatest common divisor) by comparing
their prime factorizations and using least powers
– eg.
300=21×31×52
18=21×32
GCD(18,300)=21×31×50=6

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)

hence
The Euler phi Function
For n 1, let (n) denote the number of integers in the interval [1, n]
which are relatively prime to n. The function is called the Euler phi
function (or the Euler totient function).
Fact 1. The Euler phi function is multiplicative. I.e. if gcd(m, n) = 1,
then (mn) = (m) x (n).

E.g.
91=7×13
(7) =6
(13)=12
(91) = (7) × (13) =6×12=72
CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Summary
• Public key encryption provides a flexible system for secure
communication in open environments.
• Based on one-way functions.
• Allows for both authentication and signing.

• Secure public key distribution remains a problem. RSA is a public
key encryption algorithm whose security is believed to be based on
the problem of factoring large numbers.
• ElGamal is a public key encryption algorithm whose security is
believed to be based on the discrete logarithm problem.

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
Summary
• Public key systems replace the problem of distributing symmetric keys
with one of authenticating public keys.

• Public key encryption algorithms need to be trapdoor one-way
functions.
• RSA is less efficient and fast to operate than most symmetric
encryption algorithms because they involve modular exponentiation.
• DH key exchange is an important protocol on which many real key
exchange protocols are based.

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)
References
• A.K. Dewdney, The New Turning Omnibus, pp. 250-257, Henry Holt and Company, 2001.

• RSA Cryptosystem, http://primes.utm.edu/glossary/page.php?sort=RSA.
• Cryptology FAQ, http://www.faqs.org/faqs/cryptography-faq/part06/.

• A. Shamir, “A Polynomial-Time Algorithm for Breaking the Basic Merkle-Hellman
Cryptosystem", Advances in Cryptology - CRYPTO '82 Proceedings, pp. 279-288, Plenum Press,
1983. IEEE Transactions on Information Theory, Vol. IT-30, pp. 699-704, 1984.
• The Extended Euclidian
Algorithm, http://www.grc.nasa.gov/WWW/price000/pfc/htc/zz_xeuclidalg.html.

CNS Notes by, Er. Swapnil V. Kaware
(svkaware@yahoo.co.in)

Contenu connexe

Tendances

The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
Komal Singh
 
Rsa diffi-network security-itt
Rsa diffi-network security-ittRsa diffi-network security-itt
Rsa diffi-network security-itt
rameshvvv
 

Tendances (20)

Ch9
Ch9Ch9
Ch9
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key Cryptography
 
Rsa
RsaRsa
Rsa
 
Cryptography using rsa cryptosystem
Cryptography using rsa cryptosystemCryptography using rsa cryptosystem
Cryptography using rsa cryptosystem
 
Rsa and diffie hellman algorithms
Rsa and diffie hellman algorithmsRsa and diffie hellman algorithms
Rsa and diffie hellman algorithms
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSA
 
Cryptography and RSA algorithm
Cryptography and RSA algorithmCryptography and RSA algorithm
Cryptography and RSA algorithm
 
Public key cryptography and RSA
Public key cryptography and RSAPublic key cryptography and RSA
Public key cryptography and RSA
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptography
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Rsa cryptosystem
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystem
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
rsa-1
rsa-1rsa-1
rsa-1
 
Principles of public key cryptography and its Uses
Principles of  public key cryptography and its UsesPrinciples of  public key cryptography and its Uses
Principles of public key cryptography and its Uses
 
Rsa algorithm key generation
Rsa algorithm key generation Rsa algorithm key generation
Rsa algorithm key generation
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
 
Rsa diffi-network security-itt
Rsa diffi-network security-ittRsa diffi-network security-itt
Rsa diffi-network security-itt
 
Public Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithm
 
A Study of RSA Algorithm in Cryptography
A Study of RSA Algorithm in CryptographyA Study of RSA Algorithm in Cryptography
A Study of RSA Algorithm in Cryptography
 
Diffie-Hellman Key Exchange
Diffie-Hellman Key ExchangeDiffie-Hellman Key Exchange
Diffie-Hellman Key Exchange
 

En vedette

Public key Cryptography & RSA
Public key Cryptography & RSAPublic key Cryptography & RSA
Public key Cryptography & RSA
Amit Debnath
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptography
anusachu .
 
Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3
koolkampus
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
James Wong
 
C:\Documents And Settings\Fredlin\Desktop\Ic Design\Synthesis200301
C:\Documents And Settings\Fredlin\Desktop\Ic Design\Synthesis200301C:\Documents And Settings\Fredlin\Desktop\Ic Design\Synthesis200301
C:\Documents And Settings\Fredlin\Desktop\Ic Design\Synthesis200301
guest77988fe
 
Chapter Eight(3)
Chapter Eight(3)Chapter Eight(3)
Chapter Eight(3)
bolovv
 

En vedette (20)

Public key Cryptography & RSA
Public key Cryptography & RSAPublic key Cryptography & RSA
Public key Cryptography & RSA
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITY
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptography
 
Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3
 
Cryptography
CryptographyCryptography
Cryptography
 
Sha1
Sha1Sha1
Sha1
 
Lecture 3b public key_encryption
Lecture 3b public key_encryptionLecture 3b public key_encryption
Lecture 3b public key_encryption
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
C:\Documents And Settings\Fredlin\Desktop\Ic Design\Synthesis200301
C:\Documents And Settings\Fredlin\Desktop\Ic Design\Synthesis200301C:\Documents And Settings\Fredlin\Desktop\Ic Design\Synthesis200301
C:\Documents And Settings\Fredlin\Desktop\Ic Design\Synthesis200301
 
X Windows
X WindowsX Windows
X Windows
 
Advance data structure & algorithm
Advance data structure & algorithmAdvance data structure & algorithm
Advance data structure & algorithm
 
Computer Networks Foundation - Study Notes
Computer Networks Foundation - Study NotesComputer Networks Foundation - Study Notes
Computer Networks Foundation - Study Notes
 
IDRBT Project: Application Development in Java for public key cryptography
IDRBT Project: Application Development in Java for public key cryptographyIDRBT Project: Application Development in Java for public key cryptography
IDRBT Project: Application Development in Java for public key cryptography
 
Kerberos using public key cryptography
Kerberos using public key cryptographyKerberos using public key cryptography
Kerberos using public key cryptography
 
Compiler construction
Compiler constructionCompiler construction
Compiler construction
 
Cryptography - key sharing - RSA
Cryptography - key sharing - RSACryptography - key sharing - RSA
Cryptography - key sharing - RSA
 
MMS2401 - Multimedia system and Communication Notes
MMS2401 - Multimedia system and Communication NotesMMS2401 - Multimedia system and Communication Notes
MMS2401 - Multimedia system and Communication Notes
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptography
 
Cryptography for software engineers
Cryptography for software engineersCryptography for software engineers
Cryptography for software engineers
 
Chapter Eight(3)
Chapter Eight(3)Chapter Eight(3)
Chapter Eight(3)
 

Similaire à Cryptography & Network Security By, Er. Swapnil Kaware

CH02-CompSec4e.pptx
CH02-CompSec4e.pptxCH02-CompSec4e.pptx
CH02-CompSec4e.pptx
ams1ams11
 
IS Unit 3_Public Key Cryptography
IS Unit 3_Public Key CryptographyIS Unit 3_Public Key Cryptography
IS Unit 3_Public Key Cryptography
Sarthak Patel
 
Cybersecurity Research Paper
Cybersecurity Research PaperCybersecurity Research Paper
Cybersecurity Research Paper
Shubham Gupta
 

Similaire à Cryptography & Network Security By, Er. Swapnil Kaware (20)

UNIT-IV.pptx
UNIT-IV.pptxUNIT-IV.pptx
UNIT-IV.pptx
 
Overview on Cryptography and Network Security
Overview on Cryptography and Network SecurityOverview on Cryptography and Network Security
Overview on Cryptography and Network Security
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic Encryption
 
Cryptography Key Management.pptx
Cryptography Key Management.pptxCryptography Key Management.pptx
Cryptography Key Management.pptx
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography-101
Cryptography-101Cryptography-101
Cryptography-101
 
Cryptography - 101
Cryptography - 101Cryptography - 101
Cryptography - 101
 
Class3
Class3Class3
Class3
 
CH02-CompSec4e.pptx
CH02-CompSec4e.pptxCH02-CompSec4e.pptx
CH02-CompSec4e.pptx
 
Kleptography
KleptographyKleptography
Kleptography
 
Secure 2 Party AES
Secure 2 Party AESSecure 2 Party AES
Secure 2 Party AES
 
Public_Key_Cryptography in crypto analysis.ppt
Public_Key_Cryptography in crypto analysis.pptPublic_Key_Cryptography in crypto analysis.ppt
Public_Key_Cryptography in crypto analysis.ppt
 
Ch03
Ch03Ch03
Ch03
 
OS ppt Modified.pptx
OS ppt Modified.pptxOS ppt Modified.pptx
OS ppt Modified.pptx
 
IS Unit 3_Public Key Cryptography
IS Unit 3_Public Key CryptographyIS Unit 3_Public Key Cryptography
IS Unit 3_Public Key Cryptography
 
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin   chp-8 - network security-new -use this -  2011 batchJaimin   chp-8 - network security-new -use this -  2011 batch
Jaimin chp-8 - network security-new -use this - 2011 batch
 
Cybersecurity Research Paper
Cybersecurity Research PaperCybersecurity Research Paper
Cybersecurity Research Paper
 
CNS - Unit - 4 - Public Key Cryptosystem
CNS - Unit - 4 - Public Key Cryptosystem CNS - Unit - 4 - Public Key Cryptosystem
CNS - Unit - 4 - Public Key Cryptosystem
 
Rsa
RsaRsa
Rsa
 
Cryptography
CryptographyCryptography
Cryptography
 

Plus de Prof. Swapnil V. Kaware

Digital signal processing By Er. Swapnil Kaware
Digital signal processing By Er. Swapnil KawareDigital signal processing By Er. Swapnil Kaware
Digital signal processing By Er. Swapnil Kaware
Prof. Swapnil V. Kaware
 
Advanced optical communication By Er. Swapnl Kaware
Advanced optical communication By Er. Swapnl KawareAdvanced optical communication By Er. Swapnl Kaware
Advanced optical communication By Er. Swapnl Kaware
Prof. Swapnil V. Kaware
 

Plus de Prof. Swapnil V. Kaware (20)

Corona Virus Awareness by, Er. Swapnil V. Kaware
Corona Virus Awareness by, Er. Swapnil V. KawareCorona Virus Awareness by, Er. Swapnil V. Kaware
Corona Virus Awareness by, Er. Swapnil V. Kaware
 
Basic Electronics By, Er. Swapnil V. Kawrare
Basic Electronics By, Er. Swapnil V. KawrareBasic Electronics By, Er. Swapnil V. Kawrare
Basic Electronics By, Er. Swapnil V. Kawrare
 
Addressing modes of 8085 by Er. Swapnil V. Kaware
Addressing modes of 8085 by Er. Swapnil V. KawareAddressing modes of 8085 by Er. Swapnil V. Kaware
Addressing modes of 8085 by Er. Swapnil V. Kaware
 
Best GD tips by, Er. Swapnil V. Kaware
Best GD tips by, Er. Swapnil V. KawareBest GD tips by, Er. Swapnil V. Kaware
Best GD tips by, Er. Swapnil V. Kaware
 
Best Interview Tips By, Er. Swapnil V. Kaware
Best Interview Tips By, Er. Swapnil V. KawareBest Interview Tips By, Er. Swapnil V. Kaware
Best Interview Tips By, Er. Swapnil V. Kaware
 
Chandrayaan 2 By, Er. Swapnil V. Kaware
Chandrayaan 2 By, Er. Swapnil V. KawareChandrayaan 2 By, Er. Swapnil V. Kaware
Chandrayaan 2 By, Er. Swapnil V. Kaware
 
LED Lighting for Energy Efficiency By, Er. Swapnil V. Kaware
LED Lighting for Energy Efficiency By, Er. Swapnil V. KawareLED Lighting for Energy Efficiency By, Er. Swapnil V. Kaware
LED Lighting for Energy Efficiency By, Er. Swapnil V. Kaware
 
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. KawareMicroprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
 
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. KawareMicroprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
 
Combinational Logic Circuits
Combinational Logic CircuitsCombinational Logic Circuits
Combinational Logic Circuits
 
Microprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. KawareMicroprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. Kaware
 
LED basics by Er. Swapnil V. Kaware
LED basics by Er. Swapnil V. KawareLED basics by Er. Swapnil V. Kaware
LED basics by Er. Swapnil V. Kaware
 
Electronics Lab Manual by Er. Swapnil V. Kaware
Electronics Lab Manual by Er. Swapnil V. KawareElectronics Lab Manual by Er. Swapnil V. Kaware
Electronics Lab Manual by Er. Swapnil V. Kaware
 
Transistors & Oscillators by Er. Swapnil Kaware
Transistors & Oscillators by Er. Swapnil KawareTransistors & Oscillators by Er. Swapnil Kaware
Transistors & Oscillators by Er. Swapnil Kaware
 
Basic Electronics (Rectifiers) by Er. Swapnil Kaware
Basic Electronics (Rectifiers) by Er. Swapnil KawareBasic Electronics (Rectifiers) by Er. Swapnil Kaware
Basic Electronics (Rectifiers) by Er. Swapnil Kaware
 
Basic Electronics by Er. Swapnil Kaware
Basic Electronics by Er. Swapnil KawareBasic Electronics by Er. Swapnil Kaware
Basic Electronics by Er. Swapnil Kaware
 
Digital Electronics Basics by Er. Swapnil Kaware
Digital Electronics Basics by Er. Swapnil KawareDigital Electronics Basics by Er. Swapnil Kaware
Digital Electronics Basics by Er. Swapnil Kaware
 
Digital computer Basics by, Er. Swapnil Kaware
Digital computer Basics by, Er. Swapnil KawareDigital computer Basics by, Er. Swapnil Kaware
Digital computer Basics by, Er. Swapnil Kaware
 
Digital signal processing By Er. Swapnil Kaware
Digital signal processing By Er. Swapnil KawareDigital signal processing By Er. Swapnil Kaware
Digital signal processing By Er. Swapnil Kaware
 
Advanced optical communication By Er. Swapnl Kaware
Advanced optical communication By Er. Swapnl KawareAdvanced optical communication By Er. Swapnl Kaware
Advanced optical communication By Er. Swapnl Kaware
 

Dernier

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 

Dernier (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 

Cryptography & Network Security By, Er. Swapnil Kaware

  • 1. “Public Key Cryptography and RSA” Presented By, Er. Swapnil V. Kaware svkaware@yahoo.co.in CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 2. Private-Key Cryptography • Traditional private/secret/single key cryptography uses one key • Key is shared by both sender and receiver • if the key is disclosed communications are compromised • also known as symmetric, both parties are equal – hence does not protect sender from receiver forging a message & claiming is sent by sender . CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 3. Public-Key Cryptography • Probably most significant advance in the 3000 year history of cryptography • uses two keys – a public key and a private key • asymmetric since parties are not equal • uses clever application of number theory concepts to function • complements rather than replaces private key cryptography CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 4. Public-Key Cryptography • 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 private-key, known only to the recipient, used to decrypt messages, and sign (create) signatures • is asymmetric because – those who encrypt messages or verify signatures cannot decrypt messages or create signatures CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 5. Public-Key Cryptography CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 6. Why Public-Key Cryptography? • developed to address two key issues: – key distribution – how to have secure communications in general without having to trust a KDC with your key – digital signatures – how to verify a message comes intact from the claimed sender • public invention due to Whitfield Diffie & Martin Hellman at Stanford U. in 1976 – known earlier in classified community CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 7. Public-Key Characteristics • Public-Key algorithms rely on two keys with the characteristics that it is: – computationally infeasible to find decryption key knowing only algorithm & encryption key – computationally easy to en/decrypt messages when the relevant (en/decrypt) key is known – either of the two related keys can be used for encryption, with the other used for decryption (in some schemes) CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 8. Public-Key Cryptosystems CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 9. Public-Key Applications • can classify uses into 3 categories: – encryption/decryption (provide secrecy) – digital signatures (provide authentication) – key exchange (of session keys) • some algorithms are suitable for all uses, others are specific to one CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 10. Security of Public Key Schemes • like private key schemes brute force exhaustive search attack is always theoretically possible • but keys used are too large (>512bits) • security relies on a large enough difference in difficulty between easy (en/decrypt) and hard (cryptanalyse) problems • more generally the hard problem is known, its just made too hard to do in practise • requires the use of very large numbers • hence is slow compared to private key schemes CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 11. Diffie-Hellman The Diffie–Hellman (DH) key exchange technique was first defined in their seminal paper in 1976. DH key exchange is a method of exchanging public (i.e. non-secret) information to obtain a shared secret. DH is not an encryption algorithm. DH key exchange has the following important properties: 1. The resulting shared secret cannot be computed by either of the parties without the cooperation of the other. 2. A third party observing all the messages transmitted during DH key exchange cannot deduce the resulting shared secret at the end of the protocol. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 12. Principle behind DH DH key exchange was first proposed before there were any known public key algorithms, but the idea behind it motivated the hunt for practical public key algorithms. DH key exchange is not only a useful and practical key establishment technique, but also a significant milestone in the history of modern cryptography. DH key exchange assumes first that there exists: 1. A public key cipher system that has a special property (we come to this shortly). 2. A carefully chosen, publicly known function F that takes two numbers x and y as input, and outputs a third number F(x,y) (for example, multiplication is such a function). CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 13. Principle behind DH Assume that Alice and Bob are the parties who wish to establish a shared secret, and let their public and private keys in the public key cipher system be denoted by (PA , SA) and (PB , SB) respectively. The basic principle behind Diffie–Hellman key exchange is as follows: 1. Alice and Bob exchange their public keys PA and PB. 2. Alice computes F(SA , PB) 3. Bob computes F(SB, PA) 4. The special property of the public key cipher system, and the choice of the function F, are such that F(SA , PB) = F(SB, PA). If this is the case then Alice and Bob now share a secret. 5. This shared secret can easily be converted by some public means into a bitstring suitable for use as, for example, a DES key. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 14. Diffie-Hellman key exchange The most commonly described implementation of DH key exchange uses the keys of the ElGamal cipher system and a very simple function F. The system parameters (which are public) are: • a large prime number p – typically 1024 bits in length • a primitive element g a 1. Alice generates a private random value a, calculates g (mod p) and sends it to Bob. Meanwhile Bob generates a private random b value b, calculates g (mod p) and sends it to Alice. b 2. Alice takes g and her private random value a to compute b a ab (g ) = g (mod p). a 3. Bob takes g and his private random value b to compute a b ab (g ) = g (mod p). ab 4. Alice and Bob adopt g (mod p) as the shared secret. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 15. Diffie-Hellman • Based on a special case of the subset-sum, or knapsack, problem 20 11 8 5 6 4 Subset-sum Problem CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 16. Diffie-Hellman Example • Block cipher • Block size of 7 bits. Possible 27 combinations • Private key (a’1, a’2, … , a’n) of 7 integers: (1, 2, 5, 11, 32, 87, 141) • Chose two special integers, w and m, such that w and m are relatively prime, meaning gcd(w,m) = 1: w = 901, m = 1234 • Public key (a1, a2, … , an) of 7 integers using the equation: ai = w * a’i mod m: (901, 568, 803, 39, 450, 645, 1173) • Partition SECRET into 7 bit blocks each block consisting of xn bits (x1, x2, …, xn) S 1010011 E 1000101 C 1000011 R 1010010 E 1000101 T 1010100 n • Bx = ∑ xiai i=1 • S = 1 X (901) + 0 X (568) + 1 X (803) + 0 X (39) + 0 X (450) + 1 X (645) + 1 X (1173) • S = 3522 CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 17. Diffie-Hellman Example • Encrypted blocks Bx received. Special version of subset-sum problem • Which subset of (a’1, a’2, … , a’n) sums to B’x where B’x = Bx * w-1 mod m • w-1 is the modular inverse of w for m, w * w-1 mod m = 1 • B’x = 3522 X (901)-1 mod 1234 • B’x = 3522 X 1171 mod 1234 • B’x = 234 1. sum ← 0 2. for i = n step -1 until 1 do if ai + sum <= B’x then sum ← sum + ai; subset(i) ← 1 else subset(i) ← 0 3. if sum = B’x then exit with subset else exit with “failure” • Private key (1, 2, 5, 11, 32, 87, 141), B’x = 234, find subset (1, 0, 1, 0, 0, 1, 1) = S CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 18. Diffie-Hellman • Two possible points of vulnerability • An algorithm which solves NP-complete problems quickly • An algorithm that solves the particular problem on which a cryptographic system is based. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 19. RSA • by Rivest, Shamir & Adleman of MIT in 1977 • best known & widely used public-key scheme • based on exponentiation in a finite (Galois) field over integers modulo a prime – nb. exponentiation takes O((log n)3) operations (easy) • uses large integers (eg. 1024 bits) • security due to cost of factoring large numbers – nb. factorization takes O(e log n log log n) operations (hard) CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 20. The RSA Algorithm • Pick two large (100 digit) primes p and q. • Let n = pq • Select a relatively small integer d that is prime to (p-1)(q-1) • Find e, the multiplicative inverse of d mod (p-1)(q-1) • (d,n) is the public key. To encrypt M, compute – En(M) = Me(mod n) • (e,n) is the private key. To decrypt C, compute – De(C) = Cd(mod n) CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 21. RSA example • • • • • • • • • Let p = 11, q = 13 n = pq = 143 (p-1)(q-1) = 120 = 3 x 23 x 5 Possible d: 7, 11, 13, 17, … (let’s use 7) Find e: e*7 = 1(mod 120) = 103 Public key: (7, 143) Private key: (103, 143) En(42) = 427 (mod 143) = 81 De(81) = 81103(mod 143) = 42 CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 22. Correctness of RSA • To show RSA is correct, we must show that encryption and decryption are inverse functions: – En(De(M)) = De(En(M)) = M = Med (mod n) – Since d and e are multiplicative inverses, there is a k such that: • • • • ed=1+ kn = 1 + k(p-1)(q-1) Med = M1+k(p-1)(q-1) = M*(Mp-1)k(q-1) By Fermat: Mp-1=1(mod p) Med = M(1)k(q-1)(mod p) = M(mod p) CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 23. Correctness of RSA • • • • Med = M(1)k(q-1)(mod p) = M(mod p) Med = M(1)k(q-1)(mod q) = M(mod q) By Chinese Remainder Thm, we get: M^{ed} = M (mod p) M (mod q) = M (mod pq) = M (mod n) • Therefore, RSA reproduces the original message and is correct. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 24. Strengths of RSA • • • • No prior communication needed Highly secure (for large enough keys) Well-understood Allows both encryption and signing CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 25. Weaknesses of RSA • Large keys needed (1024 bits is current standard) • Relatively slow – Not suitable for very large messages • Public keys must still be distributed safely. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 26. RSA Key Setup • each user generates a public/private key pair by: • selecting two large primes at random - p, q • computing their system modulus N=p.q – note ø(N)=(p-1)(q-1) • selecting at random the encryption key e • where 1<e<ø(N), gcd(e,ø(N))=1 • solve following equation to find decryption key d – e.d=1 mod ø(N) and 0≤d≤N • publish their public encryption key: KU={e,N} • keep secret private decryption key: KR={d,p,q} CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 27. RSA Use • to encrypt a message M the sender: – obtains public key of recipient KU={e,N} – computes: C=Me mod N, where 0≤M<N • to decrypt the ciphertext C the owner: – uses their private key KR={d,p,q} – computes: M=Cd mod N • note that the message M must be smaller than the modulus N (block if needed) CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 28. Why RSA Works • because of Euler's Theorem: • aø(n)mod N = 1 – where gcd(a,N)=1 • in RSA have: – – – – N=p.q ø(N)=(p-1)(q-1) carefully chosen e & d to be inverses mod ø(N) hence e.d=1+k.ø(N) for some k • hence : Cd = (Me)d = M1+k.ø(N) = M1.(Mø(N))q = M1.(1)q = M1 = M mod N CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 29. RSA Example Select primes: p=17 & q=11 Compute n = pq =17 11=187 Compute ø(n)=(p–1)(q-1)=16 10=160 Select e : gcd(e,160)=1; choose e=7 Determine d: de=1 mod 160 and d < 160 Value is d=23 since 23 7=161= 10 160+1 6. Publish public key KU={7,187} 7. Keep secret private key KR={23,17,11} 1. 2. 3. 4. 5. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 30. RSA Example cont • sample RSA encryption/decryption is: • given message M = 88 (nb. 88<187) • encryption: C = 887 mod 187 = 11 • decryption: M = 1123 mod 187 = 88 CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 31. Exponentiation • • • • can use the Square and Multiply Algorithm a fast, efficient algorithm for exponentiation concept is based on repeatedly squaring base and multiplying in the ones that are needed to compute the result • look at binary representation of exponent • only takes O(log2 n) multiples for number n – eg. 75 = 74.71 = 3.7 = 10 mod 11 – eg. 3129 = 3128.31 = 5.3 = 4 mod 11 CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 32. Exponentiation CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 33. RSA Key Generation • users of RSA must: – determine two primes at random - p, q – select either e or d and compute the other • primes p,q must not be easily derived from modulus N=p.q – means must be sufficiently large – typically guess and use probabilistic test • exponents e, d are inverses, so use Inverse algorithm to compute the other CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 34. RSA Security • three approaches to attacking RSA: – brute force key search (infeasible given size of numbers) – mathematical attacks (based on difficulty of computing ø(N), by factoring modulus N) – timing attacks (on running of decryption) CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 35. Factoring Problem • mathematical approach takes 3 forms: – factor N=p.q, hence find ø(N) and then d – determine ø(N) directly and find d – find d directly • currently believe all equivalent to factoring – have seen slow improvements over the years • as of Aug-99 best is 130 decimal digits (512) bit with GNFS – biggest improvement comes from improved algorithm • cf “Quadratic Sieve” to “Generalized Number Field Sieve” – barring dramatic breakthrough 1024+ bit RSA secure • ensure p, q of similar size and matching other constraints CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 36. Timing Attacks • developed in mid-1990’s • exploit timing variations in operations – eg. multiplying by small vs large number – or IF's varying which instructions executed • infer operand size based on time taken • RSA exploits time taken in exponentiation • countermeasures – use constant exponentiation time – add random delays – blind values used in calculations CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 37. What Is Message Authentication • It’s the “source,” of course! • Procedure that allows communicating parties to verify that received messages are authentic(可 信的) • Characteristics: – source is authentic – masquerading – contents unaltered – message modification – timely sequencing – replay CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 38. Approaches to Message Authentication • Authentication Using Conventional Encryption – Assume only sender and receiver share a key – Then a correctly encrypted message should be from the sender • Usually also contains error-detection code, sequence number and time stamp CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 39. Message Authentication • Without Encryption • No confidentiality is preferred when: 1. Same message is broadcast to many destinations 2. Heavy load and cannot decrypt all messages – some chosen at random 3. No danger in sending plaintext Append authentication tag to each message CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 40. Approaches to Message Authentication • Message Authentication without Message Encryption – An authentication tag is generated and appended to each message-Message Authentication Code (MAC) – – – – MAC is generated by using a secret key Assumes both parties A,B share common secret key KAB Code is function of message and key MACM= F(KAB, M) Message plus code are transmitted CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 41. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 42. Using Symmetric Ciphers for MACs • can use cipher block chaining mode and use final block as a MAC • Data Authentication Algorithm (DAA) is a widely used MAC based on DES-CBC – using IV=0 and zero-pad of final block – encrypt message using DES in CBC mode – and send just the final block as the MAC • or the leftmost M bits (16≤M≤64) of final block CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 43. What Is Message Authentication • It’s the “source,” of course! • Procedure that allows communicating parties to verify that received messages are authentic • Characteristics: – source is authentic – masquerading – contents unaltered – message modification – timely sequencing – replay CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 44. Approaches to Message Authentication • Authentication Using Conventional Encryption – Assume only sender and receiver share a key – Then a correctly encrypted message should be from the sender • Usually also contains error-detection code, sequence number and time stamp CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 45. Message Authentication • Without Encryption • No confidentiality is preferred when: 1. Same message is broadcast to many destinations 2. Heavy load and cannot decrypt all messages – some chosen at random 3. No danger in sending plaintext Append authentication tag to each message CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 46. Approaches to Message Authentication • Message Authentication without Message Encryption – An authentication tag is generated and appended to each message-Message Authentication Code (MAC) – – – – MAC is generated by using a secret key Assumes both parties A,B share common secret key KAB Code is function of message and key MACM= F(KAB, M) Message plus code are transmitted CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 47. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 48. Using Symmetric Ciphers for MACs • can use cipher block chaining mode and use final block as a MAC • Data Authentication Algorithm (DAA) is a widely used MAC based on DES-CBC – using IV=0 and zero-pad of final block – encrypt message using DES in CBC mode – and send just the final block as the MAC • or the leftmost M bits (16≤M≤64) of final block CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 49. Data Authentication Algorithm (DAA) CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 50. One-way HASH function • Alternative to Message Authentication Code • Accepts a variable size message M as input and produces a fixed-size message digest H (M) as output CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 51. One-way HASH function CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 52. One Way Hash Function Ideally We Would Like To Avoid Encryption • Encryption software is slow • Encryption hardware costs aren’t cheap • Hardware optimized toward large data sizes • Algorithms covered by patents • Algorithms subject to export control CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 53. One-way HASH function • Secret value is added before the hash and removed before transmission. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 54. Secure HASH Functions • Purpose of the HASH function is to produce a “fingerprint”. • Properties of a HASH function H : 1. H can be applied to a block of data at any size 2. H produces a fixed length output 3. H(x) is easy to compute for any given x. 4. For any given block h, it is computationally infeasible to find x such that H(x) = h 5. For any given block x, it is computationally infeasible to find H(y) = H(x). 6. It is computationally infeasible to find any pair (x, y) such that H(x) = H(y) CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in) with
  • 55. Simple Hash Function • General principle – Input is a sequence of n-bit blocks – Input is processed one block at a time to produce an n-bit hash function – A simple example is the bit-by-bit XOR of each block Ci = bi1 ⊕bi2⊕ … ⊕bim Ci is ith bit of hash code 1 <= i <= n m is number of n-bit block in input bij is ith bit in jth block ⊕ is the XOR CNS Notes by, Er. Swapnil V. Kaware operation (svkaware@yahoo.co.in)
  • 56. Simple Hash Function CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 57. SHA-1 Secure Hash Function • The Secure Hash Algorithm( SHA) was developed by the National Institute of Standards and Technology and published in 1993. SHA-1 is 1995 revised version. • It takes as input a message with maximum length < 264 bits and produces a 160-bit message digest. • It is processed in 512-bit blocks. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 58. SHA-1 Secure Hash Function K CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 59. SHA-1 Processing of single 512-Bit Block CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 60. SHA-1 -Creation of 80-word Wt=(Wt-16 Wt-14 Wt-8 Wt-3) <<1 CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 61. Other Secure HASH functions SHA-1 MD5 RIPEMD-160 Digest length 160 bits 128 bits 160 bits Basic unit of processing 512 bits 512 bits 512 bits Number of steps 80 (4 rounds of 20) 64 (4 rounds of 16) 160 (5 paired rounds of 16) Maximum message size 264-1 bits CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 62. Public-Key Cryptography Principles • The use of two keys has consequences in: key distribution, confidentiality and authentication. • The scheme has six ingredients (see Figure 3.7) – Plaintext – Encryption algorithm – Public and private key – Ciphertext – Decryption algorithm CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 63. Encryption using Public-Key system Encryption CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 64. Authentication using Public-Key System Authentication CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 65. Applications for Public-Key Cryptosystems • Three categories: – Encryption/decryption: The sender encrypts a message with the recipient’s public key. – Digital signature: The sender ”signs” a message with its private key. – Key echange: Two sides cooperate two exhange a session key. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 66. Public-Key Cryptographic Algorithms • RSA - Ron Rives, Adi Shamir and Len Adleman at MIT, in 1977. – RSA is a block cipher – The most widely implemented – based on exponentiationin a finite field over integers modulo a prime – uses large integers (eg. 1024 bits) – security due to cost of factoring large numbers CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 67. Prime and Composite Numbers • An integer p is prime if its divisors are 1 and p only. • Otherwise, it is a composite number. • E.g. 2,3,5,7 are prime; 4,6,8,9,10 are not • List of prime number less than 200: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 68. Prime Factorization () • To factor a number n is to write it as a product of other numbers: n=a×b×c • The prime factorization of a number n is when it is written as a product of primes • E.g. 91=7×13; 3600=24×32×52 • It is generally hard to do (prime) factorization when the number is large • E.g. factorize 93874093217498173983210748123487143249761 CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 69. Relatively Prime Numbers & GCD • two numbers a, b are relatively primeif have no common divisorsapart from 1 – eg. 8 & 15 are relatively prime since factors of 8 are 1,2,4,8 and of 15 are 1,3,5,15 and 1 is the only common factor • conversely can determine the GCD(greatest common divisor) by comparing their prime factorizations and using least powers – eg. 300=21×31×52 18=21×32 GCD(18,300)=21×31×50=6 CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in) hence
  • 70. The Euler phi Function For n 1, let (n) denote the number of integers in the interval [1, n] which are relatively prime to n. The function is called the Euler phi function (or the Euler totient function). Fact 1. The Euler phi function is multiplicative. I.e. if gcd(m, n) = 1, then (mn) = (m) x (n). E.g. 91=7×13 (7) =6 (13)=12 (91) = (7) × (13) =6×12=72 CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 71. Summary • Public key encryption provides a flexible system for secure communication in open environments. • Based on one-way functions. • Allows for both authentication and signing. • Secure public key distribution remains a problem. RSA is a public key encryption algorithm whose security is believed to be based on the problem of factoring large numbers. • ElGamal is a public key encryption algorithm whose security is believed to be based on the discrete logarithm problem. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 72. Summary • Public key systems replace the problem of distributing symmetric keys with one of authenticating public keys. • Public key encryption algorithms need to be trapdoor one-way functions. • RSA is less efficient and fast to operate than most symmetric encryption algorithms because they involve modular exponentiation. • DH key exchange is an important protocol on which many real key exchange protocols are based. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)
  • 73. References • A.K. Dewdney, The New Turning Omnibus, pp. 250-257, Henry Holt and Company, 2001. • RSA Cryptosystem, http://primes.utm.edu/glossary/page.php?sort=RSA. • Cryptology FAQ, http://www.faqs.org/faqs/cryptography-faq/part06/. • A. Shamir, “A Polynomial-Time Algorithm for Breaking the Basic Merkle-Hellman Cryptosystem", Advances in Cryptology - CRYPTO '82 Proceedings, pp. 279-288, Plenum Press, 1983. IEEE Transactions on Information Theory, Vol. IT-30, pp. 699-704, 1984. • The Extended Euclidian Algorithm, http://www.grc.nasa.gov/WWW/price000/pfc/htc/zz_xeuclidalg.html. CNS Notes by, Er. Swapnil V. Kaware (svkaware@yahoo.co.in)