Quiz: Cryptographic Foundations

20 multiple-choice questions · Click an option to check your answer

20Questions 0Correct
Score: 0 / 20

Question 1

A payment processor stores a SHA-256 hash of every incoming transaction record. A junior auditor asks: "Why not just store the records themselves?" Which answer best explains the purpose of hashing in this context?

  • (A) Hashing compresses the records to save storage space
  • (B) Hashing speeds up database queries by replacing text with numbers
  • (C) Hashing creates a fixed-size fingerprint that detects any
  • (D) Hashing encrypts the records so unauthorized users cannot read them
Answer: (C) A cryptographic hash produces a fixed-size digest that changes completely if even one bit of the input is altered. This allows tamper detection — not compression, encryption, or query optimization.

Question 2

A blockchain developer tells a client: "SHA-256 is a one-way function." The client asks what "one-way" means. Which explanation is most accurate?

  • (A) The hash output always has fewer characters than the input
  • (B) The hash can only be computed on one specific type of hardware
  • (C) Given the hash output
  • (D) The function can only be called once per input
Answer: (C) "One-way" refers to pre-image resistance: computing the hash from the input is fast, but reversing the process — finding an input that produces a given hash — is computationally infeasible.

Question 3

An intern hashes the string "Transfer $500 to Alice" and then hashes "Transfer $500 to alice" (lowercase 'a'). The two hashes are completely different. Which property of cryptographic hash functions does this demonstrate?

  • (A) Collision resistance
  • (B) Second pre-image resistance
  • (C) Pre-image resistance
  • (D) The avalanche effect
Answer: (D) The avalanche effect means that a tiny change in the input (one character case change) produces a completely different hash output. On average, about 50% of the output bits flip.

Question 4

A compliance officer needs to verify that a regulatory filing has not been altered since it was submitted. She compares the hash she computed today with the hash recorded at submission. Which property of hash functions makes this verification trustworthy?

  • (A) Determinism — the same input always produces the same output
  • (B) Collision resistance — it is infeasible that a different document
  • (C) The avalanche effect — any change would flip output bits
  • (D) Pre-image resistance — the original cannot be derived from the hash
Answer: (B) The verification relies on collision resistance: if the hashes match, you can be confident no different document could have produced that same hash. Determinism is necessary but not sufficient — without collision resistance, a forged document could match the hash.

Question 5

A blockchain contains 1,024 transactions organized in a Merkle tree. A lightweight mobile wallet needs to verify that a specific transaction is included in the block. How many sibling hashes must the network provide in the inclusion proof?

  • (A) 512
  • (B) 5
  • (C) 1,024
  • (D) 10
Answer: (D) A Merkle inclusion proof requires log2(n) hashes. log2(1,024) = 10. The wallet receives 10 sibling hashes and recomputes the path to the Merkle root, comparing it with the known root in the block header.

Question 6

You are constructing a Merkle tree from four transactions: T1, T2, T3, T4. You compute H1 = Hash(T1) through H4 = Hash(T4). What is the next step?

  • (A) Hash all four leaf hashes together in one operation to get the Merkle root
  • (B) XOR all four hashes to produce the root
  • (C) Sort the hashes alphabetically, then hash the sorted list
  • (D) Concatenate H1 || H2 and hash them; concatenate H3 || H4 and hash them
Answer: (D) Merkle trees are built bottom-up by hashing pairs: H12 = Hash(H1 || H2) and H34 = Hash(H3 || H4). Then the root is Hash(H12 || H34).

Question 7

Alice wants to send Bob an encrypted message using public-key cryptography. She has Bob's public key and her own key pair. Which key does she use to encrypt the message?

  • (A) Her own private key
  • (B) Her own public key
  • (C) Bob's private key
  • (D) Bob's public key
Answer: (D) To encrypt a message for Bob, Alice uses Bob's public key. Only Bob's private key can decrypt it, ensuring only the intended recipient can read the message.

Question 8

