Unit 2 - Practice Quiz

CSC203 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is the primary goal of cryptography?

Cryptography Easy
A. To store unlimited amounts of data
B. To design computer networks
C. To increase computer processing speed
D. To secure communication and information

2 In cryptography, what is unencrypted, readable data called?

Cryptography Easy
A. Secret text
B. Ciphertext
C. Scrambled text
D. Plaintext

3 The process of converting plaintext into ciphertext is known as:

Cryptography Easy
A. Encryption
B. Compression
C. Hashing
D. Decryption

4 What is the name for data that has been encrypted and is unreadable without a key?

Cryptography Easy
A. Open text
B. Raw text
C. Plaintext
D. Ciphertext

5 The process of converting ciphertext back into its original, readable form is called:

Cryptography Easy
A. Decryption
B. Encryption
C. Encoding
D. Signing

6 What is the key characteristic of symmetric cryptography?

Symmetric cryptography Easy
A. It uses a pair of keys (public and private).
B. It does not require any keys.
C. It can only be used to create digital signatures.
D. It uses a single, shared key for both encryption and decryption.

7 What is a major challenge associated with symmetric cryptography?

Symmetric cryptography Easy
A. It is not secure enough for modern use
B. Generating the key is difficult
C. The encryption process is too slow
D. Securely distributing the shared key

8 Which of the following is a well-known example of a symmetric encryption algorithm?

Symmetric cryptography Easy
A. SHA-256
B. ECC (Elliptic Curve Cryptography)
C. RSA (Rivest-Shamir-Adleman)
D. AES (Advanced Encryption Standard)

9 What is a primary advantage of symmetric encryption when compared to asymmetric encryption?

Symmetric cryptography Easy
A. It does not require a shared secret
B. It is significantly faster
C. It is easier to manage keys
D. It provides non-repudiation

10 How many keys are used for each user in asymmetric cryptography?

Asymmetric cryptography Easy
A. A single shared key
B. No keys are used
C. A pair of keys: one public and one private
D. Three keys for redundancy

11 In asymmetric cryptography, which key is used to encrypt a message intended for a specific recipient?

Asymmetric cryptography Easy
A. A shared secret key
B. The recipient's private key
C. The sender's private key
D. The recipient's public key

12 Which key must be kept completely secret by its owner in public-key cryptography?

Asymmetric cryptography Easy
A. The public key
B. The shared key
C. The private key
D. The session key

13 What problem does asymmetric cryptography solve that is a major challenge for symmetric cryptography?

Asymmetric cryptography Easy
A. Key distribution
B. Algorithm complexity
C. Data storage
D. Processing speed

14 Which of the following are considered the basic building blocks of cryptographic systems?

Cryptography primitives Easy
A. Network firewalls
B. Operating systems
C. Cryptographic primitives
D. Antivirus software

15 A hash function is a cryptographic primitive that takes an input and produces a:

Cryptography primitives Easy
A. Reversible, decrypted message
B. Public and private key pair
C. Fixed-size string of bytes (a digest)
D. Larger, encrypted version of the input

16 What is the primary purpose of a digital signature, which is a type of cryptographic primitive?

Cryptography primitives Easy
A. To make a message travel faster
B. To compress the size of a message
C. To hide the content of a message
D. To verify the authenticity and integrity of a message

17 Which of these is NOT a cryptographic primitive?

Cryptography primitives Easy
A. A web browser
B. A symmetric encryption algorithm
C. A hash function
D. A digital signature scheme

18 Symmetric cryptography is also often referred to as:

Symmetric cryptography Easy
A. Secret-key cryptography
B. Dual-key cryptography
C. Public-key cryptography
D. Open-key cryptography

19 Which of these is a popular real-world application of asymmetric cryptography?

Asymmetric cryptography Easy
A. Streaming video content in real-time
B. Compressing files into a ZIP archive
C. Creating digital signatures for transactions
D. Encrypting the entire hard drive of a computer

20 The strength of a cryptographic system often depends on the secrecy of the:

Cryptography Easy
A. Algorithm
B. Plaintext
C. Key
D. Sender's name

