Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

L-2.11 El Gamal - DSS

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

Department of Computer Science and Engineering (CSE)

El Gamal Digital Signature

www. cuchd.in University Institute of Engineering (UIE) : Gharaun, Mohali


Campus
Department of Computer Science and Engineering (CSE)

ElGamal Digital Signature Scheme


 Involves the use of the private key for encryption and the
public key for decryption.

 We know that
For a prime number q, if α is a primitive root of q, then

α, α2, …, α q-1
are distinct (mod q).

 Global elements of ElGamal Digital Signature Scheme are


prime number q and α (Primitive root of q).

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

ElGamal Digital Signature Scheme


Step-1
User A generates a private/public key pair as follows:

1. Generate a random integer XA, such that 1 < XA < q-1


2. Compute YA = α XA mod q
3. A’s private key is XA
A’s public key is {q, α, YA}

Step-2
To sign a message M, user A first computes the hash m=H(M),
such that m is an integer in the range 0 ≤ m ≤ q-1.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

ElGamal Digital Signature Scheme


Step-3
User A forms Digital Signature:

1. Choose a random integer K such that


1 < K < q-1 and gcd (K, q-1)=1 // Relatively Prime
2. Compute S1 = αK mod q
3. Compute K-1mod(q-1)// Inverse of K modulo q-1
4. Compute S2 = K-1(m - XA S1) mod (q-1)
5. The signature consists of the pair (S1 , S2)

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

ElGamal Digital Signature Scheme


Any user B can verify the signature as follows:

1. Compute V1 = αm mod q
S1 S2
2. Compute V2 = (YA) (S1) mod q

Signature is valid if V1 = V2

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

ElGamal Digital Signature Scheme


Example

 Global elements of ElGamal Digital Signature Scheme are


prime number q and α (Primitive root of q).

Let q=19 (Prime Number)


Primitive root of 19 are : {2, 3, 10, 13, 14, 15}

Let α = 10

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

ElGamal Digital Signature Scheme


Step-1

1. Generate a random integer XA, such that 1 < XA < q-1


Let XA = 16

XA
2. Compute YA = α mod q
16
YA = 10 mod 19 = 4

3. A’s private key is XA XA = 16


A’s public key is {q, α, YA} Public Key = {19, 10, 4}

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

ElGamal Digital Signature Scheme


Step-2
User Alice wants to sign a message with hash value m=14

(m is an integer in the range 0 ≤ m ≤ q-1)

0 ≤ m ≤ 18

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

ElGamal Digital Signature Scheme


Step-3
User A forms Digital Signature:

1. Choose a random integer K such that


1 < K < q-1 and gcd (K, q-1)=1 // Relatively Prime

K=5, which is relatively prime to q-1 =18

2. Compute S1 = αK mod q
S1 = 105 mod 19 = 3

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

ElGamal Digital Signature Scheme


3. Compute K-1mod(q-1)// Inverse of K modulo q-1
K-1mod(q-1) = 5-1mod(18) = 11

4. Compute S2 = K-1(m - XA S1) mod (q-1)


S2 = 11(14 – 16x3) mod (18) = -374 mod 18 = 4

5. The signature consists of the pair (S1 , S2)


(S1 , S2) = (3, 4)

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

ElGamal Digital Signature Scheme


Any user B can verify the signature as follows:

1. Compute V1 = αm mod q
V1 = 1014 mod 19 = 16

2. Compute V2 = (YA) S1 (S1) S2 mod q


V2 = (4) 3 (3) 4 mod 19 = 5184 mod 19 = 16

Signature is valid because V1 = V2

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

ElGamal Digital Signature Scheme


Step-1
User A generates a private/public key pair as follows:

1. Generate a random integer XA, such that 1 < XA < q-1


2. Compute YA = α XA mod q
3. A’s private key is XA
A’s public key is {q, α, YA}

Step-2
To sign a message M, user A first computes the hash m=H(M),
such that m is an integer in the range 0 ≤ m ≤ q-1.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Standard (DSS)


 A public-key technique.

 DSS makes use of the Secure Hash Algorithm (SHA) and presents
a new digital signature technique, the Digital Signature Algorithm
(DSA)

 DSS uses an algorithm that is designed to provide only the digital


signature function.

 It cannot be used for encryption or key exchange.

 RSA approach of digital signature also provides encryption.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Standard (DSS)


 Approaches of Digital Signature

1. RSA Approach

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Standard (DSS)


 DSS Approach

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Standard (DSS)


2. DSS Approach…

 Uses Hash functions.

 The hash code is provided as input to a signature function along


with a random number k generated for this particular signature.

 The signature function also depends on the sender’s private key


(PRa) and a set of parameters known to a group of
communicating principals.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Standard (DSS)


DSS Approach…

 This set constitutes a global public key (PUG).

 Result of signature function consists of two components, labeled


s and r.

 At the receiving end, the hash code of the incoming message is


generated.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Standard (DSS)


DSS Approach…

 Generate hash code + signature is input to a verification function.

 The verification function also depends on the global public key as


well as the sender’s public key

 The output of the verification function is a value that is equal to


the signature component r if the signature is valid.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Algorithm (DSA)


Global Public-Key Components :

Three public parameters and common to a group of users.

 A 160-bit prime number q is chosen.

 Next, a prime number p is selected with a length between 512 and


1024 bits such that q divides (p - 1)

 Finally, g is chosen to be of the form h (p-1)/q mod p, where h is an


integer between 1 and (p-1) with the restriction that must be greater
than 1.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Algorithm (DSA)

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Algorithm (DSA)


User’s Private Key

 The private key x must be a number from 1 to (q-1) and should be


chosen randomly or pseudorandomly.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Algorithm (DSA)


User’s Public Key

 The public key is calculated from the private key as


y = gx mod p

 However, given the public key y, it is believed to be


computationally infeasible to determine x.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Algorithm (DSA)


User's Per-Message Secret Number

 k = random or pseudorandom integer with 0 < k < q

Signing

 To create a signature, a user calculates two quantities r and s, that


are functions of the public key components (p, q, g), the user’s
private key (x) , the hash code of the message H(m), and an
additional integer k .

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Algorithm (DSA)

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Digital Signature Algorithm (DSA)


Verification

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

References
• http://www.brainkart.com/article/Classical-Encryption-
Techniques_8339/
• https://www.tutorialspoint.com/cryptography/index.ht
m
• https://www.geeksforgeeks.org/cryptography-introducti
on/
• https://www.techopedia.com/definition/1770/cryptogr
aphy#:~:text=Cryptography%20involves%20creating%2
0written%20or,information%20to%20be%20kept%20s
ecret.&text=Information%20security%20uses%20crypto
graphy%20on,transit%20and%20while%20being%20st
ored
.
• https://www2.slideshare.net/lineking/classical-encrypti
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)

E- Books Recommended
• https://www.pdfdrive.com/cyber-security-books.html
• https://bookauthority.org/books/new-cyber-security-eb
ooks
• https://bookauthority.org/books/best-cyber-security-eb
ooks
• https://www.freetechbooks.com/information-security-f5
2.html

University Institute of Engineering (UIE)

You might also like