A cryptocurrency wallet shows a user the following signing process: (1) hash the transaction data, (2) sign the hash with the private key, (3) broadcast the transaction + signature. Why is the hash signed rather than the raw transaction data?

  • (A) Hashing first converts the variable-length transaction into
  • (B) The hash adds an extra layer of encryption to the signature
  • (C) Signing the hash hides the transaction details from the network
  • (D) Signing the raw data would reveal the private key
Answer: (A) Digital signature algorithms operate on fixed-size inputs. Hashing the transaction first produces a fixed-size digest (e.g., 256 bits), which is then signed. This is computationally efficient and mathematically well-defined.

Question 9

A bank implements a commitment scheme for sealed-bid auctions: each bidder submits Hash(bid || nonce) before the deadline, then reveals the bid and nonce afterward. Which hash property ensures a bidder cannot change their bid after submission?

  • (A) Pre-image resistance — the auctioneer cannot reverse-engineer the bid
  • (B) Determinism — the same bid always produces the same hash
  • (C) Collision resistance — the bidder cannot find a different bid
  • (D) The avalanche effect — changing the bid changes the hash
Answer: (C) The commitment is binding because collision resistance prevents the bidder from finding a different (bid, nonce) pair that produces the same hash. Pre-image resistance keeps the bid hidden, but collision resistance is what prevents changing it.

Question 10

An exchange publishes a Merkle tree of all customer balances for a proof-of-reserves audit. Customer X wants to verify that their balance of 2.5 BTC is included. What information does Customer X need from the exchange?

  • (A) Their leaf hash plus the sibling hashes
  • (B) Only the Merkle root
  • (C) The complete list of all customer balances
  • (D) The private key used to construct the tree
Answer: (A) The customer needs their own leaf data (to compute their leaf hash) plus the sibling hashes at each level of the tree. They recompute the path up and compare the result with the published Merkle root. This verifies inclusion without revealing other customers' data.

Question 11

A node on the Bitcoin network receives a transaction claiming to transfer 0.5 BTC from address 1A3x... to address 1B7y.... The transaction includes an ECDSA signature. What does the node verify first?

  • (A) That the recipient address 1B7y... exists on the blockchain
  • (B) That the sender has sufficient balance (0.5 BTC or more)
  • (C) That the signature was produced by the private key corresponding to 1A3x...
  • (D) That the transaction amount is below the network maximum
Answer: (C) Signature verification is the first cryptographic check: does the ECDSA signature match the public key associated with the sender address? If the signature is invalid, the transaction is rejected immediately, regardless of balance.

Question 12

ECDSA uses 256-bit keys while RSA requires 3,072-bit keys for equivalent security. A mobile banking app is choosing between the two. What is the primary practical advantage of ECDSA in this context?

  • (A) ECDSA does not require a private key, simplifying key management
  • (B) ECDSA signatures are impossible to forge, while RSA signatures can be
  • (C) ECDSA is a symmetric algorithm, which is always faster
  • (D) ECDSA's smaller keys mean less storage, bandwidth
Answer: (D) At equivalent security levels, ECDSA keys are roughly 12× smaller than RSA keys. This translates to smaller signatures, less network bandwidth, and faster computation — all critical for battery-limited, bandwidth-limited mobile devices.

Question 13

An attacker modifies transaction T3 in a Merkle tree of 8 transactions. Which of the following hashes in the tree will change as a result?

  • (A) The leaf hash of T3 and all hashes on the path from T3 to the root
  • (B) Only the leaf hash of T3
  • (C) Only the Merkle root
  • (D) Every hash in the entire tree
Answer: (A) Due to the avalanche effect, changing T3 changes its leaf hash. This propagates upward: every parent hash on the path to the root changes. However, sibling branches that do not contain T3 remain unchanged. This is exactly log2(n) + 1 hashes.

Question 14

A digital signature provides three guarantees: authentication, integrity, and non-repudiation. A disgruntled employee signs a fraudulent transaction and later claims they did not authorize it. Which property of digital signatures directly refutes this claim?

  • (A) Non-repudiation — the signer cannot deny having signed
  • (B) Integrity — the transaction has not been modified
  • (C) Confidentiality — the transaction was encrypted during transmission
  • (D) Authentication — the signature proves the identity of the signer