21 An attacker intercepts a ciphertext block that was encrypted using AES in Cipher Block Chaining (CBC) mode. The attacker flips a single bit in . How will this modification affect the plaintext when the stream of ciphertext blocks is decrypted?

Symmetric cryptography Medium
A. The entire message from block onwards will be corrupted and undecipherable.
B. The corresponding plaintext block will be completely corrupted, and the corresponding bit in the next plaintext block, , will be flipped.
C. Only the single corresponding bit in plaintext block will be flipped.
D. Only the corresponding plaintext block will be completely corrupted.

22 A hybrid encryption scheme is often used to send a large, confidential file. This typically involves using both asymmetric and symmetric algorithms. What is the correct procedure for Alice to send such a file to Bob?

Asymmetric cryptography Medium
A. Alice encrypts the file with Bob's public key directly.
B. Alice encrypts the file with her private key, then encrypts her private key with Bob's public key.
C. Alice generates a random symmetric key, encrypts the file with it, and then encrypts this symmetric key with Bob's public key.
D. Alice generates a random symmetric key, encrypts the file with it, and then encrypts this symmetric key with her own private key.

23 What is the primary functional difference between a Message Authentication Code (MAC) and a digital signature?

Cryptography primitives Medium
A. A MAC provides confidentiality, while a digital signature provides integrity.
B. A MAC can be verified by anyone, while a digital signature can only be verified by the recipient.
C. A MAC is generated using a shared secret key, while a digital signature is generated using a private key.
D. A MAC is faster to compute but less secure than a digital signature.

24 In a secure communication system, a nonce (number used once) is often included in messages. What is the primary security threat that using a nonce is designed to prevent?

Cryptography Medium
A. Brute-force attacks on the encryption key.
B. Replay attacks, where an attacker re-sends a valid, previously captured message.
C. Dictionary attacks on user passwords.
D. Man-in-the-middle attacks during key exchange.

25 The security of the Diffie-Hellman key exchange protocol relies on the computational difficulty of which mathematical problem?

Asymmetric cryptography Medium
A. The Discrete Logarithm Problem.
B. The Integer Factorization Problem.
C. The Traveling Salesman Problem.
D. The Subset Sum Problem.

26 A developer is building a system for storing digital evidence. They need to create a unique fingerprint for each piece of evidence to detect even the slightest modification. Which property of a cryptographic hash function is most crucial for this application?

Cryptography primitives Medium
A. Second preimage resistance.
B. Preimage resistance.
C. Fixed-size output.
D. Collision resistance.

27 Two independent software agents need to establish a secure, encrypted channel over an insecure network. They have no pre-shared secrets. What is the fundamental cryptographic problem they must solve before they can use a fast symmetric cipher like AES?

Symmetric cryptography Medium
A. The Non-Repudiation Problem.
B. The Data Integrity Problem.
C. The Key Distribution Problem.
D. The Byzantine Generals' Problem.

28 What is the core idea behind Kerckhoffs's Principle in cryptography?

Cryptography Medium
A. Asymmetric cryptography is inherently more secure than symmetric cryptography.
B. Longer keys always result in a more secure cryptographic system.
C. The security of a system should rely on the secrecy of its algorithm (security through obscurity).
D. A cryptographic system should be secure even if everything about the system, except the key, is public knowledge.

29 Compared to RSA with a 2048-bit key, Elliptic Curve Cryptography (ECC) offers a similar level of security with a much smaller key size (e.g., 256 bits). What is the most significant practical advantage of this smaller key size?

Asymmetric cryptography Medium
A. It allows the public key to be kept secret while the private key is shared.
B. It provides better protection against quantum computing attacks.
C. It makes the encryption algorithm easier for developers to implement from scratch.
D. It reduces the computational overhead, storage, and bandwidth requirements.

30 In the context of creating a digital signature, why is the message typically hashed before being encrypted with the signer's private key?

Cryptography primitives Medium
A. To create a fixed-size input for the signing algorithm and improve performance.
B. To convert the message into a format that the private key can encrypt.
C. Hashing adds an extra layer of confidentiality to the message.
D. Hashing is not necessary; the entire message is always encrypted.

