CBCP Cryptography and Hashing 4 — Questions and Answers
Question 1: What is the birthday paradox's significance in evaluating collision resistance of a hash function with an n-bit output?
- A collision can be found with approximately 2^n operations
- A collision can be found with approximately 2^(n/2) operations due to probabilistic birthday math (Correct answer)
- The function is collision-free up to 2^n/4 operations
- Birthday attacks only apply to preimage resistance, not collisions
Correct answer: A collision can be found with approximately 2^(n/2) operations due to probabilistic birthday math
The birthday paradox shows that collision probability becomes significant after roughly 2^(n/2) hashes, halving the effective security level compared to n bits.
Question 2: Which protocol uses a commit-reveal scheme based on cryptographic hashing to prevent front-running in decentralized applications?
- Proof of Work
- Commit-Reveal scheme (Correct answer)
- Schnorr multi-sig
- BLS aggregation
Correct answer: Commit-Reveal scheme
Commit-reveal schemes require a participant to first submit a hash of their choice, then reveal the plaintext later, preventing others from copying the answer before the reveal.
Question 3: What is the purpose of key stretching algorithms like PBKDF2, bcrypt, or scrypt in blockchain wallet security?
- To increase the key length for symmetric encryption
- To make brute-force attacks slower by deliberately increasing computational cost (Correct answer)
- To convert asymmetric keys into symmetric keys
- To generate Merkle proofs faster
Correct answer: To make brute-force attacks slower by deliberately increasing computational cost
Key stretching algorithms apply many iterations of hashing to slow down computation, making brute-force or dictionary attacks on passwords prohibitively expensive.
Question 4: In a Merkle proof, what does a verifier need to confirm that a specific transaction is included in a block?
- The full list of all transactions in the block
- Only the transaction hash and a set of sibling hashes along the Merkle path (Correct answer)
- The block's private key signature
- The full block header including coinbase transaction
Correct answer: Only the transaction hash and a set of sibling hashes along the Merkle path
A Merkle proof requires only the target transaction's hash and the sibling hashes at each tree level, enabling efficient inclusion verification without downloading all transactions.
Question 5: What differentiates a deterministic wallet from a non-deterministic (random) wallet in terms of key management?
- Deterministic wallets use symmetric keys; random wallets use asymmetric keys
- Deterministic wallets derive all keys from a single seed, enabling full backup with one phrase (Correct answer)
- Deterministic wallets store keys in plaintext; random wallets encrypt each key separately
- Deterministic wallets support only one address; random wallets support many
Correct answer: Deterministic wallets derive all keys from a single seed, enabling full backup with one phrase
Deterministic wallets use a master seed to derive all private keys hierarchically, so a single seed phrase backs up every key in the wallet.
Question 6: Which elliptic curve does Bitcoin use for its ECDSA digital signatures?
- P-256 (NIST curve)
- Curve25519
- secp256k1 (Correct answer)
- secp384r1
Correct answer: secp256k1
Bitcoin uses the secp256k1 curve, chosen for its efficiency and lack of potentially backdoored NIST-selected parameters.
Question 7: What is a length-extension attack, and which hash functions are vulnerable to it?
- Appending data to extend key length; affects all hash functions equally
- Computing H(message || padding || extension) without knowing the original message; affects MD5, SHA-1, SHA-256 but not SHA-3 (Correct answer)
- Expanding the hash output size; affects only truncated hashes
- Extending the preimage space; affects only small-output hash functions
Correct answer: Computing H(message || padding || extension) without knowing the original message; affects MD5, SHA-1, SHA-256 but not SHA-3
Length-extension attacks exploit the Merkle-Damgård construction to append data to a message and compute a valid hash without knowing the secret prefix; SHA-3's sponge construction is immune.
What is the birthday paradox's significance in evaluating collision resistance of a hash function with an n-bit output?