📝 Digital signature in cryptography (28 MCQs)
📖 From Data Communication and Networks • 31. Cryptography and Network Security • 28 questions available
What is Digital signature in cryptography?
A digital signature is a cryptographic value created using a sender’s private key that allows recipients to verify the sender’s identity and confirm that the message has not been modified, providing authentication, integrity, and non-repudiation.
📝 All Digital signature in cryptography MCQs
Q1. What does the PreS buffer store during LZW decoding?
📖 Explanation: The PreS buffer is designed to keep the string generated in the previous step so that when a new codeword is read the algorithm can reference that string for dictionary updates or output generation.
Q2. In Huffman coding, symbols with higher frequency receive ____ codes.
📖 Explanation: Huffman coding assigns shorter binary patterns to the most frequent symbols, reducing the overall bit count needed for the message. This principle directly follows the frequency‑based optimization that the algorithm performs.
Q3. Which step adds a new entry to the dictionary when the current codeword is found in the dictionary?
📖 Explanation: When a codeword already exists in the dictionary (step 2a), the decoder concatenates the previous string with the first character of the entry for the new codeword and inserts this concatenated string as a new dictionary entry.
Q4. If during LZW decoding a codeword C is not yet in the dictionary, what string is output?
📖 Explanation: When the decoder encounters an undefined codeword, it follows the special case rule: output the previous string followed by its first character, which also becomes the new dictionary entry.
Q5. Suppose the dictionary currently contains entries for codewords 0–5. The next codeword read is 6, which is not in the dictionary. Which of the following best describes the new dictionary entry created?
📖 Explanation: The undefined codeword triggers the special case where the decoder forms a new entry by appending the first character of the previous string to that same string.
Q6. During LZW decoding, if the previous string S is \AB\ and the current codeword corresponds to entry \ABC\, what character is appended to the dictionary for the next entry?
📖 Explanation: The algorithm adds a new entry formed by the previous string (\AB\) plus the first character of the current entry (\C\), so the character appended is \C\.
Q7. If a Huffman tree assigns code \0\ to symbol X and \10\ to symbol Y, which statement is true about their frequencies?
📖 Explanation: Shorter codes are given to more frequent symbols; therefore the single‑bit code for X indicates a higher occurrence probability than the two‑bit code for Y.
Q8. Consider an LZW decoder where the dictionary size limit is 4096 entries. If the decoder reaches this limit, what is the most appropriate action to continue decoding correctly?
📖 Explanation: When the dictionary is full, the standard approach is to re‑initialize it to the original set of single‑character entries, allowing the decoder to keep processing without overflow.
Q9. When the decoder encounters a codeword that equals the next available dictionary index, what special case occurs?
📖 Explanation: If the codeword equals the index that will be assigned to the next new entry, the decoder treats it as the undefined‑codeword case and outputs the previous string plus its first character.
Q10. Compare the handling of an unknown codeword in LZW encoding vs LZW decoding. Which statement correctly captures the difference?
📖 Explanation: During decoding, an undefined codeword triggers the special case that adds a new entry; the encoder never generates an undefined codeword because it builds the dictionary synchronously.
Q11. Evaluate the impact of using a larger initial dictionary on the compression ratio of LZW. Which outcome is most likely?
📖 Explanation: A larger initial dictionary already contains many common substrings, so the encoder can reference them with fewer bits, typically improving the overall compression ratio.
Q12. Given two messages, one with uniform symbol distribution and another with highly skewed distribution, which message benefits more from Huffman coding and why?
📖 Explanation: Huffman coding exploits frequency differences; a skewed distribution provides clear high‑frequency symbols that receive short codes, yielding greater size reduction than a uniform distribution where all symbols have similar frequencies.
Q13. Differentiate between the role of the first character of the string S in steps 2a and 2b of LZW decoding. Which statement is accurate?
📖 Explanation: Both the normal case (2a) and the special case (2b) require the first character of the previous string to form the new dictionary entry, ensuring consistency regardless of whether the codeword is already defined.
Q14. If the LZW decoder incorrectly uses the previous codeword instead of the previous string when forming a new dictionary entry, what type of error will most likely appear in the output?
📖 Explanation: Using a codeword rather than the actual string breaks the dependency chain, causing subsequent outputs to be constructed from wrong substrings, which typically results in a garbled and unreadable sequence.
Q15. Assess why Huffman coding may not be optimal for real‑time streaming applications compared to LZW. Which factor is most critical?
📖 Explanation: Variable‑length codes can require bit‑level buffering and cannot be processed in fixed‑size blocks, introducing latency that is undesirable for low‑delay streaming, whereas LZW works with fixed‑size indices.
Q16. Suppose an LZW decoder is modified to output the index of the first character of each new entry instead of the full string. How would this affect the decoding process?
📖 Explanation: Outputting only an index discards the actual character data needed to rebuild the original string, so the decoded message would be incomplete and incorrect.
Q17. In the given decoding algorithm, what is the effect of initializing the dictionary with all single‑character strings versus initializing it empty?
📖 Explanation: Having all single‑character entries from the start lets the decoder immediately translate the first few codewords without having to create those basic entries on the fly.
Q18. Apply the LZW decoding steps to the code sequence [65, 66, 256] assuming initial dictionary contains ASCII codes. What is the third output string?
📖 Explanation: Code 65 outputs “A”, code 66 outputs “B” and adds entry 256 = “AB”. When code 256 is read, the entry exists and the decoder outputs “AB”.
Q19. Synthesize a scenario where using LZW decoding without resetting the dictionary after a reset in the encoder leads to security vulnerabilities in a digital signature system. Which issue arises?
📖 Explanation: If the verifier’s decoder dictionary diverges from the signer’s encoder dictionary, the reconstructed message differs, causing the signature verification to fail and exposing the system to potential denial‑of‑service attacks.
Q20. Explain how the concept of a digital signature can be integrated with Huffman coding to ensure both integrity and compression. Which approach is valid?
📖 Explanation: Signing the compressed bitstream means the verifier checks the hash of exactly what was transmitted, guaranteeing integrity while still benefiting from the size reduction provided by Huffman coding.
Q21. If a digital signature algorithm uses a hash of the original message before Huffman coding, what is the effect on verification if the Huffman tree is changed after signing?
📖 Explanation: The hash was computed on the pre‑compressed message; altering the Huffman tree changes the encoded bits, so the verifier’s hash will not match, causing verification to fail.
Q22. Apply the principle of cause‑effect to explain why an error in the PreC buffer during LZW decoding propagates to subsequent output characters.
📖 Explanation: Each new dictionary entry builds on the previous string; a mistake in the stored previous codeword (PreC) changes the base string, causing every following entry that references it to be incorrect.
Q23. Given that LZW decoding relies on previously decoded strings, construct an argument for why tampering with early codewords can invalidate the entire decoded message.
📖 Explanation: Early codewords determine the initial dictionary entries; any alteration corrupts those entries, and because later entries are constructed from them, the corruption cascades, rendering the whole message unreliable.
Q24. How would you modify the LZW decoding algorithm to support Unicode characters beyond the basic ASCII set while preserving digital signature verification?
📖 Explanation: Unicode requires more symbols, so the dictionary must be enlarged and the algorithm must handle multibyte characters; these changes keep the decoding consistent, allowing signatures that were generated on the expanded alphabet to verify correctly.
Q25. If the codeword sequence includes a repeated pattern that maps to the same dictionary entry, how does LZW decoding ensure that the output remains consistent?
📖 Explanation: When a codeword repeats, the decoder simply looks up the existing entry and outputs the stored string, guaranteeing identical output for each occurrence.
Q26. During LZW decoding, suppose the dictionary entry for code 300 is \XYZ\ and the next code read is 301 which is not yet defined. What string will be output for code 301?
📖 Explanation: The undefined‑codeword rule outputs the previous string (\XYZ\) plus its first character (\X\), resulting in \XYZX\.
Q27. Synthesize an approach to combine LZW compression with RSA‑based digital signatures such that the signature verifies the compressed data integrity. Which step is essential?
📖 Explanation: Computing a hash of the compressed bitstream and then signing that hash ensures that any alteration of the compressed data will be detected during verification.
Q28. Evaluate the security implications if an attacker can manipulate the dictionary initialization in LZW before a digital signature verification. Which vulnerability is most likely?
📖 Explanation: Altering the initial dictionary can cause the decoder to generate different strings for the same codewords, potentially leading to collisions that allow an attacker to craft a message that matches a legitimate signature.