31 A real-time video streaming service needs to encrypt its content. The connection may be lossy, and an error or dropped packet in the transmission should not corrupt subsequent, unrelated parts of the stream. Which type of symmetric cipher is generally more suitable for this use case?

Symmetric cryptography Medium
A. A stream cipher or a block cipher in a stream-like mode (e.g., CTR).
B. A one-time pad.
C. A block cipher in CBC (Cipher Block Chaining) mode.
D. A block cipher in ECB (Electronic Codebook) mode.

32 You have two distinct messages, M1 and M2. You compute their hashes, H(M1) and H(M2). You then concatenate the messages to form M3 = M1 || M2. What is the expected relationship between H(M3) and the individual hashes H(M1) and H(M2)?

Cryptography primitives Medium
A. There is no simple mathematical relationship due to the avalanche effect.
B. H(M3) = H(M1) + H(M2)
C. H(M3) can be calculated by hashing the concatenation of H(M1) and H(M2).
D. H(M3) will be twice the length of H(M1).

33 A user wants to prove they control a Bitcoin address without revealing their private key. A challenger provides the user with a random message. How can the user generate a proof?

Asymmetric cryptography Medium
A. By encrypting the random message with their private key, which the challenger decrypts with the public key.
B. By creating a digital signature of the random message using their private key.
C. By hashing their private key and sending the hash to the challenger.
D. By encrypting the random message with the challenger's public key.

34 If a government agency wants to be able to access encrypted communications by compelling a third party to hand over decryption keys, what type of system would they be advocating for?

Cryptography Medium
A. Steganography.
B. Perfect forward secrecy.
C. Key escrow.
D. End-to-end encryption.

35 Why is the Electronic Codebook (ECB) mode of operation for block ciphers considered insecure for most applications?

Symmetric cryptography Medium
A. It is highly susceptible to bit-flipping attacks that go undetected.
B. It requires a key that is the same length as the message being encrypted.
C. It is significantly slower than other modes like CBC or CTR.
D. Identical plaintext blocks are encrypted into identical ciphertext blocks, revealing patterns in the data.

36 What is the primary benefit of implementing Perfect Forward Secrecy (PFS) in a communication protocol like TLS?

Cryptography Medium
A. If a long-term private key is compromised, past session keys and messages remain secure.
B. It allows the server's private key to be used for both signing and encryption.
C. It ensures that all messages within a session are encrypted with the same key, improving efficiency.
D. It prevents an attacker from brute-forcing the session key.

37 In the RSA algorithm, a user has a public key and a private key . What is the fundamental mathematical relationship between the components , , and ?

Asymmetric cryptography Medium
A. and are prime factors of .
B.
C. , where is Euler's totient function.
D.

38 While both AES and DES are symmetric block ciphers, the primary reason DES is considered insecure for modern applications is its susceptibility to which specific type of attack?

Symmetric cryptography Medium
A. Man-in-the-middle attack.
B. Brute-force attack.
C. Side-channel attack.
D. Replay attack.

39 A security protocol requires a unique, single-use session key for every communication instance to ensure forward secrecy. Which cryptographic primitive is essential for generating these keys in a way that is unpredictable to an attacker?

Cryptography primitives Medium
A. A Cryptographically Secure Pseudorandom Number Generator (CSPRNG).
B. A block cipher in ECB mode.
C. A standard hash function (like SHA-256).
D. A public key certificate.

40 Which of the following scenarios best illustrates a trade-off between security and performance in a cryptographic system?

Cryptography Medium
A. Implementing a nonce to prevent replay attacks.
B. Choosing between a 2048-bit RSA key and a 4096-bit RSA key for a TLS certificate.
C. Using a public, well-vetted algorithm like AES instead of a secret, proprietary one.
D. Hashing a password before storing it in a database.

41 A web service uses a MAC to authenticate API requests, constructed as MAC = SHA256(secret_key || message). An attacker intercepts a valid message m = "user=admin&command=view" and its corresponding MAC. The attacker does not know the secret_key. What vulnerability is present in this scheme?

