Elgamal Signature Scheme
Elgamal Signature Scheme
- Developed by Elgamal around 1985, alongside the Elgamal cryptosystem.
- The United States National Standard for Digital Signature Scheme (approved by NIST) is based upon the Elgamal Signature Scheme.
- Requires closer attention due to the density of mathematics.
Differences from RSA Signature Scheme
- RSA signature scheme utilizes the RSA cryptosystem directly.
- Elgamal signature scheme isn't a direct repurposing of the Elgamal cryptosystem because the Elgamal cryptosystem is not endomorphic which is a requirement to create a signature scheme
Two Conditions for Public Key Cryptosystem to be a Digital Signature Scheme:
- It has to be an endomorphic cryptosystem.
- Decrypting and then encrypting should return the original message.
Randomized Signature Scheme
- Elgamal is a randomized signature scheme.
- Uses a random number as part of the signing process.
- Multiple possible valid signatures exist for the same message.
- The verification algorithm must accept any valid signature.
- Verification algorithm must accept any valid signature because there are many valid signatures.
Setup
- Select a large prime number (e.g., 2000 bits or 600 digits).
- Select , a primitive element in . (Zp is a cyclic group, meaning all elements can be generated by ).
- Select an exponent from (between 0 and ).
- Compute .
Key Generation
- The key consists of four parameters: , , , and . This process is identical to Elgamal cryptosystem key generation.
- , , and are public.
- is the secret key.
Spaces
- Message (plaintext) space: .
- Signature space: . This differs from the Elgamal cryptosystem's ciphertext space (.
Signing Algorithm (Alice signs message x to Bob)
- Select a random number from . This means has an inverse in . (Note: is not prime).
- To select such a , pick a random number from and compute .
- If , then .
- If \gcd(k, p-1) > 1, discard and try again.
- To select such a , pick a random number from and compute .
- Compute .
- Compute .
- The signature is .
- Alice sends to Bob.
Efficiency
- Gamma can be computed efficiently using modular exponentiation (square and multiply algorithm).
- Delta involves: (the message), (Alice's private key), (computed in step 3), and (the inverse of the random number). The inverse exists because was chosen from .
- The first computation is done modulo p, the second one modulo p-1.
Verification Algorithm
- Bob receives message and signature from Alice.
- Bob checks if the following congruence holds:
- Bob knows and can efficiently compute both sides of congruence and verify if it holds true or not.
Correctness of the Algorithm
- If the signature is constructed properly by Alice, the verification algorithm should return true.
- , so
- , so
- Thus,
- Since , then , which means .
- Therefore, for some integer .
- Substituting back, .
- Because is a primitive element in , .
- Thus, .
- Therefore, if the signature was constructed correctly.
Exponents always obey modulo p-1 arithmetic. Whenever you have an equation in modulo p, the exponents obey modulo p-1 arithmetic.
Security of Elgamal Signature Scheme
- Security means that an opponent (Oscar) cannot forge Alice's signature.
- Kirchhoff's principle: Oscar knows the scheme, but not Alice's private key ().
Forging a Message
- Oscar picks a message .
- Oscar needs to construct a signature such that .
- Oscar can choose randomly and try to construct a suitable .
- From , we get .
- Thus, , which is a discrete log problem.
- Solving the discrete log problem is computationally difficult in .
Picking Delta First
- Oscar picks and then tries to construct a suitable .
- . Here appears in the exponent and base, and finding is a difficult problem.
Forging a Random Message
- Oscar picks both and randomly and then tries to build a message x for which () will be deemed as a valid signature.
- . This is again a discrete log problem.
Simultaneous Construction of x, gamma, and delta
- Oscar selects two integers and .
- .
- . (i.e., ).
- Compute .
- Compute .
- Compute .
- If Oscar builds , and this way, Bob will consider this a valid signature.
- The verification involves:
Revealing the Random Number
- If Alice accidentally reveals the random number , it is dangerous.
- The opponent can figure out Alice's private key .
- becomes .
- becomes .
- Oscar knows and can compute .
Reusing the Random Number
- Alice uses the same random number to sign two different messages, and .
- is the signature for , and is the signature for , where .
- Oscar observes both messages.
- Since signatures are valid, and .
- Dividing the two equations: .
- Substituting : .
- Therefore, .
Lucky Day Scenario
- If has an inverse modulo , then .
Unlucky Day Scenario
- If \gcd(\delta1 - \delta2, p-1) = d > 1, then there's a new equation by dividing with gcd as follows
- Thus, has an inverse modulo .
- Multiplying by gives .
- Lifting to for some between 0 and
- Find correct k by testing the values of k that satisfy equality. Test all ks with
- Final Concluding statement: It is very very important that Allies does not use the same random number again and again. Well, not only again and again, not even for two different messages.