Answer: (A) Non-repudiation means the signer cannot credibly deny signing. Since the signature can only be produced by the holder of the corresponding private key, the employee's denial is cryptographically refuted (assuming proper key management).

Question 15

Alice signs a transaction "Pay Bob 1 BTC" and broadcasts it. An attacker intercepts the signed transaction and changes it to "Pay Eve 1 BTC." Will the attack succeed?

  • (A) No — but only because the network rejects all transactions from intercepted broadcasts
  • (B) No — modifying the transaction invalidates the signature because the hash
  • (C) Yes — the attacker can modify the transaction and reuse Alice's signature
  • (D) Yes — the attacker can compute Alice's private key from the signature
Answer: (B) The digital signature is bound to the exact hash of the original message. Any modification to the transaction changes the hash, and the original signature will fail verification against the new hash. The attacker cannot forge a new valid signature without Alice's private key.

Question 16

In the double-spend problem, Alice sends 1 BTC to Bob and simultaneously sends the same 1 BTC to Charlie. Both transactions have valid digital signatures. Why does cryptography alone fail to prevent this?

  • (A) Public-key encryption prevents nodes from seeing both transactions
  • (B) Hash functions cannot detect duplicate transactions
  • (C) Cryptography ensures each signature is valid but cannot determine
  • (D) Digital signatures cannot verify the sender's identity
Answer: (C) Both transactions are cryptographically valid — both carry correct signatures from Alice's private key. The problem is deciding which came first. Cryptography provides authentication and integrity, but establishing a canonical ordering requires a consensus mechanism.

Question 17

A startup proposes using MD5 (128-bit output) instead of SHA-256 (256-bit output) for their blockchain to "save storage space." An advisor warns against this. What is the strongest technical argument against MD5?

  • (A) MD5 produces output that is too short to be displayed in a user interface
  • (B) MD5's collision resistance is broken — practical collisions have been
  • (C) MD5 is slower to compute than SHA-256
  • (D) MD5 is not supported by modern programming languages
Answer: (B) MD5's collision resistance was broken in 2004 (Wang et al.), and practical collision attacks now take seconds on standard hardware. An attacker could craft two different transactions with the same MD5 hash, enabling undetectable substitution.

Question 18

A user loses their private key but still has their public key and blockchain address. Which of the following is true?

  • (A) They can still receive funds but can never spend them
  • (B) They can contact the blockchain's central authority to reset their key
  • (C) They can use their public key to sign transactions temporarily
  • (D) They can derive the private key from the public key using elliptic curve math
Answer: (A) The public key can still receive incoming transactions (others encrypt/address to it). However, spending requires signing with the private key. Since the public-to-private derivation is computationally infeasible, and blockchains have no central key recovery authority, the funds are permanently inaccessible.

Question 19

A government regulator proposes requiring all cryptocurrency users to register their public keys with a central authority, which would hold backup copies of private keys. Evaluate this proposal from a cryptographic security perspective. Which concern is most critical?

  • (A) The registration process would slow down transaction processing
  • (B) A single breach of the central authority would compromise every
  • (C) The public keys would become visible to everyone, reducing privacy
  • (D) The central authority would need too much storage for all the keys
Answer: (B) Centralizing private keys creates a catastrophic single point of failure. A breach exposes every user's signing capability, enabling mass theft. This directly contradicts the security model of public-key cryptography, where the private key must remain exclusively with the owner.

Question 20

A financial institution currently uses a trusted third party (a bank) to prevent double-spending. A consultant proposes replacing this with a system using only cryptographic hash functions, Merkle trees, and digital signatures — but no consensus mechanism. Is this system viable?

  • (A) Yes — Merkle trees can detect conflicting transactions and automatically reject the second one
  • (B) No — without a consensus mechanism
  • (C) No — hash functions are too slow for real-time transaction processing
  • (D) Yes — digital signatures alone can prevent double-spending because they prove ownership
Answer: (B) Cryptographic tools provide integrity (hashing), efficient verification (Merkle trees), and authentication (signatures), but they cannot solve the ordering problem in a distributed setting. Without consensus, two conflicting transactions with valid signatures cannot be resolved — this is precisely why Bitcoin introduced Proof of Work.