Cryptography primitives Hard
A. The scheme is vulnerable to a pre-image attack, allowing the attacker to recover the secret_key from the MAC.
B. The scheme is perfectly secure as SHA-256 is a secure hash function and the key is prepended.
C. The scheme is vulnerable to a length extension attack, allowing the attacker to forge a new valid MAC for a message m' that appends data to the original message m.
D. The scheme is vulnerable to a collision attack, allowing the attacker to find a different message m' that produces the same MAC, but m' cannot be controlled.

42 An attacker modifies a single bit in the 5th ciphertext block () of a message encrypted using AES in Cipher Block Chaining (CBC) mode. Assuming the modification does not affect the padding, how will this error propagate upon decryption?

Symmetric cryptography Hard
A. The entirety of the 5th plaintext block () will be garbled, and all subsequent plaintext blocks () will also be completely garbled.
B. The entirety of the 5th plaintext block () and the 6th plaintext block () will be completely garbled.
C. Only a single bit in the 5th plaintext block () will be flipped.
D. The entirety of the 5th plaintext block () will be garbled, and a single corresponding bit in the 6th plaintext block () will be flipped.

43 A developer needs to design a system for securely transmitting large video files (often > 2GB) between users. Why would a hybrid encryption scheme (e.g., ECIES - Elliptic Curve Integrated Encryption Scheme) be vastly superior to using a pure asymmetric scheme like RSA directly on the data?

Asymmetric cryptography Hard
A. Asymmetric key sizes (e.g., 2048-bit) are too small to securely encrypt gigabytes of data, requiring a symmetric cipher with a larger effective key space.
B. Asymmetric cryptography does not provide integrity protection, whereas hybrid schemes inherently include it.
C. Asymmetric cryptography is significantly slower and has strict message size limits, making it impractical for large data. Hybrid schemes use it only to encrypt a small symmetric key.
D. Pure asymmetric encryption is vulnerable to man-in-the-middle attacks, while hybrid encryption is not.

44 A blockchain wallet implementation using ECDSA consistently uses the same random value 'k' (the ephemeral key) when signing two different transactions with the same private key. What is the catastrophic consequence of this implementation flaw?

Cryptography primitives Hard
A. The second transaction will be rejected by the network as a duplicate signature.
B. It allows an attacker to create a collision, where they can find a third message that results in one of the two signatures.
C. An attacker observing both signatures can compute the user's private key.
D. It slightly weakens the security of the elliptic curve used but does not expose the private key directly.

45 A high-performance storage system needs to encrypt files on disk, supporting parallel read/write operations and random access to any part of a file without reading the whole file. Which block cipher mode of operation is most suitable for this requirement and why?

Symmetric cryptography Hard
A. Cipher Block Chaining (CBC) mode, because its chaining mechanism ensures the integrity of the file structure.
B. Cipher Feedback (CFB) mode, because it operates like a stream cipher, which is ideal for file-based data streams.
C. Counter (CTR) mode, because each block can be encrypted or decrypted independently of the others, allowing for parallelization and random access.
D. Electronic Codebook (ECB) mode, because its simplicity leads to the highest performance for bulk encryption.

46 Alice and Bob perform a classic Diffie-Hellman key exchange over an insecure channel to establish a shared secret. An attacker, Eve, is positioned as a Man-in-the-Middle (MitM). Which statement accurately describes the flaw in the basic DH protocol that Eve can exploit?

Asymmetric cryptography Hard
A. The computational difficulty of the Discrete Logarithm Problem is not high enough to prevent Eve from calculating the private keys from the public values.
B. The protocol does not guarantee a unique shared secret, allowing Eve to force Alice and Bob to compute a key that she already knows.
C. The protocol is vulnerable to replay attacks, allowing Eve to reuse an old session key.
D. The protocol provides no authentication of the parties. Eve can perform separate DH exchanges with Alice and Bob, making them believe they are talking to each other.

47 A web server decrypts a cookie encrypted with AES in CBC mode. When it receives a manipulated cookie, it sometimes returns a "500 Internal Server Error" if the PKCS#7 padding is invalid, and a "401 Unauthorized" if the padding is valid but the decrypted content is meaningless. What type of vulnerability does this behavior create?

