Task F: Schnorr Protocol Security Analysis
Problem Analysis
Problem Background and Core Challenges
Task F provides an in-depth analysis of the Schnorr Identification Protocol, a standard zero-knowledge Sigma protocol. The goal of this protocol is to prove that the Prover knows the discrete logarithm such that the public key .
This problem analyzes the security of the protocol from three perspectives:
- Lack of Soundness: When the verifier's random number generator is predictable, a malicious prover can pass verification through a "lucky guess" attack
- Special Soundness: Through "rewinding" techniques, we can formally prove knowledge soundness
- Real-World Implementation Errors: When the prover reuses the random number , an attacker can recover the secret key
Basic Structure of the Schnorr Protocol
Public Parameters:
- Group : A group of large prime order with generator
Keys:
- Secret Key (Prover):
- Public Key (Verifier):
Protocol Steps (P ↔ V):
- Commit: P selects random , computes commitment , and sends to V
- Challenge: V selects random challenge and sends to P
- Response: P computes response and sends to V
- Verify: V accepts the proof if and only if the check holds
Correctness Verification:
Three Basic Properties of Zero-Knowledge Proofs
- Completeness: If the prover knows the secret, an honest verifier always accepts
- Soundness: If the prover does not know the secret, the verifier rejects with high probability
- Zero-Knowledge: The verifier cannot obtain any information about the secret from the proof process
Problem 1.1: "Lucky Guess" Attack (Lack of Soundness)
Problem Description
Scenario: Malicious prover Mallory does not know the secret , but she knows that the verifier's random number generator is weak and always issues the challenge value (predictable).
Question (a): Show how Mallory can construct a valid proof transcript that passes the verification check without knowing . Clearly state the order in which Mallory generates and .
Question (b): Explain why this "lucky guess" attack works in a single interaction.
In-Depth Analysis
Definition of Soundness
Soundness:
- If the prover does not know the secret, the verifier rejects the proof with high probability
- Formal: , where is a negligible function
Importance of Soundness:
- Ensures that provers without the secret cannot pass verification
- If Soundness is not satisfied, the protocol is insecure
The Problem of Predictable Challenges
Normal Case:
- The verifier randomly selects challenge , which the prover cannot predict
- The prover must choose in advance, then compute based on
- Without knowing , it is impossible to compute the correct for any arbitrary
Case of Predictable Challenge:
- If challenge is predictable (e.g., always a fixed value or can be inferred from some information)
- The prover can know in advance and thus construct a valid proof
Standard Answer
Question (a): Mallory's Attack Method
Mallory's Knowledge:
- Mallory does not know the secret
- Mallory knows that the verifier's random number generator is weak and always issues challenge value (predictable)
Mallory's Attack Steps:
Step 1: Mallory knows challenge in advance
- Since the verifier's random number generator is predictable, Mallory can know the challenge value in advance
Step 2: Mallory randomly selects response
- Mallory randomly selects
Step 3: Mallory computes commitment
- Mallory computes:
- This is equivalent to:
Step 4: Mallory sends to the verifier
Verification Check:
Key Observation:
- Generation Order: Mallory first selects , then computes
- This is opposite to the normal protocol: the normal protocol first selects (thus determining ), then computes based on
- Since Mallory knows in advance, she can "work backwards": first select , then compute that makes the verification equation hold
Question (b): Why the "Lucky Guess" Attack Works in a Single Interaction
Philosophical Reasons:
-
Soundness Depends on Challenge Unpredictability:
- The proof of Soundness relies on the prover's inability to predict the challenge
- If the challenge is predictable, the prover can "prepare in advance"
-
Limitations of Single Interaction:
- In a single interaction, the verifier only sends the challenge once
- If the challenge is predictable, the prover can construct a valid proof for this specific challenge
- The verifier cannot "retry" to detect whether the prover really knows the secret
-
Possibility of "Working Backwards":
- Normal protocol: (determined first), (computed later)
- Attack method: (selected first), (computed later)
- Since is known, we can "work backwards" to find that makes the verification equation hold
-
Lack of "Knowledge Extraction" Mechanism:
- In a single interaction, the verifier cannot extract the prover's knowledge
- If the challenge is predictable, the prover can "forge" a knowledge proof without really knowing the secret
Summary: The "lucky guess" attack works in a single interaction because Soundness depends on the randomness and unpredictability of the challenge. When the challenge is predictable, the prover can construct a valid proof for a specific challenge without knowing the secret.
Problem 1.2: The Rewinding Trap (Special Soundness)
Problem Description
Scenario: To formally prove "Knowledge Soundness", we use a "thought experiment" involving an "Extractor" capable of "rewinding" the prover. The purpose of this test is to ensure the prover is not just "getting lucky".
Scenario Description:
- A malicious prover is tested by the "rewinding" process
- The prover outputs commitment
- Then is forced to correctly answer two different challenges
Run A: Challenge yields valid response Run B: Challenge yields valid response (where )
Since is the same in both runs, this means the hidden random number (such that ) is also the same.
Question (a): Write down the two verification equations based on the prover's knowledge for Run A and Run B.
Question (b): Using algebraic manipulation (subtraction and modular arithmetic), prove that the Extractor can compute the secret using only the public values . Derive the formula for .
Question (c): Explain, in a single sentence, why this Rewinding process guarantees that any prover who can consistently pass this test must possess the secret .
In-Depth Analysis
Concept of Special Soundness
Special Soundness:
- If a prover can answer two different challenges for the same commitment , then the secret can be extracted
- This is a stronger property than ordinary Soundness: it not only ensures that provers without the secret cannot pass verification, but also guarantees that provers who can pass verification must know the secret (knowledge extraction)
Rewinding Technique
Rewinding Technique:
- The extractor can "rewind" the prover, using the same commitment but sending different challenges
- If the prover can provide valid responses to two different challenges, the secret can be extracted from the two responses
Why Rewinding is Needed:
- In a single interaction, the secret cannot be extracted
- Through rewinding, we can "force" the prover to answer multiple challenges, thus extracting the secret
Standard Answer
Question (a): Two Verification Equations
Run A:
- Commitment:
- Challenge:
- Response:
- Verification equation:
Run B:
- Commitment: (same as Run A)
- Challenge: ()
- Response:
- Verification equation:
Key Observation:
- Both runs use the same and
- But challenges are different:
- Responses are also different:
Question (b): Derivation of Formula to Extract Secret
Given Conditions:
Derivation Process:
Step 1: Compute
Step 2: Solve for Since , , therefore has an inverse in .
Verification:
Extractor's Algorithm:
- Run the protocol, obtain
- Rewind the protocol, use the same , send different challenge , obtain
- Compute:
Key Observation:
- The extractor only needs public values:
- Does not need to know (because is eliminated in the subtraction)
- As long as , can be computed
Question (c): Why Rewinding Guarantees the Prover Must Possess Secret
One-Sentence Explanation:
If a prover can answer two different challenges for the same commitment , then the secret can be directly computed from the two responses , which means the prover must know (or be able to compute ), otherwise it cannot construct responses that satisfy both verification equations.
Detailed Explanation:
-
Possibility of Knowledge Extraction:
- If the prover can pass the rewinding test, the extractor can compute
- This means the prover "possesses" the knowledge (or can compute the knowledge)
-
Impossibility Argument:
- If the prover does not know , it cannot provide correct responses to arbitrary challenges
- Even if "lucky" to pass verification once, it cannot provide correct responses to a second different challenge
- Therefore, a prover who can pass the rewinding test must know
-
Guarantee of Special Soundness:
- Special Soundness guarantees: provers who can pass verification have extractable knowledge
- This is stronger than ordinary Soundness: it not only ensures that provers without the secret cannot pass, but also guarantees that provers who can pass must know the secret
Problem 1.3: Real-World Implementation Error (Nonce Reuse)
Problem Description
Scenario: The mathematical extraction proved in Question 1.2 is highly theoretical. However, sometimes a disastrous real-world implementation error causes the exact same extraction to occur naturally.
Consider a lazy prover Peggy who reuses the same random value (and thus the same commitment ) for two separate, independent proofs against different challenges and . An attacker Eve observes two complete transcripts:
- Transcript 1:
- Transcript 2:
Question (a): Prove that Eve can recover Peggy's secret key using the same algebraic method as in Question 1.2, without needing to "hack" or "rewind time".
Question (b): Explain the difference in who controls the reuse of in the following two scenarios, and why one is a feature (Soundness Proof) and the other is a fatal bug (Real-World Attack):
- Scenario A: The Extractor forcing reuse in Question 1.2
- Scenario B: The Prover accidentally reusing in this Question
In-Depth Analysis
Danger of Nonce Reuse
Role of Nonce (Random Number):
- In the Schnorr protocol, is a random number (nonce) used to generate commitment
- must be randomly chosen each time and cannot be reused
Consequences of Nonce Reuse:
- If is reused, two different proofs use the same
- An attacker can observe two transcripts and thus extract the secret
Theoretical Extraction vs. Real-World Attack
Theoretical Extraction (Problem 1.2):
- The extractor can "rewind" the prover, forcing the use of the same
- This is a theoretical thought experiment used to prove Special Soundness
Real-World Attack (Problem 1.3):
- The prover herself reuses , causing two proofs to use the same
- An attacker only needs to observe two transcripts to extract the secret
- This is a real attack caused by implementation errors
Standard Answer
Question (a): Eve Recovers Secret Key
Eve's Observation:
- Transcript 1: , where
- Transcript 2: , where (Note: is the same, meaning is the same)
Eve's Attack Method:
Step 1: Compute
Step 2: Solve for Since (two different challenges), , therefore we can compute:
Verification: This is exactly the same formula as in Problem 1.2!
Key Observation:
- Eve only needs to observe two transcripts, without "rewinding" or "hacking"
- Since Peggy reuses , the in both transcripts is the same
- Eve can extract using exactly the same algebraic method as in Problem 1.2
Practical Calculation Example: Assume , , , , .
where (because , )
Question (b): Difference Between Two Scenarios
Scenario A: Extractor Forces Reuse (Soundness Proof)
Who Controls Reuse:
- Extractor controls: The extractor forces the prover to use the same commitment (thus the same ) through "rewinding" techniques
- This is a theoretical thought experiment used to prove Special Soundness
Why It's a Feature:
- Theoretical Proof Tool: Rewinding is a tool for formal proofs, not a real attack
- Proves Security: By proving "if a prover can pass the rewinding test, then the secret can be extracted", we prove the security of the protocol
- Does Not Rely on Implementation Errors: This is part of the protocol design and does not rely on implementation errors
Scenario B: Prover Accidentally Reuses (Real-World Attack)
Who Controls Reuse:
- Prover controls: The prover accidentally reuses the same due to implementation errors (laziness, random number generator failure, etc.)
- This is an error in real-world implementation
Why It's a Fatal Bug:
- Real Attack: An attacker can observe two transcripts and directly extract the secret
- No Special Ability Needed: The attacker does not need "rewinding" ability, only needs to observe communication
- Complete Security Breach: The secret key is completely leaked, and the security of the protocol is completely broken
Comparison Summary:
| Feature | Scenario A (Extractor Forces Reuse) | Scenario B (Prover Accidentally Reuses) |
|---|---|---|
| Controller | Extractor (theoretical entity) | Prover (real implementation) |
| Purpose | Prove protocol security | Real attack |
| Nature | Theoretical tool (feature) | Implementation error (fatal bug) |
| Attacker Ability | Needs "rewinding" ability | Only needs to observe communication |
| Result | Proves Special Soundness | Complete security breach |
Key Lessons:
- Nonce reuse is fatal: In real-world implementation, we must ensure that each proof uses a new random number
- Importance of random number generator: Must use a cryptographically secure random number generator
- Importance of implementation security: Even if the protocol design is secure, implementation errors can lead to complete security breaches
Summary
Key Knowledge Points
- Importance of Soundness: The protocol must ensure that provers without the secret cannot pass verification
- Importance of Challenge Randomness: Soundness depends on the randomness and unpredictability of challenges
- Special Soundness: Through rewinding techniques, we can prove knowledge soundness
- Danger of Nonce Reuse: In real-world implementation, reusing random numbers leads to secret leakage
Practical Considerations
- Use cryptographically secure random number generators: Ensure each proof uses a new random number
- Verify challenge randomness: The verifier must use truly random challenges
- Implementation security: Even if the protocol design is secure, implementation errors can lead to security breaches
Protocol Design Principles
- Completeness: Honest provers should be able to pass verification
- Soundness: Provers without the secret should be rejected
- Zero-Knowledge: The verifier should not obtain information about the secret
- Knowledge Extraction: Provers who can pass verification should have extractable knowledge (Special Soundness)
Problem 2: Secure Voting Protocol
Problem Background and Core Challenges
Problem 2 designs a secure electronic voting system based on the ElGamal encryption scheme. The protocol needs to satisfy:
- Vote Confidentiality: No one can know the content of individual votes
- Vote Validity: Each vote must be 0 or 1
- Correct Vote Counting: Can correctly count the total votes
- Verifiability: Use zero-knowledge proofs to ensure vote validity
Basic Structure of ElGamal Voting Protocol
Public Parameters:
- Group : A cyclic group of prime order with generator
Keys:
- Private Key (Tally Center):
- Public Key:
Valid Vote:
Vote Encryption:
- Voter selects random
- Computes ciphertext , where:
Problem 2.1: Homomorphic Aggregation
Problem Description
Scenario: There are voters who produce individual ciphertexts . Each ciphertext is defined as .
Task: Define an aggregated ciphertext that represents the encryption of the sum of votes .
Requirement: Show the mathematical derivation.
In-Depth Analysis
Multiplicative Homomorphism of ElGamal
Homomorphic Property of ElGamal Encryption:
- Given two ciphertexts and
- If encrypts and encrypts
- Then encrypts (in the exponent)
Key Observation:
- ElGamal's plaintext space is group
- If , then
- Ciphertext actually encrypts
- The product of multiple ciphertexts yields
Standard Answer
Mathematical Derivation
Encryption of Single Vote: For voter , vote , random number :
Construction of Aggregated Ciphertext:
Perform component-wise multiplication on all ciphertexts:
Compute First Component:
where .
Compute Second Component:
Aggregated Ciphertext:
Verification: The aggregated ciphertext has the same form as a single vote encryption:
- First component: (where is the sum of random numbers)
- Second component: (where is the total votes)
Therefore, indeed encrypts , i.e., the encryption of the total votes.
Problem 2.2: Decryption
Problem Description
Describe the procedure the tally center uses to recover the integer value from using the secret key . Explain why this decryption method is computationally feasible in the context of an election.
In-Depth Analysis
ElGamal Decryption Process
Standard ElGamal Decryption:
- Given ciphertext
- Using private key (where ) to decrypt:
- Compute shared secret:
- Recover plaintext:
Recovering from :
- If , then
- Can recover by simple comparison:
- If , then
- If , then
For Aggregated Ciphertext:
- After decryption, we get
- Need to recover from
- This requires computing discrete logarithm, but has a small range ()
Standard Answer
Decryption Process
Step 1: Compute Shared Secret
Step 2: Recover
Step 3: Compute Discrete Logarithm to Recover
Computational Feasibility Analysis:
-
has a small range:
- , where each
- Therefore
- In elections, is usually a manageable number (e.g., thousands to millions)
-
Brute force search is feasible:
- Since has a small range, we can use brute force search:
- For :
- Compute
- If , then
- For :
- Time complexity: , which is feasible for reasonable values of (e.g., )
- Since has a small range, we can use brute force search:
-
No need for general discrete logarithm algorithms:
- General discrete logarithm algorithms (such as number field sieve) are computationally hard for large prime-order groups
- But since has a small range, we don't need to use these algorithms
- Simple brute force search is sufficient
Summary: This decryption method is computationally feasible in the election context because the total vote count is bounded by the number of voters , and can be recovered using simple brute force search in polynomial time.
Problem 2.3: Zero-Knowledge Proof (Sigma Protocol)
Problem Description
A malicious voter might attempt to encrypt a value other than 0 or 1 (e.g., ) to manipulate the outcome. To prevent this, every voter must provide a zero-knowledge proof that their ciphertext encrypts either 0 or 1, without revealing which one.
Design a Sigma protocol (an interactive 3-move protocol) for this purpose.
Hint: Formulate this as an OR-proof showing that is a Diffie-Hellman tuple OR is a Diffie-Hellman tuple.
In-Depth Analysis
Diffie-Hellman Tuple
Definition of Diffie-Hellman Tuple:
- A quadruple is a Diffie-Hellman tuple if there exists such that and
- Equivalently,
In the Voting Protocol:
- Ciphertext
- If , then , so is a Diffie-Hellman tuple
- If , then , so , thus is a Diffie-Hellman tuple
OR Proof
Goal of OR Proof:
- The prover wants to prove: knows such that is a Diffie-Hellman tuple, OR knows such that is a Diffie-Hellman tuple
- But does not reveal which one
Standard Answer
Sigma Protocol Design
Protocol Setup:
- Public input:
- Prover's secret: (such that )
- Prover's goal: Prove , i.e.:
- Case 1: , then is a Diffie-Hellman tuple
- Case 2: , then is a Diffie-Hellman tuple
Protocol Steps:
Step 1: Commit
The prover needs to generate commitments for both cases:
For the true case (assuming , i.e., is a Diffie-Hellman tuple):
- The prover knows such that and
- The prover selects random
- Computes commitments: ,
- Sends to the verifier
For the simulated case ( case):
- The prover does not know such that and
- The prover selects random and random challenge
- Computes simulated response:
- Computes simulated commitment: ,
- Sends to the verifier
Step 2: Challenge
The verifier selects random challenge and sends it to the prover.
Step 3: Response
The prover needs to distribute the challenge:
For the true case ():
- The prover sets
- Computes response:
- Sends to the verifier
For the simulated case ():
- If , then the prover knows such that and
- Similarly, the prover will generate a real proof for the case and a simulated proof for the case
Step 4: Verify
The verifier checks:
-
Challenge distribution:
-
For case 0 ( is a Diffie-Hellman tuple):
-
For case 1 ( is a Diffie-Hellman tuple):
If all checks pass, the verifier accepts the proof.
Protocol Summary:
Complete Protocol Flow:
-
P → V: (commitments for both cases)
-
V → P: (random challenge)
-
P → V: (challenge distribution and responses)
-
V verifies:
- and
- and
Security:
- Completeness: If , an honest prover can always pass verification
- Soundness: If , the prover cannot pass verification (because neither case holds)
- Zero-Knowledge: The verifier cannot know whether is 0 or 1 (because both cases provide valid proofs)
Problem 2.4: Non-Interactive Proof
Problem Description
Apply the Fiat-Shamir heuristic to the protocol designed in Question 2.3 to make it non-interactive. Specify how the challenge is computed.
In-Depth Analysis
Fiat-Shamir Heuristic
Fiat-Shamir Heuristic:
- Converts interactive zero-knowledge proofs into non-interactive zero-knowledge proofs
- Core idea: Use a hash function instead of the verifier's random challenge
- Challenge is computed as: , where is a hash function (in the random oracle model)
Advantages:
- No interaction needed, the prover can generate the proof independently
- The proof can be publicly verified
- Suitable for blockchain and other scenarios
Security:
- Under the random oracle model, the security of non-interactive proofs is equivalent to interactive proofs
Standard Answer
Applying Fiat-Shamir Heuristic
Modified Non-Interactive Protocol:
Step 1: Commit (same as interactive protocol)
The prover generates commitments .
Step 2: Compute Challenge (using Fiat-Shamir)
The prover computes the challenge:
where is a cryptographic hash function (e.g., SHA-256), modeled in the random oracle model.
Step 3: Response (same as interactive protocol)
The prover computes responses , where .
Step 4: Verify (same as interactive protocol)
The verifier:
- Recomputes the challenge:
- Checks
- Performs the same verification checks as the interactive protocol
Complete Non-Interactive Proof:
The prover outputs:
The verifier verifies:
- Computes
- Checks
- Checks and
- Checks and
Key Points:
-
Challenge computation:
- The challenge is the output of the hash function, depending on all public inputs and commitments
- This ensures the prover cannot "choose" the challenge (because commitments are already fixed)
-
Random oracle model:
- The hash function is modeled in the random oracle model
- This ensures the randomness and unpredictability of the challenge
-
Non-interactivity:
- The prover can independently generate a complete proof without interacting with the verifier
- The proof can be publicly verified, anyone can verify the validity of the proof
Practical Applications:
- In electronic voting systems, voters can independently generate votes and proofs
- Proofs can be stored on the blockchain for anyone to verify
- No online verifier needed, improving system scalability
Summary
Key Knowledge Points
- ElGamal Homomorphic Encryption: Supports multiplication operations on ciphertexts, enabling vote aggregation
- Homomorphic Aggregation: Through component-wise multiplication of ciphertexts, we can compute the encryption of total votes
- Small-Range Discrete Logarithm: When the value range is small, brute force search can be used
- OR Proof: Used to prove that vote values are in the allowed range without revealing the specific value
- Fiat-Shamir Heuristic: Converts interactive proofs into non-interactive proofs
Practical Considerations
- Vote Validity Verification: Must use zero-knowledge proofs to ensure each vote is 0 or 1
- Random Number Generation: Voters must use cryptographically secure random number generators
- Key Management: The tally center's private key must be securely stored
- Verifiability: Non-interactive proofs enable public verification of votes
Problem 3: BLS Digital Signature
Problem Background and Core Challenges
Problem 3 introduces the BLS (Boneh-Lynn-Shacham) digital signature scheme, a digital signature scheme based on bilinear pairings. BLS signatures have advantages such as short signatures and aggregability, and are widely used in blockchain and distributed systems.
Basic Concepts of Bilinear Pairing
Bilinear Pairing:
- Let , , and be three cyclic groups of prime order
- Let be a generator of and be a generator of
- A bilinear pairing is an efficiently computable function
Properties of Bilinear Pairing:
-
Bilinearity: For all , , and :
-
Non-degeneracy:
Computational co-Diffie-Hellman (co-CDH) Problem
co-CDH Problem:
- Given: Tuple and , where are unknown random numbers
- Problem: Compute
- Assumption: For appropriate groups, the co-CDH problem is computationally intractable
BLS Signature Scheme
Setup:
- Groups , , and pairing are public parameters
- Let be a cryptographic hash function (modeled in the random oracle model)
KeyGen:
- Select random secret
- Private Key (Signing Key):
- Public Key (Verification Key):
Sign(sk, m):
- To sign message , compute
- Output signature:
**Verify(pk, m, \sigma)$:
- Compute
- Accept if and only if:
Problem 3.1: Correctness
Problem Description
Prove that a validly generated BLS signature will always pass the verification equation. Use the bilinearity property of pairing .
In-Depth Analysis
Key to Correctness Proof
What needs to be proved:
- If signature is correctly generated using private key for message
- Then the verification equation should hold
Using Bilinearity Property:
- The bilinearity property allows us to "move" exponents inside the pairing
- This is the key to the proof
Standard Answer
Correctness Proof
Given:
- Private key:
- Public key:
- Message:
- Signature: , where
Verification Equation:
Proof Process:
Left Side:
Using Bilinearity Property: According to the bilinearity property , we have:
Right Side:
Using Bilinearity Property Again:
Therefore:
Conclusion: A validly generated BLS signature will always pass the verification equation. ✓
Problem 3.2: Security Reduction
Problem Description
We want to prove that if the co-CDH assumption holds, then BLS is secure against Existential Forgery under Chosen Message Attacks (EUF-CMA) in the Random Oracle Model.
Let be an adversary that makes at most queries to the hash oracle and queries to the signing oracle, and produces a valid forgery with non-negligible probability.
Construct a simulator that uses to solve the co-CDH problem.
Hint: receives a co-CDH challenge and . should set the public key .
Question (a): How should program the Random Oracle so that it can answer signing queries for some messages (where it knows the discrete log of ) but embed the challenge term into the hash of the target message ?
Question (b): How does extract the solution from 's forgery?
In-Depth Analysis
EUF-CMA Security
Existential Forgery:
- The adversary can forge a signature for some message (does not need to be a specific message)
- But the adversary cannot choose which message to forge (during the query phase)
Chosen Message Attack:
- The adversary can query the signing oracle to obtain signatures for arbitrary messages
- This simulates real-world scenarios where the adversary can observe legitimate signatures
Security Reduction Approach
Reduction Goal:
- Assume there exists an adversary that can forge BLS signatures with non-negligible probability
- Construct algorithm that uses to solve the co-CDH problem
- If succeeds, then can solve the co-CDH problem
- This contradicts the hardness of the co-CDH problem
- Therefore, BLS is EUF-CMA secure
Key Challenges:
- Simulate Signing Oracle: needs to be able to answer 's signing queries, but does not know the private key
- Embed Challenge: needs to embed the co-CDH challenge into the hash of some message
- Extract Solution: Extract the solution to the co-CDH problem from 's forgery
Standard Answer
Question (a): Programming the Random Oracle
's Strategy:
Step 1: Initialization
- receives co-CDH challenge: and
- sets public key: (this is part of the challenge)
- maintains a hash table to store values of
Step 2: Programming Random Oracle
For each hash query ():
-
If is a message for signing query ( needs to be able to generate signatures):
- randomly selects
- sets: (where is the generator of , from the challenge)
- stores in table
- When queries signature for , computes:
- Key: has (from the challenge), so can compute
-
If is the target message ( hopes will forge this message):
- sets:
- stores in table ( indicates unknown discrete logarithm)
- Key Observation: does not know the discrete logarithm of , but this is part of the challenge
Verification of Signature Validity:
Therefore, , signature is valid! ✓
For Target Message :
- sets: (this is part of the challenge)
- does not know the discrete logarithm of , so cannot generate a signature for
- This forces to forge the signature for
Question (b): Extracting Solution from Forgery
's Forgery:
- outputs forgery , where is a message that has not queried for signature
- Forgery satisfies:
Extracts Solution:
Step 1: Verify Forgery Validity
Step 2: Use Bilinearity Property
Step 3: Extract
Since , and the pairing is non-degenerate, we have:
Verification:
Therefore, is the solution to the co-CDH problem.
's Output:
- outputs as the solution to the co-CDH problem
Success Probability:
- If succeeds with probability , and is the target message chosen by (probability at least ), then solves the co-CDH problem with probability at least
- If is non-negligible, then is also non-negligible (since is polynomial)
Conclusion:
- If there exists an adversary that can forge BLS signatures with non-negligible probability, then there exists an algorithm that can solve the co-CDH problem with non-negligible probability
- This contradicts the hardness of the co-CDH problem
- Therefore, BLS is EUF-CMA secure under the co-CDH assumption and the random oracle model
Problem 3.3: Signature Aggregation
Problem Description
One of the most powerful features of BLS is non-interactive aggregation. Suppose we have users with public keys . Each user signs a distinct message to produce signature .
The aggregate signature is computed as (computed in group ).
Write down the verification equation for the aggregate signature given the set of public keys and messages . Prove that the verification equation holds if all individual signatures are valid.
In-Depth Analysis
Advantages of Signature Aggregation
Non-Interactive Aggregation:
- Multiple signatures can be aggregated into one signature without interaction between signers
- The aggregate signature has the same size as a single signature
- Can efficiently batch verify multiple signatures
Application Scenarios:
- Multi-signatures in blockchain
- Batch verification in distributed systems
- Reduce storage and transmission overhead
Standard Answer
Verification Equation for Aggregate Signature
Given:
- users' public keys: , where (user 's private key is )
- messages:
- Aggregate signature: , where
Verification Equation:
Equivalent Form (using bilinearity property of pairing):
Correctness Proof
Assumption: All individual signatures are valid, i.e., for each :
Proving the Verification Equation for Aggregate Signature:
Left Side:
Using Bilinearity Property: Since the pairing is bilinear, for the product of group elements, we have:
Using Validity of Individual Signatures:
Right Side:
Therefore:
Conclusion: If all individual signatures are valid, then the verification equation for the aggregate signature holds. ✓
Detailed Derivation (using bilinearity property):
For each , since and :
Therefore:
Problem 3.4: Rogue Public Key Attack
Problem Description
Consider the special case where multiple users sign the same message . The verification equation simplifies significantly.
Question 1: Write down the simplified verification equation for an aggregate signature on a single message verified against public keys .
Question 2: Suppose Alice has a public key . An adversary wants to forge an aggregate signature that appears to come from both Alice and the Adversary on a message . The adversary can choose his own public key arbitrarily.
Show how the adversary can choose a specific (as a function of ) and generate a valid aggregate signature for the set of keys on message , without knowing Alice's secret key.
Question 3: Briefly propose a simple countermeasure to prevent this attack.
In-Depth Analysis
Same Message Case
When All Messages Are the Same:
- The verification equation can be simplified
Rogue Public Key Attack
Attack Scenario:
- The adversary can freely choose their own public key
- The adversary wants to forge an aggregate signature that appears to come from Alice and the adversary
- The adversary does not know Alice's private key
Attack Method:
- The adversary can choose to make the verification equation easier to satisfy
- By carefully choosing , the adversary can "cancel out" the part that requires Alice's signature
Standard Answer
Question 1: Simplified Verification Equation
When All Messages Are the Same ():
Let .
Aggregate Signature:
Simplified Verification Equation:
Proof:
Left Side:
Right Side:
Therefore, the verification equation holds. ✓
Simplified Form:
Question 2: Rogue Public Key Attack
Adversary's Goal:
- Forge aggregate signature that appears to come from Alice (public key ) and the adversary (public key )
- For message
- The adversary does not know Alice's private key (where )
Adversary's Strategy:
Step 1: Choose Rogue Public Key
The adversary computes:
Step 2: Generate Aggregate Signature
The adversary computes:
(where )
Step 3: Verify Attack Success
Verification equation:
Therefore, , verification passes! ✓
Attack Success:
- The adversary successfully forged the aggregate signature
- The verifier will think this signature comes from Alice and the adversary
- But the adversary actually does not have Alice's signature, nor their own valid signature (because corresponds to private key , which the adversary does not know)
Key Observation:
- By choosing , the adversary makes
- Therefore, the verification equation becomes
- The adversary can simply set to satisfy the verification equation
Question 3: Countermeasure
Simple Countermeasure: Proof of Knowledge
Method: Require each user to provide a zero-knowledge proof when registering their public key, proving they know the discrete logarithm of the corresponding private key.
Specific Implementation:
-
Key Registration Phase:
- User generates key pair:
- User generates zero-knowledge proof proving knowledge of such that
- User submits for registration
-
Verify Registration:
- The verifier verifies the validity of
- Only public keys that pass verification are accepted
-
Prevent Attack:
- The adversary cannot generate a valid proof of knowledge for
- Because the adversary does not know (the adversary does not know )
- Therefore, cannot pass registration
Other Countermeasures:
-
Message Binding: Require each signer to include their own public key when signing, i.e., sign instead of
-
Public Key Aggregation: Use more complex aggregation schemes that require all public keys to be known before aggregation
-
Signer List: Maintain a trusted list of public keys, only accept signatures from public keys in the list
Simplest Countermeasure:
- Require Proof of Knowledge: Each public key must be accompanied by a zero-knowledge proof proving the registrant knows the corresponding private key
- This prevents adversaries from registering maliciously constructed public keys (such as )
Summary
Key Knowledge Points
- Bilinear Pairing: The foundation of BLS signatures, enabling efficient signature verification and aggregation
- co-CDH Problem: The fundamental assumption for BLS security
- Signature Aggregation: A powerful feature of BLS, allowing multiple signatures to be aggregated into one
- Rogue Public Key Attack: When messages are the same, adversaries can forge aggregate signatures by choosing rogue public keys
- Countermeasure: Use proof of knowledge to prevent rogue public key registration
Practical Considerations
- Public Key Registration: Must require proof of knowledge to prevent rogue public key attacks
- Message Uniqueness: If possible, avoid multiple users signing the same message
- Key Management: Private keys must be securely stored
- Batch Verification: Aggregate signatures can efficiently batch verify multiple signatures
Cryptography Final Exam Solutions
Problem 1: Concept Explanation
1.1 Hash Function
Knowledge Point Analysis
Basic Concept of Hash Functions:
- A hash function maps inputs of arbitrary length to fixed-length outputs
- It is a fundamental tool in cryptography, used for data integrity verification, digital signatures, password storage, etc.
Three Basic Security Properties:
- Preimage Resistance / One-Wayness: Given a hash value , finding such that is computationally infeasible
- Second Preimage Resistance: Given , finding such that is computationally infeasible
- Collision Resistance: Finding any such that is computationally infeasible
Relationships Between Properties:
- Collision Resistance Second Preimage Resistance Preimage Resistance
- If a hash function is collision-resistant, then it is also second preimage-resistant and preimage-resistant
Standard Answer Format
Form: A hash function is a deterministic function that maps binary strings of arbitrary length to fixed-length binary strings of length .
Background: Hash functions are fundamental tools in cryptography, widely used in:
- Data integrity verification (e.g., file checksums)
- Digital signatures (e.g., RSA-FDH, BLS signatures)
- Password storage (e.g., bcrypt, scrypt)
- Blockchain (e.g., Bitcoin's Merkle tree)
Scenario: In practical applications, hash functions are used for:
- File Integrity: Computing hash values of files to detect tampering
- Password Storage: Storing hash values of passwords instead of plaintext passwords
- Digital Signatures: Mapping messages to fixed length before signing
- Commitment Schemes: Using hash functions to implement commitments
Benefit:
- High Efficiency: Fast computation, suitable for processing large amounts of data
- Fixed Output Length: Regardless of input length, output is always fixed length
- One-Way Property: Difficult to recover original input from hash value
- Avalanche Effect: Small changes in input cause large changes in output
1.2 1-n OT (1-out-of-n Oblivious Transfer)
Knowledge Point Analysis
Basic Concept of 1-n OT:
- 1-out-of-n OT is a generalization of 1-out-of-2 OT
- The sender has messages
- The receiver selects an index
- After the protocol, the receiver obtains but does not know other messages, and the sender does not know
Security Requirements:
- Receiver's Privacy: The sender cannot know which message the receiver selected
- Sender's Privacy: The receiver cannot obtain unselected messages
Standard Answer Format
Form: 1-out-of-n Oblivious Transfer (1-n OT) is a cryptographic protocol that allows a receiver to select and obtain one message from the sender's messages, while the sender does not know which message the receiver selected.
Background: 1-n OT is a generalization of 1-out-of-2 OT, applied in the following scenarios:
- Privacy-preserving data queries
- Secure multi-party computation
- Electronic voting systems
- Privacy-preserving machine learning
Scenario: Typical application scenarios:
- Privacy Query: A user wants to query a record from a database without letting the database know which record is queried
- Privacy Auction: A bidder wants to obtain information about an item without revealing their interest
- Privacy Data Sharing: One party wants to obtain data from another party without revealing their choice
Benefit:
- Privacy Protection: Protects the receiver's choice privacy and the sender's message privacy
- Flexibility: Supports selection from multiple options
- Security: Based on cryptographic assumptions, provides formal security guarantees
1.3 IBE (Identity-Based Encryption)
Knowledge Point Analysis
Basic Concept of IBE:
- IBE is a public-key encryption scheme where the public key can be any string (e.g., email address, ID number)
- The private key is generated by a Key Generation Center (PKG) based on identity and master key
- No public key certificates are needed, simplifying key management
Components of IBE:
- Setup: Generate system parameters and master key
- Extract: Generate private key based on identity
- Encrypt: Encrypt messages using identity
- Decrypt: Decrypt messages using private key
Security:
- IBE security is based on bilinear pairings and hard problems (e.g., BDH problem)
- Need to address the key escrow problem (PKG knows all private keys)
Standard Answer Format
Form: Identity-Based Encryption (IBE) is a public-key encryption scheme where the public key can be any string (identity), and the private key is generated by a Key Generation Center based on identity and master key.
Background: IBE was proposed by Boneh and Franklin in 2001, solving the complexity of public key certificate management in traditional public-key encryption:
- Traditional schemes require Public Key Infrastructure (PKI) and certificates
- IBE uses identity (e.g., email address) as public key, no certificates needed
Scenario: Typical application scenarios:
- Email Encryption: Using recipient's email address as public key to encrypt emails
- Internet of Things: Using device ID as public key, simplifying key management
- Cloud Storage: Using user identity to encrypt data stored in the cloud
Benefit:
- Simplified Key Management: No public key certificates needed, identity is the public key
- Flexibility: Can use any string as public key
- Scalability: Suitable for large-scale deployment
- Forward Security: Can revoke identity, making old ciphertexts undecryptable
1.4 MPC (Multi-Party Computation)
Knowledge Point Analysis
Basic Concept of MPC:
- MPC allows multiple parties to jointly compute a function without revealing their private inputs
- The computation result is correct, but no party can obtain other parties' private inputs
Security Models of MPC:
- Semi-Honest Model: Parties follow the protocol but try to infer other parties' inputs from protocol execution
- Malicious Model: Parties may not follow the protocol and try to break security
Implementation Methods of MPC:
- Secret Sharing
- Homomorphic Encryption
- Garbled Circuits
- Oblivious Transfer
Standard Answer Format
Form: Secure Multi-Party Computation (MPC) is a cryptographic protocol that allows multiple parties to jointly compute a function without revealing their private inputs, and obtain correct computation results.
Background: MPC was proposed by Yao in 1982, solving the following problems:
- Multiple parties need to jointly compute but do not want to reveal their private data
- Application scenarios include privacy-preserving data analysis, federated machine learning, privacy auctions, etc.
Scenario: Typical application scenarios:
- Privacy-Preserving Data Analysis: Multiple hospitals want to jointly analyze medical data without revealing their patient data
- Federated Machine Learning: Multiple companies want to jointly train models without revealing their training data
- Privacy Auction: Multiple bidders want to determine the winner without revealing their bid prices
- Electronic Voting: Multiple voters want to count voting results without revealing their voting content
Benefit:
- Privacy Protection: Protects each party's private inputs
- Correctness: Guarantees correctness of computation results
- Flexibility: Can compute any function
- Practicality: With the development of cryptography, MPC can now be applied in practical scenarios
Problem 2: Scheme Design
Problem Description
Design a secure file transfer scheme that satisfies the following requirements:
- 10GB File [Large]: Need to handle large files
- Payment (No one knows): Payment information is confidential, no one knows the payment amount
- Integrity: File integrity
- Only Bob can check the content: Only Bob can check the file content
Requirements: Select tools, explain the process, explain how each requirement is satisfied.
Knowledge Point Analysis
Core Challenges
-
Large File Processing:
- 10GB file is too large to encrypt and transfer directly
- Need to use stream encryption or block encryption
- Consider efficiency issues
-
Payment Confidentiality:
- Payment amount must be confidential
- Can use homomorphic encryption or commitment schemes
- Need to support payment verification without revealing amount
-
Integrity:
- Need to detect if file has been tampered with
- Can use hash functions or MAC
- Need to support integrity verification for large files
-
Access Control:
- Only Bob can decrypt and check file content
- Need to use encryption schemes
- Consider key distribution issues
Tool Selection
- Symmetric Encryption: For encrypting large files (e.g., AES-256-CTR)
- Public-Key Encryption: For encrypting symmetric keys (e.g., RSA-OAEP or ElGamal)
- Hash Function: For integrity verification (e.g., SHA-256)
- MAC: For authentication (e.g., HMAC-SHA256)
- Commitment Scheme: For payment confidentiality (e.g., Pedersen commitment)
Standard Answer
Tool Selection
1. File Encryption:
- Symmetric Encryption: AES-256-CTR (stream encryption, suitable for large files)
- Key Encryption: RSA-OAEP or ElGamal (for encrypting symmetric keys)
2. Integrity Verification:
- Hash Function: SHA-256 (for computing file hash value)
- MAC: HMAC-SHA256 (for authentication)
3. Payment Confidentiality:
- Commitment Scheme: Pedersen commitment (for hiding payment amount)
Scheme Design
Phase 1: Initialization
-
Bob Generates Key Pair:
- Bob generates RSA key pair:
- Bob sends public key to Alice
-
Alice Generates File Key:
- Alice randomly generates file encryption key:
- Alice encrypts file using :
Phase 2: Payment Processing
-
Alice Generates Payment Commitment:
- Alice selects payment amount and random number
- Alice computes payment commitment: (Pedersen commitment)
- Alice sends to Bob (Bob does not know )
-
Payment Verification (optional):
- If payment verification is needed, Alice can open the commitment, but only under specific conditions
- Or use zero-knowledge proof to prove payment amount is within reasonable range
Phase 3: File Transfer
-
Alice Encrypts File Key:
- Alice encrypts file key using Bob's public key:
-
Alice Computes File Hash:
- Alice computes file hash value:
-
Alice Generates MAC:
- Alice uses shared key (or derived from ) to compute MAC:
-
Alice Sends to Bob:
- Alice sends: to Bob
Phase 4: Bob Receives and Verifies
-
Bob Decrypts File Key:
- Bob uses private key to decrypt:
-
Bob Decrypts File:
- Bob uses to decrypt file:
-
Bob Verifies Integrity:
- Bob computes file hash:
- Bob checks , if equal, file is intact
-
Bob Verifies MAC:
- Bob computes MAC:
- Bob checks , if equal, data has not been tampered with
How Each Requirement is Satisfied
1. 10GB File [Large]:
- ✅ Use AES-CTR Stream Encryption: Can encrypt block by block, no need to load entire file into memory
- ✅ Block Transfer: Can divide file into multiple blocks, encrypt and transfer separately
- ✅ High Efficiency: Symmetric encryption is fast, suitable for large files
2. Payment (No one knows):
- ✅ Use Pedersen Commitment: hides payment amount
- ✅ Random Number : Ensures commitments of the same amount look different
- ✅ Only Alice knows and : Bob and others cannot infer from
3. Integrity:
- ✅ SHA-256 Hash: Computes file hash value to detect any tampering
- ✅ HMAC: Provides authentication, prevents data modification
- ✅ Verification Mechanism: Bob can verify if file is intact
4. Only Bob can check the content:
- ✅ RSA Encrypt File Key: Only Bob's private key can decrypt to obtain
- ✅ AES Encrypt File: Only Bob who has can decrypt the file
- ✅ Access Control: Others cannot obtain file content
Problem 3: ElGamal Voting System
3.1 Computation Flow: Given x, Compute y, C1, C2, r
Problem Construction
Problem: In the ElGamal encryption scheme, given:
- Group parameters: , ( is a generator of )
- Private key:
- Message:
- Random number:
Please compute:
- Public key
- Ciphertext
Knowledge Point Analysis
ElGamal Encryption Scheme:
- Key Generation: Private key , public key
- Encryption: Select random , compute ,
- Decryption: Compute
Standard Answer
Step 1: Compute Public Key
Compute :
Therefore, .
Step 2: Compute Ciphertext
Step 3: Compute Ciphertext
First compute :
Compute :
Therefore, .
Then compute :
Result Summary:
- Public key:
- Ciphertext:
- Random number:
Verification (decryption):
Compute :
Compute :
- Using extended Euclidean algorithm: (because )
Therefore:
Verification successful: ✓
3.2 Voting Homomorphic Encryption: , , Draw the Flow
Problem Construction
Problem: Design an ElGamal homomorphic encryption-based voting system, where:
- Vote value (0 = against, 1 = support)
- Use homomorphic encryption to encrypt votes: represents encryption of
- Require drawing the complete voting and tallying flow
Knowledge Point Analysis
ElGamal Homomorphic Encryption:
- If encrypts , encrypts
- Then encrypts
- This is multiplicative homomorphism (addition in exponent)
Voting Flow:
- Setup phase: Generate key pair
- Voting phase: Each voter encrypts vote
- Aggregation phase: Aggregate all ciphertexts
- Tallying phase: Decrypt aggregated result
Standard Answer
Flow Diagram:
┌─────────────────────────────────────────────────────────────┐
│ Voting System Flow │
└─────────────────────────────────────────────────────────────┘
[Phase 1: System Setup]
┌─────────────┐
│ Tally Center│
│ (Tally) │
└─────────────┘
│
│ 1. Generate key pair
│ - Select private key x ∈ Zq
│ - Compute public key h = g^x
│
▼
┌─────────────┐
│ Public Params│
│ (G, q, g, h)│
└─────────────┘
│
│ 2. Broadcast public key
│
▼
[Phase 2: Voting Phase]
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Voter 1 │ │ Voter 2 │ │ Voter N │
│ (Voter 1) │ │ (Voter 2) │ ... │ (Voter N) │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
│ 3. Select vote │ 3. Select vote │ 3. Select vote
│ b₁ ∈ {0,1} │ b₂ ∈ {0,1} │ bₙ ∈ {0,1}
│ │ │
│ 4. Encrypt vote │ 4. Encrypt vote │ 4. Encrypt vote
│ - Select r₁ │ - Select r₂ │ - Select rₙ
│ - C₁ = (g^r₁, │ - C₂ = (g^r₂, │ - Cₙ = (g^rₙ,
│ h^r₁·g^b₁) │ h^r₂·g^b₂) │ h^rₙ·g^bₙ)
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────┐
│ Ballot Box (All Ciphertexts) │
│ C₁, C₂, ..., Cₙ │
└─────────────────────────────────────────────────────────┘
[Phase 3: Aggregation Phase]
┌─────────────┐
│ Tally Center│
└─────────────┘
│
│ 5. Aggregate ciphertexts
│ C_agg = (C₁ · C₂ · ... · Cₙ)
│ = (g^R_total, h^R_total · g^V_total)
│ where R_total = Σrᵢ, V_total = Σbᵢ
│
▼
[Phase 4: Tallying Phase]
┌─────────────┐
│ Tally Center│
│ (using sk x)│
└─────────────┘
│
│ 6. Decrypt aggregated result
│ - Compute s = (g^R_total)^x = h^R_total
│ - Compute g^V_total = (h^R_total·g^V_total) / h^R_total
│
│ 7. Compute discrete logarithm
│ - V_total = log_g(g^V_total)
│ - Use brute force search (because V_total ≤ N)
│
▼
┌─────────────┐
│ Voting Result│
│ V_total │
│ (Total Yes) │
└─────────────┘
Detailed Step Description:
Step 1: System Setup
- Tally center selects group (prime order ), generator
- Tally center selects private key
- Tally center computes public key
- Public parameters:
Step 2: Vote Encryption For each voter :
- Voter selects vote
- Voter selects random number
- Voter computes ciphertext:
- Voter submits ciphertext
Step 3: Ciphertext Aggregation
- Tally center computes aggregated ciphertext:
- Where ,
Step 4: Decryption and Tallying
- Tally center uses private key to decrypt:
- Compute
- Compute
- Compute discrete logarithm:
- Since , can use brute force search
3.3 Voting Computation: Provide Numbers
Problem Construction
Problem: In the ElGamal voting system, given:
- Group parameters: , , (order of is )
- Tally center private key:
- Votes from 3 voters:
- Voter 1: ,
- Voter 2: ,
- Voter 3: ,
Please compute:
- Public key
- Each voter's ciphertext
- Aggregated ciphertext
- Total votes
Standard Answer
Step 1: Compute Public Key
Step 2: Compute Each Voter's Ciphertext
Voter 1 (, ):
Voter 2 (, ):
-
-
- Therefore
Voter 3 (, ):
-
- From previous calculation:
-
- Therefore
Step 3: Compute Aggregated Ciphertext
Step 4: Decrypt and Compute Total Votes
Decryption:
Compute :
- Using extended Euclidean algorithm: (because )
Therefore:
Compute Discrete Logarithm:
- Need to find such that
- Try: , , ✓
- Therefore
Verification:
- ✓
Result Summary:
- Public key:
- Voter 1 ciphertext:
- Voter 2 ciphertext:
- Voter 3 ciphertext:
- Aggregated ciphertext:
- Total votes: (2 yes votes, 1 no vote)
3.4 If Someone Lies: Use ZK Proof that Their is Not 0,1
Problem Construction
Problem: In the ElGamal voting system, malicious voters may try to encrypt values other than 0 or 1 (e.g., ) to manipulate results. Design a zero-knowledge proof protocol that proves a voter's ciphertext encrypts 0 or 1, without revealing which one. If a voter lies (), the proof should fail.
Knowledge Point Analysis
OR Proof:
- Need to prove: is a Diffie-Hellman tuple OR is a Diffie-Hellman tuple
- If , then , so is a DH tuple
- If , then , so , therefore is a DH tuple
Standard Answer
Protocol Design:
Public Input:
Prover's Secret: (such that )
Prover's Goal: Prove , i.e.:
- Case 1: , then is a Diffie-Hellman tuple
- Case 2: , then is a Diffie-Hellman tuple
Protocol Steps:
Step 1: Commit
The prover needs to generate commitments for both cases:
For the real case (assume , i.e., is a Diffie-Hellman tuple):
- Prover knows such that and
- Prover selects random number
- Compute commitment: ,
- Send to verifier
For the simulated case ( case):
- Prover does not know such that and
- Prover selects random number and random challenge
- Compute simulated response:
- Compute simulated commitment: ,
- Send to verifier
Step 2: Challenge
Verifier selects random challenge , sends to prover.
Step 3: Response
Prover needs to distribute challenge:
For the real case ():
- Prover sets:
- Compute response:
- Send to verifier
For the simulated case ():
- If , then prover knows such that and
- Similarly, prover will generate real proof for case and simulated proof for case
Step 4: Verify
Verifier checks:
-
Challenge Distribution:
-
For Case 0 ( is a Diffie-Hellman tuple):
-
For Case 1 ( is a Diffie-Hellman tuple):
If all checks pass, verifier accepts the proof.
If Someone Lies ():
- Voter cannot generate real proof for or
- Can only generate two simulated proofs
- But simulated proofs cannot pass verification (because challenge distribution is incorrect)
- Verifier detects invalid proof and rejects vote
Problem 4: Schnorr Signature Insecurity Proof
4.1 Prove Schnorr Signature Insecurity: (R, Z) Inverse Cancellation
Problem Construction
Problem: In a variant of Schnorr signature, if the signature is instead of , where (modular inverse of ), prove that this variant is insecure.
Given standard Schnorr signature:
- Signature generation: , signature is , where
- Verification: Check
Variant signature:
- Signature generation: , , signature is
- Verification: Need to derive verification equation
Knowledge Point Analysis
Standard Form of Schnorr Signature:
- Signature: , where ,
- Verification:
Security Issues of Variant:
- If signature is where , attacker may forge signatures by manipulating
- Key issue: How to recover from , and how to modify verification equation
Standard Answer
Derivation of Variant Signature Verification Equation:
Since , we have .
Standard verification equation:
Substitute :
Raise both sides to the -th power:
That is:
Therefore, the variant's verification equation is:
Attack Method: Inverse Cancellation Attack
Attack Scenario:
- Attacker observes two valid signatures: and
- Both signatures are for different messages and , but use the same random number (i.e., )
Attack Steps:
Step 1: Observe Two Signatures
- Signature 1: , where ,
- Signature 2: , where ,
- Note: is the same, meaning is the same
Step 2: Exploit Inverse Relationship
Since and , we have:
Step 3: Compute Private Key
From the two signatures:
Compute :
If , then:
Since and :
Step 4: Attack Successful
Once the attacker obtains private key , they can forge signatures for any message.
Why the Variant is Insecure:
- Inverse Operation Breaks Security: Using instead of allows attackers to extract private keys by observing multiple signatures
- Nonce Reuse More Easily Exploited: Even if is reused, standard Schnorr signature requires two different challenges to extract private key; but in the variant, the inverse relationship makes attacks easier
- Verification Equation Problem: The product relationship between and in verification equation may be exploited
Conclusion: The variant using where is insecure, because attackers can recover private keys by observing multiple signatures and exploiting the inverse relationship.
4.2 Only Takes Values from , Prove Insecurity
Problem Construction
Problem: In Schnorr signature, if random number is not uniformly selected from the entire , but only from a small set , prove that this variant is insecure.
Given:
- Standard Schnorr signature: , signature is , where
- Variant: only selected from
Knowledge Point Analysis
Importance of Random Number Space:
- In Schnorr signature, must be uniformly selected from the entire
- If 's space is small, attackers can brute force search to recover private key
Small Space Attack:
- If has only 3 possible values, attacker only needs to try 3 times to find the correct
- Once is found, private key can be extracted from signature
Standard Answer
Attack Method: Small Space Brute Force Search
Attack Scenario:
- Attacker knows signer only selects from
- Attacker can query signature oracle to obtain signature for message
Attack Steps:
Step 1: Query Signature
- Attacker queries signature for message , obtains
- Where , ,
Step 2: Brute Force Search
Since , attacker tries all possible values:
For each :
- Compute
- If , then found the used
Step 3: Recover Private Key
Once is found, from signature equation:
Therefore:
Step 4: Attack Successful
After obtaining private key , attacker can forge signatures for any message.
Success Probability Analysis:
Standard Case ( selected from entire ):
- has possible values ( is large, e.g., )
- Attacker needs to try times, success probability is (negligible)
Variant Case ( only selected from ):
- has only 3 possible values
- Attacker only needs to try 3 times, success probability is (after querying enough times)
Computational Complexity:
Standard Case:
- Time complexity: (infeasible, because is large)
- Success probability: Negligible
Variant Case:
- Time complexity: (constant time)
- Success probability: (after one query)
Conclusion:
- If is only selected from , attacker can recover private key in constant time
- Therefore, this variant is insecure
- Key Lesson: Schnorr signature requires to be uniformly selected from the entire , any restriction on 's space breaks security
Problem 5: Zero-Knowledge Proof
5.1 ZK AND Proof (Describe What Type of Proof It Is)
Problem Construction
Problem: Given a diagram of an AND proof (original PPT diagram), describe what type of proof this is and explain how it works.
Knowledge Point Analysis
Basic Concept of AND Proof:
- AND proof is used to prove that prover knows multiple secrets simultaneously
- For example: Prove knowledge of and such that and
Protocol Structure of AND Proof:
- This is a Sigma protocol (3-round interactive protocol)
- Contains: Commit, Challenge, Response
Standard Answer
Proof Type:
This is a Zero-Knowledge AND Proof, used to prove that the prover knows two discrete logarithms simultaneously.
Specifically:
- Prover wants to prove: Know and such that and
- This is a Proof of Knowledge, proving that the prover "possesses" this knowledge
- It is also Zero-Knowledge, verifier cannot obtain information about and
Protocol Description (based on standard AND proof):
Public Input:
Prover's Secret:
Protocol Steps:
-
Commit:
- Prover selects random numbers
- Prover computes: ,
- Prover sends to verifier
-
Challenge:
- Verifier selects random challenge
- Verifier sends to prover
-
Response:
- Prover computes: ,
- Prover sends to verifier
-
Verify:
- Verifier checks:
- If both checks pass, verifier accepts proof
- Verifier checks:
Key Properties:
- AND Property: Must satisfy both relations simultaneously, neither can be missing
- Proof of Knowledge: If prover does not know or , cannot pass verification
- Zero-Knowledge: Verifier cannot obtain information about and from the proof process
5.2 ZK Soundness Proof (Prove AND Proof Satisfies Soundness Property)
Problem Construction
Problem: Prove that the AND proof in zero-knowledge proof satisfies the Soundness property.
Given: Prover wants to prove knowledge of and such that and .
Please prove: If prover does not know or , then verifier rejects the proof with high probability.
Knowledge Point Analysis
Definition of Soundness:
- If prover does not know the secret, verifier rejects proof with high probability
- Formal: , where is a negligible function
Soundness of AND Proof:
- Must know both and to pass verification
- If does not know or , cannot construct valid response
Standard Answer
AND Proof Protocol Review:
Protocol Steps:
- Commit: Prover sends , where , ,
- Challenge: Verifier sends
- Response: Prover sends , where ,
- Verify: Verifier checks and
Soundness Proof:
Proof Idea:
Use proof by contradiction: Assume there exists an attacker that can pass verification with non-negligible probability, even without knowing or . We will prove this contradicts the hardness of the discrete logarithm problem.
Case Analysis:
Case 1: Prover Does Not Know
Assume prover does not know , but knows .
Attacker Strategy:
- Attacker can correctly compute (because knows )
- But cannot correctly compute (because does not know )
Verification Failure Analysis:
- Verifier checks:
- If attacker does not know , cannot compute correct
- Assume attacker guesses , then:
- Verification failure probability: , where is negligible
Case 2: Prover Does Not Know
Similarly, if prover does not know , cannot correctly compute , verification fails.
Case 3: Prover Does Not Know and
If prover knows neither nor , cannot correctly compute and , verification must fail.
Formal Proof:
Assumption: There exists attacker that can pass verification with non-negligible probability , even without knowing or .
Construct Algorithm to Solve Discrete Logarithm Problem:
Given discrete logarithm problem instance: , compute .
Algorithm :
- Set and ( knows )
- Run AND proof protocol as verifier
- If attacker passes verification, extract information from response
Key Observation:
- If can pass verification, then
- That is
- Therefore
- If knows and , can compute:
Problem: does not know (because is sent by attacker)
Use Rewinding Technique:
- runs protocol, obtains , sends challenge , obtains
- rewinds protocol, uses same , but sends different challenge
- If passes verification again, obtains
- From two responses:
- Therefore:
- If , then:
Success Probability:
- If can pass verification with probability
- Then can solve discrete logarithm problem with probability at least
- If is non-negligible, then is also non-negligible
- This contradicts the hardness of discrete logarithm problem
Conclusion:
- If prover does not know or , cannot generate valid AND proof
- Verifier rejects proof with probability , where is a negligible function
- Therefore, AND proof satisfies Soundness property
5.3 ZK OR Proof: Prove Alice Has One of and One of
Problem Construction
Problem: Design a zero-knowledge OR proof that proves Alice has one of the following knowledge:
- Know such that OR know such that
- AND know such that OR know such that
That is: Alice has one discrete logarithm of AND one discrete logarithm of .
Knowledge Point Analysis
Basic Idea of OR Proof:
- OR proof is used to prove knowledge of one of multiple relations
- For unknown relations, use simulated proof
- Use forking technique to distribute challenge
Composite OR Proof:
- This problem needs to prove:
- This can be decomposed as: Generate proof for each OR relation, then combine
Standard Answer
Protocol Design:
Public Input:
Prover's Secret:
- Alice knows such that , where is one AND is one
- Assume Alice knows and (other cases similar)
Protocol Steps:
Step 1: Commit
Alice needs to generate commitments for four relations:
For Real Relations ( and ):
- Alice knows such that
- Alice knows such that
- Alice selects random numbers
- Alice computes: ,
- Alice sends to verifier
For Simulated Relations ( and ):
- Alice does not know and
- Alice selects random numbers and random challenges
- Alice computes simulated responses:
- Alice computes simulated commitments:
- Alice sends to verifier
Step 2: Challenge
Verifier selects random challenge , sends to Alice.
Step 3: Response
Alice needs to distribute challenge:
For Real Relations ( and ):
- Alice sets: ,
- Alice computes responses:
- Alice sends to verifier
For Simulated Relations ( and ):
- Alice has already sent
Step 4: Verify
Verifier checks:
-
Challenge Distribution:
-
For Relation (if Alice knows ):
-
For Relation (simulated):
-
For Relation (if Alice knows ):
-
For Relation (simulated):
If all checks pass, verifier accepts proof.
Complete Protocol Flow:
-
Alice → Verifier: (commitments and partial challenges)
-
Verifier → Alice: (random challenge)
-
Alice → Verifier: (challenge distribution and responses)
-
Verifier Verifies:
- and
- and
- and
Security:
- Completeness: If Alice knows and (or corresponding combinations), honest Alice can always pass verification
- Soundness: If Alice does not know one of OR does not know one of , cannot pass verification
- Zero-Knowledge: Verifier cannot know whether Alice knows or , and whether or
Key Observations:
- AND Combination: Must satisfy both OR relations simultaneously
- OR Proof: Each OR relation uses standard OR proof technique
- Challenge Distribution: Use forking technique to ensure correct challenge distribution
Summary
Key Knowledge Points Review
- Concept Explanation: Basic concepts and applications of Hash Function, 1-n OT, IBE, MPC
- Scheme Design: Large file transfer, payment confidentiality, integrity, access control
- ElGamal Voting: Homomorphic encryption, ciphertext aggregation, zero-knowledge proof
- Schnorr Signature Security: Inverse attack, small space attack
- Zero-Knowledge Proof: AND proof, OR proof, Soundness proof
Exam Answering Tips
- Concept Questions: Answer according to Form, Background, Scenario, Benefit structure
- Scheme Design Questions: Clearly state tool selection, detailed process, explain how each requirement is satisfied
- Computation Questions: Clear steps, verify results
- Proof Questions: Rigorous logic, use proof by contradiction or reduction techniques