Professional Documents
Culture Documents
ISS Notes Unit-3
ISS Notes Unit-3
Technology, Jaipur
Presented By:
Satish Kumar Alaria
Department of CSE/IT
Subject: Information Security System
Private-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
thosewho encrypt messages or verify signatures cannot
decrypt messages or create signatures
Public-Key Cryptography
Public-Key Characteristics
Key generation
Generate two very large prime numbers, p and q,
which satisfies the condition
p ≠ q → p ≡ q ≡ 3 (mod 4)
For example:
p=139 and q=191
Calculate the value of n
n = p.q
Publish n as public key and save p and q as private
key
Encryption
Get the public key n.
Convert the message to ASCII value.
Then convert it to binary and extend
the binary value with itself, and
change the binary value back to
decimal m.
Encrypt with the formula:
C = m2 mod n
Send C to recipient.
Decryption
Accept C from sender.
Specify a and b with Extended Euclidean GCD such that, a.p + b.q = 1
Compute r and s using following formula:
r = C(p+1)/4 mod p
s = C(q+1)/4 mod q
Now, calculate M1,M2,M3 & M4 using following formula:
M1 = ( a.p.s + b.q.r ) mod n
M2=n-M1
M3 = ( a.p.s – b.q.r ) mod n
M4=n-M3
Determine in which the left and right half are same. Keep that
binary’s one half and convert it to decimal m. Get the ASCII character
for the decimal value m. The resultant character gives the correct
message sent by sender.
Example of Rabin Cryptosystem
Key Generation:
Taking two prime numbers
p=7 & q=11
n=7*11= 77
p & q are private key and n is the public key.
Encryption:
Assume value of M= 20
Then C= M^2 mod n
= 20*20 mod 77 = 15
Decryption:
Specify a and b with Extended Euclidean GCD such that, a.p + b.q = 1
Choose a=-3, b=2
-3*7+2*11=1
Compute r and s using following formula:
r = C(p+1)/4 mod p
r= 15^2 mod 7 = 1
s = C(q+1)/4 mod q
s= 15^3 mod 11 = 9
Now, calculate m1,m2,m3,m4 using following formula:
m1 = ( a.p.s + b.q.r ) mod n
m1= 64
m2= n-m1 = 13
m3 = ( a.p.r – b.q.r ) mod n
m3= 20
m4=n-m3 = 57
So Exact Value is m3.
Advantage & Disadvantage
Key Generation:
Select Large Prime Number P (1st Part of Encryption
key)
Assume P= 11
Select Decryption Key/Private Key D ( 1<D<P-1)
Assume D=3
Select 2nd Part of Encryption Key E1 (1<E1<P-1)
Assume E1=2
Calculate 3rd part of Encryption Key E2
E2= E1^D mod P=8
Public Key (P,E1,E2) = (11,2,8), Private Key D=3
Encryption:
Select any Random Integer R
Assume R=4
C1= E1^R mod P
C1= 2^4 mod 11=5
C2=(PT x E2^R) mod P
C2= (7 x 8^4) mod 11=28672 mod 11=6 (Assume
PT=7)
CT=(C1,C2)= (5,6)
Where PT=Plain Text, CT= Cipher Text
Decryption:
PT= (C2 x (C1)^ (-D) ) mod P
PT= 6 x (5)^(-3) mod 11
PT= 6 x 3 mod 11
PT= 7
ElGamal Analysis
In ElGamal system, each user has a private key D.
and has three components of public key − prime
modulus p, generator E1, and public E2.
The strength of the ElGamal is based on the
difficulty of discrete logarithm problem.
The secure key size is generally > 1024 bits. Today
even 2048 bits long key are used.
On the processing speed front, Elgamal is quite
slow, it is used mainly for key authentication
protocols.
RSA and ElGamal Schemes – A Comparison
RSA ElGamal
For a particular security level, For the same level of security, very
lengthy keys are required in RSA. short keys are required.
Elliptic
curve cryptography uses curves
whose variables & coefficients are finite
Have two families commonly used:
prime curves Ep(a,b) defined over Zp
use integers modulo a prime
best in software
binary curves E2m(a,b) defined over GF(2n)
use polynomials with binary coefficients
best in hardware
Elliptic Curve Cryptography
It only requires a single key for both It requires two key one to encrypt
encryption and decryption. and the other one to decrypt.
The size of cipher text is same or The size of cipher text is same or
smaller than the original plain text. larger than the original plain text.
It provides confidentiality,
It only provides confidentiality.
authenticity and non-repudiation.