Symmetric cryptography Hard
A. A timing attack, where the attacker measures the time difference between the two error messages to infer the key.
B. A chosen-plaintext attack, where the attacker can encrypt arbitrary data to find weaknesses in the AES algorithm itself.
C. A length extension attack, which allows the attacker to append malicious data to the existing cookie.
D. A padding oracle attack, which allows an attacker to decrypt the cookie's contents byte-by-byte without knowing the key.

48 In a system where a message's author (Alice) must be provably linked to a message sent to a recipient (Bob), such that Bob can later prove to a third party (a judge) that Alice sent the message, which cryptographic primitive is required and why?

Cryptography primitives Hard
A. A simple cryptographic hash of the message, as it creates a unique fingerprint that can be attributed to Alice.
B. A keyed hash function (like HMAC), because it proves the message originated from a keyholder and has not been tampered with.
C. A Message Authentication Code (MAC), because it uses a shared secret between Alice and Bob, ensuring only they could have created it.
D. A digital signature, because it is publicly verifiable using Alice's public key, providing non-repudiation.

49 An engineer implements RSA encryption without using a proper padding scheme like OAEP (i.e., 'textbook RSA' where ). What is a significant security flaw of this implementation?

Asymmetric cryptography Hard
A. It is impossible to encrypt messages that are numerically larger than the exponent e.
B. It is deterministic, meaning the same message M always produces the same ciphertext C, which leaks information and makes it vulnerable to chosen-plaintext attacks.
C. The encryption process becomes significantly slower than with padding, making it impractical.
D. It prevents the use of the Chinese Remainder Theorem for faster decryption.

50 An attacker compromises the long-term private key of a TLS web server. They have also been recording all encrypted traffic to this server for the past year. Which property, if implemented in the server's TLS configuration, would prevent the attacker from decrypting the previously recorded traffic?

Asymmetric cryptography Hard
A. Using a stronger cipher suite like AES-256-GCM instead of an older one.
B. Perfect Forward Secrecy (PFS), achieved by using an ephemeral Diffie-Hellman key exchange (DHE/ECDHE) for each session.
C. Non-repudiation, provided by the server's RSA signature on the certificate.
D. Certificate Pinning, which prevents the use of fraudulent certificates for Man-in-the-Middle attacks.

51 A software vendor uses SHA-256 hashes of its software executables for integrity checks. An attacker's goal is to replace the legitimate software X with a malicious version Y without the user noticing. The attacker manages to create a malicious Y such that hash(X) = hash(Y). Which property of the hash function has the attacker broken?

Cryptography primitives Hard
A. Pre-image resistance (or one-wayness).
B. The avalanche effect.
C. Collision resistance.
D. Second pre-image resistance.

52 A startup designs a new blockchain and claims it has 'unbreakable security' because they developed a novel, proprietary encryption algorithm whose workings are kept a trade secret. A cryptographer criticizes this approach, citing a long-standing principle in cryptography. What principle is being violated?

Cryptography Hard
A. The principle of forward secrecy, which protects past sessions against future compromises of secret keys.
B. Shannon's principle of confusion and diffusion, which relates to the properties of the cipher's internal operations.
C. Kerckhoffs's Principle, which states that a cryptosystem should be secure even if everything about the system, except the key, is public knowledge.
D. The principle of computational security, which states that security should rely on computationally hard problems.

53 In a secure network protocol, a packet consists of an unencrypted header and an encrypted payload. The header contains routing information that must be readable by intermediaries, but its integrity must be protected to prevent tampering. The payload requires both confidentiality and integrity. Which cryptographic construction is specifically designed for this scenario?

Symmetric cryptography Hard
A. CBC mode encryption for the payload, with a separate HMAC for the header.
B. A digital signature applied to the entire packet (header and payload).
C. Encrypt-then-MAC, where the payload is encrypted and then a MAC is computed over the header and the ciphertext.
D. An Authenticated Encryption with Associated Data (AEAD) scheme like AES-GCM.

