Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
Question 1 of 60 · hash functions and data integrity · Easy
What is the primary output of a cryptographic hash function?
Not quite. Try another option.
Answer: A fixed-size digest
A hash function maps input data of arbitrary length to a fixed-size output called a hash value or digest.
Question 2 of 60 · hash functions and data integrity · Easy
Hash functions are commonly used to verify which property of data?
Not quite. Try another option.
Answer: Integrity
By comparing hash values, one can detect whether data has been altered, ensuring data integrity.
Question 3 of 60 · hash functions and data integrity · Easy
Which of the following is a well-known cryptographic hash function?
Not quite. Try another option.
Answer: SHA-256
SHA-256 is a hash function from the SHA-2 family. AES and DES are ciphers, and RSA is a public-key algorithm.
Question 4 of 60 · hash functions and data integrity · Easy
A small change in the input of a good hash function should cause what change in the output?
Not quite. Try another option.
Answer: A large, unpredictable change
This is called the avalanche effect: even a tiny input change should drastically alter the output digest.
Question 5 of 60 · security of hash functions · Easy
Which property means it is hard to find two different inputs that produce the same hash?
Not quite. Try another option.
Answer: Collision resistance
Collision resistance ensures it is computationally infeasible to find two distinct inputs with the same hash .
Question 6 of 60 · security of hash functions · Easy
Given a hash value , the difficulty of finding any input such that is called what?
Not quite. Try another option.
Answer: Preimage resistance
Preimage resistance (one-wayness) means that given an output, it is infeasible to find any input that hashes to it.
Question 7 of 60 · security of hash functions · Easy
Second preimage resistance means that given an input , it is hard to find:
Not quite. Try another option.
Answer: A different input with
Second preimage resistance requires that, given one input, one cannot find a second distinct input producing the same hash.
Question 8 of 60 · security of hash functions · Easy
Which attack exploits the mathematics behind finding hash collisions more efficiently?
Not quite. Try another option.
Answer: Birthday attack
The birthday attack uses the birthday paradox to find collisions in roughly operations for an -bit hash.
Question 9 of 60 · security of hash functions · Easy
Which older hash function is now considered insecure due to practical collision attacks?
Not quite. Try another option.
Answer: MD5
MD5 is broken because practical collisions can be generated, so it is no longer used for security purposes.
Question 10 of 60 · message authentication codes · Easy
What does a Message Authentication Code (MAC) primarily provide?
Not quite. Try another option.
Answer: Integrity and authenticity
A MAC verifies that a message was not altered and confirms it came from a party sharing the secret key.
Question 11 of 60 · message authentication codes · Easy
What input, besides the message, does a MAC algorithm require?
Not quite. Try another option.
Answer: A secret key
A MAC uses a shared secret key together with the message to produce the authentication tag.
Question 12 of 60 · message authentication codes · Easy
Which of the following is a MAC constructed from a hash function?
Not quite. Try another option.
Answer: HMAC
HMAC (Hash-based Message Authentication Code) combines a cryptographic hash function with a secret key.
Question 13 of 60 · message authentication codes · Easy
Why can a MAC not provide non-repudiation on its own?
Not quite. Try another option.
Answer: Both parties share the same secret key
Since sender and receiver share the key, either could have created the MAC, so it cannot prove which one did.
Question 14 of 60 · message authentication codes · Easy
A MAC is also commonly referred to as a:
Not quite. Try another option.
Answer: Keyed hash
A MAC is often called a keyed hash because it produces a tag from a message using a secret key.
Question 15 of 60 · digital signatures · Easy
In a digital signature scheme, which key is used to create the signature?
Not quite. Try another option.
Answer: The signer's private key
The signer uses their private key to sign; anyone can verify using the corresponding public key.
Question 16 of 60 · digital signatures · Easy
Which key is used to verify a digital signature?
Not quite. Try another option.
Answer: The signer's public key
Verification uses the signer's public key to confirm the signature was produced by the matching private key.
Question 17 of 60 · digital signatures · Easy
Which of the following is a widely used digital signature algorithm?
Not quite. Try another option.
Answer: RSA
RSA can be used for digital signatures. AES is a cipher, HMAC is a MAC, and SHA-1 is a hash function.
Question 18 of 60 · digital signatures · Easy
Before signing, a message is usually first processed by which function for efficiency?
Not quite. Try another option.
Answer: A hash function
The message is hashed first, and the fixed-size digest is signed rather than the entire message.
Question 19 of 60 · security requirements for signature schemes · Easy
Which property ensures a signer cannot later deny having signed a message?
Not quite. Try another option.
Answer: Non-repudiation
Non-repudiation binds a signature to the signer, so they cannot deny authorship of a validly signed message.
Question 20 of 60 · security requirements for signature schemes · Easy
A secure signature scheme should resist which of the following?
Not quite. Try another option.
Answer: Forgery of signatures
A core security requirement is unforgeability: an attacker should not be able to create a valid signature without the private key.
Question 21 of 60 · hash functions and data integrity · Medium
A file-sharing service publishes a cryptographic hash alongside each downloadable file so users can verify integrity. If an attacker modifies the file but cannot alter the published hash, which property ensures the tampering is detected?
Not quite. Try another option.
Answer: The avalanche effect, where a small input change drastically changes the output
Even a single-bit change in the file produces a completely different hash due to the avalanche effect, so the recomputed hash will not match the published value, revealing tampering.
Question 22 of 60 · hash functions and data integrity · Medium
A hash function maps inputs of arbitrary length to outputs of bits. What is the size of the output space?
Not quite. Try another option.
Answer:
An -bit output has possible values. With , the output space contains distinct hash values.
Question 23 of 60 · hash functions and data integrity · Medium
Which of the following is NOT a required property of a cryptographic hash function used for data integrity?
Not quite. Try another option.
Answer: Reversibility, allowing the original message to be recovered from the hash
Cryptographic hash functions must be one-way (irreversible). Reversibility would defeat their security purpose. Preimage, second-preimage, and collision resistance are all required.
Question 24 of 60 · security of hash functions · Medium
Due to the birthday paradox, roughly how many hash evaluations are needed to find a collision in a hash function with an -bit output?
Not quite. Try another option.
Answer: About
The birthday attack finds collisions in approximately operations, which is why a -bit hash offers only about bits of collision resistance.
Question 25 of 60 · security of hash functions · Medium
An attacker is given a hash value and must find any message such that . Which security property directly resists this attack?
Not quite. Try another option.
Answer: Preimage resistance
Preimage resistance means that given an output , it is computationally infeasible to find any input with .
Question 26 of 60 · security of hash functions · Medium
Suppose a specific message is fixed and an attacker tries to find a different with . Which property is being attacked?
Not quite. Try another option.
Answer: Second-preimage resistance
Second-preimage resistance protects against finding a second, different input that collides with a given fixed input. Collision resistance differs because there the attacker may choose both inputs freely.
Question 27 of 60 · security of hash functions · Medium
Why are hash functions such as MD5 and SHA-1 considered insecure for modern applications?
Not quite. Try another option.
Answer: Practical collision attacks against them have been demonstrated
Researchers have produced actual colliding inputs for MD5 and SHA-1, breaking their collision resistance and making them unsuitable for security-critical use.
Question 28 of 60 · security of hash functions · Medium
If collision resistance holds for a hash function, which of the following is guaranteed?
Not quite. Try another option.
Answer: Second-preimage resistance also holds
Collision resistance is the strongest of the three properties and implies second-preimage resistance: if you could find a second preimage, you would have found a collision.
Question 29 of 60 · message authentication codes · Medium
What is the primary security goal provided by a Message Authentication Code (MAC) that a plain hash function alone does not provide?
Not quite. Try another option.
Answer: Authentication of the message origin using a shared secret key
A MAC uses a shared secret key so the receiver can verify that the message came from someone who knows the key, providing origin authentication and integrity that a keyless hash cannot.
Question 30 of 60 · message authentication codes · Medium
In the HMAC construction , why is the hash function applied twice?
Not quite. Try another option.
Answer: To defend against length-extension attacks on the underlying hash
The nested (double) hashing with the inner and outer keyed pads prevents length-extension attacks that would otherwise affect simple constructions like .
Question 31 of 60 · message authentication codes · Medium
Why is the naive MAC construction using a Merkle–Damgård hash considered insecure?
Not quite. Try another option.
Answer: It is vulnerable to a length-extension attack
With a Merkle–Damgård hash, an attacker can extend the message and compute a valid tag for without knowing , breaking the MAC.
Question 32 of 60 · message authentication codes · Medium
Two parties share a secret key and exchange MACs to authenticate messages. Which security guarantee is NOT provided by a MAC?
Not quite. Try another option.
Answer: Non-repudiation to a third party
Because both parties share the same key, either could have produced a valid MAC, so a MAC cannot prove to a third party who authored the message. Digital signatures are needed for non-repudiation.
Question 33 of 60 · message authentication codes · Medium
A MAC scheme is said to be secure if an adversary cannot achieve which of the following?
Not quite. Try another option.
Answer: Existential forgery of a valid tag for a new message
MAC security is defined by resistance to existential forgery under chosen-message attack: the adversary should not be able to produce a valid tag for any message not previously authenticated.
Question 34 of 60 · digital signatures · Medium
In a standard digital signature scheme, which key is used to create a signature and which is used to verify it?
Not quite. Try another option.
Answer: Sign with the private key, verify with the public key
Only the signer holds the private key to produce a signature, while anyone can verify it using the corresponding public key, providing authentication and non-repudiation.
Question 35 of 60 · digital signatures · Medium
In RSA signatures, a message hash is signed as . How does a verifier check the signature?
Not quite. Try another option.
Answer: Compute and compare it to
Using the public exponent , the verifier computes and checks equality with the freshly computed hash of the message.
Question 36 of 60 · digital signatures · Medium
Why is a message typically hashed before being signed rather than signing the full message directly?
Not quite. Try another option.
Answer: To sign a fixed-size digest, improving efficiency and enabling arbitrary message lengths
Signing the hash lets one signature cover a message of any length efficiently, since the signing operation works on the fixed-size digest instead of the entire message.
Question 37 of 60 · digital signatures · Medium
Which property do digital signatures provide that symmetric MACs do not?
Not quite. Try another option.
Answer: Non-repudiation
Since only the signer holds the private key, a valid signature binds the message to the signer, who cannot later deny signing it, giving non-repudiation that shared-key MACs lack.
Question 38 of 60 · security requirements for signature schemes · Medium
The standard security definition for signature schemes requires resistance to which type of attack?
Not quite. Try another option.
Answer: Existential forgery under adaptive chosen-message attack
A secure signature scheme must be existentially unforgeable even when the adversary can adaptively request signatures on chosen messages (EUF-CMA).
Question 39 of 60 · security requirements for signature schemes · Medium
Textbook RSA signatures without hashing are vulnerable to a forgery based on which mathematical property?
Not quite. Try another option.
Answer: Multiplicativity:
Because , an attacker can combine two signatures to forge a signature on the product. Hashing the message before signing prevents this.
Question 40 of 60 · security requirements for signature schemes · Medium
In a signature scheme, what does an "existential forgery" specifically mean?
Not quite. Try another option.
Answer: The adversary produces a valid signature for at least one new message of their choosing
Existential forgery only requires the adversary to create one valid message-signature pair not previously seen; it does not require key recovery or forging arbitrary chosen messages.
Question 41 of 60 · security of hash functions · Hard
A hash function produces -bit outputs. Due to the birthday paradox, the expected number of random inputs needed to find a collision with probability is closest to which value?
Not quite. Try another option.
Answer:
Collision resistance is bounded by the birthday attack: about evaluations suffice to find a collision with probability near , which is why must be roughly doubled compared to preimage security.
Question 42 of 60 · security of hash functions · Hard
Which relationship between hash-function security properties is correct?
If an attacker cannot find any colliding pair, they certainly cannot find a second message colliding with a given one. However collision resistance does not, in general, imply preimage resistance without additional assumptions.
Question 43 of 60 · message authentication codes · Hard
Why is the naive construction using a Merkle–Damgård hash insecure?
Not quite. Try another option.
Answer: It is vulnerable to a length-extension attack allowing forgery on
Merkle–Damgård hashes leak internal state as their output, so an attacker who knows can extend the message and compute a valid MAC on without knowing . HMAC's nested structure prevents this.
Question 44 of 60 · message authentication codes · Hard
HMAC is defined as . What is the primary security benefit of the nested (two-pass) structure?
Not quite. Try another option.
Answer: It defeats length-extension attacks and reduces security to properties of the compression function
The outer hash conceals the inner hash's internal state, blocking length-extension. HMAC's proof reduces its PRF/MAC security to reasonable assumptions on the compression function, not to full collision resistance.
Question 45 of 60 · digital signatures · Hard
In textbook RSA signatures, . Given valid signatures on messages , an attacker can forge a signature on which message without the private key?
Not quite. Try another option.
Answer: , with signature
RSA is multiplicatively homomorphic: . This existential forgery is why real schemes apply a hash and padding (e.g., RSA-PSS) before signing.
Question 46 of 60 · security requirements for signature schemes · Hard
A signature scheme is EUF-CMA secure. Which statement precisely describes what the adversary must achieve to break it?
Not quite. Try another option.
Answer: Produce a valid signature on a message never queried to the signing oracle
Existential Unforgeability under Chosen-Message Attack requires the adversary, even after adaptively obtaining signatures on messages of its choice, to forge a valid signature on some new (unqueried) message. Key recovery is a stronger break, not the definition.
Question 47 of 60 · digital signatures · Hard
In ECDSA/DSA, reusing the same per-signature nonce for two different messages allows an attacker to recover which secret?
Not quite. Try another option.
Answer: The signer's long-term private key
With equal , the two signatures share , and lets the attacker solve for , then recover the private key . This flaw famously compromised the Sony PS3 signing key.
Question 48 of 60 · hash functions and data integrity · Hard
A file's integrity is protected by publishing over an insecure channel where an attacker can modify both and the stored digest. What property is actually required for meaningful protection here?
Not quite. Try another option.
Answer: The digest channel must be authenticated; the hash alone provides no integrity if the attacker controls both
An unkeyed hash detects accidental corruption, but if an adversary can alter both message and digest, they simply recompute . Integrity against active adversaries needs an authenticated digest (e.g., via a MAC or signature).
Question 49 of 60 · security of hash functions · Hard
The 'random oracle model' is often used in security proofs. Which is the most accurate critique of relying on it?
Not quite. Try another option.
Answer: No real hash function is a true random oracle, so ROM proofs are heuristic and can be uninstantiable
The ROM treats as an ideal random function. Canetti–Goldreich–Halevi showed schemes secure in the ROM that are insecure under any concrete instantiation, so ROM security is a strong heuristic, not a full guarantee.
Question 50 of 60 · message authentication codes · Hard
Consider verifying a MAC by comparing bytes with an early-exit comparison (returns as soon as a mismatch is found). What vulnerability does this introduce?
Not quite. Try another option.
Answer: A timing side channel that lets an attacker forge tags byte-by-byte
Non-constant-time comparison leaks how many leading bytes matched via timing. An attacker can adaptively guess the tag one byte at a time, so MAC verification must use constant-time comparison.
Question 51 of 60 · digital signatures · Hard
In the 'hash-then-sign' paradigm, why must the hash function be collision resistant for the overall signature to be secure?
Not quite. Try another option.
Answer: A collision turns a legitimate signature on into a valid signature on
The signature is computed on . If , any signature valid for is automatically valid for , enabling forgery. This is why MD5-based signature forgeries (e.g., rogue CA certificates) were possible.
Question 52 of 60 · security requirements for signature schemes · Hard
Which attack model is the STRONGEST (hardest to resist), such that security under it implies security under the others?
Not quite. Try another option.
Answer: Adaptive chosen-message attack aiming at existential forgery
The strongest standard notion combines the most powerful attacker capability (adaptive chosen-message queries) with the weakest forgery goal (existential — any new valid message). Resisting this implies resisting weaker attacker models and harder goals.
Question 53 of 60 · hash functions and data integrity · Hard
A Merkle tree is used to verify integrity of a large dataset split into leaves. What is the size of the authentication path (proof) that a verifier needs to check a single leaf?
Not quite. Try another option.
Answer: hash values
A Merkle proof supplies one sibling hash at each level from the leaf up to the root, so its length equals the tree height , giving logarithmic-size integrity proofs.
Question 54 of 60 · message authentication codes · Hard
A MAC provides authentication but a plain digital signature additionally provides which property that a symmetric MAC cannot?
Not quite. Try another option.
Answer: Non-repudiation, since only the signer holds the private key
MACs use a shared secret, so either party could have produced a tag — no third party can attribute it. Signatures use the signer's private key, giving non-repudiation. Neither MACs nor signatures inherently provide confidentiality or replay protection.
Question 55 of 60 · security of hash functions · Hard
An attacker performs a precomputation of hash values stored in a table to invert a -bit hash. Why does this classic time–memory tradeoff fail against modern password hashing?
Not quite. Try another option.
Answer: Per-user salts make precomputed tables useless because each password uses a distinct hash instance
A unique random salt per password means a precomputed rainbow table for one salt is worthless for others, forcing the attacker to redo work per target. Salting (plus slow/memory-hard functions) defeats generic precomputation.
Question 56 of 60 · digital signatures · Hard
RSA-PSS is preferred over deterministic PKCS#1 v1.5 signatures primarily because:
Not quite. Try another option.
Answer: It has a tight security reduction to the RSA problem in the random oracle model via randomized padding
PSS uses randomized, provably secure padding with a tight reduction to RSA in the ROM. PKCS#1 v1.5 is deterministic and lacks such a clean proof, making PSS the recommended modern choice.
Question 57 of 60 · security requirements for signature schemes · Hard
Consider a signature scheme that is EUF-CMA secure but malleable: given a valid an attacker can produce with also valid. Is this a violation of EUF-CMA?
Not quite. Try another option.
Answer: No, because the forged signature is on an already-queried message
EUF-CMA only forbids forgeries on new messages. Producing a different valid signature on the same message is not an EUF-CMA break; the stronger notion of Strong Unforgeability (sEUF-CMA) is needed to rule out such malleability.
Question 58 of 60 · message authentication codes · Hard
CBC-MAC is secure for fixed-length messages but insecure for variable-length messages. What is the core reason?
Not quite. Try another option.
Answer: An attacker can concatenate messages to forge tags because the tag of one message can seed another
For variable lengths, knowing and lets an attacker construct a valid tag for a crafted concatenation via XOR relations on the chaining values. Fixes like CMAC/EMAC add length-dependent processing.
Question 59 of 60 · hash functions and data integrity · Hard
For a hash with -bit output, which set of expected work factors correctly matches (preimage, second-preimage, collision) resistance under generic attacks?
Not quite. Try another option.
Answer:
Generic preimage and second-preimage attacks cost about , while the birthday bound makes generic collisions cost only . This asymmetry drives the choice of output length for collision-critical applications.
Question 60 of 60 · digital signatures · Hard
In the Digital Signature Algorithm (DSA), the verification recomputes and accepts if . What role does the secret nonce play in security?
Not quite. Try another option.
Answer: It must be unique and unpredictable per signature; leakage or reuse exposes the private key
is a fresh secret nonce. If it repeats, is predictable, or partially leaks, an attacker can solve for the private key . RFC 6979 derives deterministically to avoid weak randomness.
That's unit 6
Answer a few questions and your score shows up here.
Nearly through. Did unit 6 of MTH381 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 6 of MTH381 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.