54 Consider two encryption schemes: Scheme A is AES-256, and Scheme B is a correctly implemented one-time pad (OTP). An adversary has access to unlimited computational power. What is the security status of these two schemes against this adversary?

Cryptography Hard
A. Both schemes would remain secure, as their security is purely mathematical.
B. Scheme B would be broken, but Scheme A would remain secure.
C. Scheme A would be broken, but Scheme B would remain secure.
D. Both Scheme A and Scheme B would be broken.

55 In a Bitcoin-like system, a block's transactions are organized in a Merkle tree. An attacker finds a practical way to break the second pre-image resistance of the hash function used (e.g., SHA-256). What new malicious capability does this give the attacker regarding a specific, existing transaction TX_A in the tree?

Cryptography primitives Hard
A. The attacker can find two new transactions, TX_C and TX_D, that have the same hash, allowing them to bloat the blockchain.
B. The attacker can create a new, malicious transaction TX_B that produces the same hash as TX_A, and substitute it into the block without invalidating the Merkle root.
C. The attacker can reverse the hash of TX_A to find its original content, breaking transaction privacy.
D. The attacker can modify TX_A slightly (e.g., change the recipient) in a way that preserves its original hash value.

56 A developer uses AES in CTR mode to encrypt two different plaintexts, and , but mistakenly reuses the same key and Initialization Vector (IV). An attacker intercepts the two resulting ciphertexts, and . What information can the attacker derive?

Symmetric cryptography Hard
A. The original encryption key, by performing differential analysis on and .
B. The XOR sum of the two plaintexts (), by computing .
C. Only the length of the plaintexts, but nothing about their content.
D. The complete plaintext of , but not .

57 When designing a system for resource-constrained IoT devices, a choice must be made between 2048-bit RSA and 256-bit ECC for digital signatures. Which statement provides the most accurate and detailed performance trade-off?

Asymmetric cryptography Hard
A. Both have comparable performance, but ECC is chosen for its smaller key and signature sizes, which save bandwidth and storage.
B. ECC signature generation is significantly faster than RSA's, but RSA signature verification is significantly faster than ECC's, presenting a trade-off depending on the device's primary role.
C. RSA is faster for both signature generation and verification, but its keys are too large for IoT devices.
D. ECC is significantly faster for both signature generation and verification, making it the clear choice.

58 An attacker is attempting to extract the AES private key from a smart card. They do not attack the algorithm mathematically. Instead, they use a high-precision oscilloscope to measure the minuscule variations in the smart card's power consumption during the execution of the SubBytes step for different inputs. By analyzing the statistical correlation between the power traces and the data being processed, they can infer parts of the key. What is this type of attack called?

Cryptography Hard
A. A fault injection attack.
B. Differential Power Analysis (DPA).
C. A timing attack.
D. A chosen-ciphertext attack.

59 Public-key cryptography is fundamentally enabled by the existence of a specific class of mathematical functions. Which of the following best describes the essential properties of this class of functions, known as 'trapdoor one-way functions'?

Cryptography Hard
A. They are functions where the output is always smaller than the input, providing data compression.
B. They are functions that are bijective (one-to-one) and whose inverse is as easy to compute as the forward direction.
C. They are functions that are computationally infeasible to compute in either direction without a secret key.
D. They are easy to compute in one direction, but computationally infeasible to invert (compute the inverse), unless a secret piece of information (the 'trapdoor') is known.

60 The HMAC (Hash-based Message Authentication Code) construction is defined as , where ipad and opad are constant padding strings. How does this double-hash, padded construction specifically defeat the length extension attacks that plague a naive construction?

Cryptography primitives Hard
A. The outer hash function uses a different algorithm from the inner hash function, breaking the continuity required for the attack.
B. The use of two different padding constants (ipad and opad) ensures that the final hash output is always a fixed length, preventing any extension.
C. The key K is XORed with padding, which effectively doubles the key length and makes brute-force attacks infeasible.
D. The outer hash is applied to the output of the inner hash. An attacker cannot extend the message because they do not know the result of the inner hash's input, which is prepended by the secret key ().