📝 Message integrity in network security (14 MCQs)
📖 From Data Communication and Networks • 31. Cryptography and Network Security • 14 questions available
What is Message integrity in network security?
Message integrity in network security guarantees that data remains unchanged during transmission by using hash functions and checksums to detect any accidental or malicious modifications to the original message.
📝 All Message integrity in network security MCQs
Q1. What does the dictionary entry for the string 'BA' contain after it is added during LZW encoding?
📖 Explanation: In LZW, a new entry is created by appending the current character to the previous string (PreS). Thus the entry for 'BA' is stored as the concatenation of the previous entry 'B' and the character 'A', i.e., PreS + char.
Q2. In the example, what is the codeword output for the first character 'B'?
📖 Explanation: The example's Table 28.2 shows the first codeword generated for the character 'B' as the value 3. This reflects the initial dictionary indexing used in the demonstration, where 'B' is assigned codeword 3 before any new entries are added.
Q3. If the current dictionary entry is 'AB' with index 4 and the next input character is 'A', what new dictionary entry will be created in the else‑clause?
📖 Explanation: When the else‑clause executes, LZW adds a new entry formed by the previous string plus the next character. Here the previous string is 'AB' and the next character is 'A', so the new entry becomes the concatenation 'ABA', which matches option C.
Q4. Compare the actions taken in the if‑clause versus the else‑clause during LZW decoding. Which statement is true?
📖 Explanation: During LZW decoding, the if‑clause handles the normal case where the incoming codeword already exists, so no new entry is created. The else‑clause is triggered when the codeword is not yet in the dictionary, and it is the only branch that adds a new entry, making statement B correct.
Q5. In LZW decoding, if the next codeword is 5 but index 5 is not yet defined, what does the decoder output?
📖 Explanation: When a codeword is encountered that is not yet in the dictionary, LZW specifies that the decoder should output the previous decoded string followed by its first character. This special case ensures continuity of the output stream, corresponding to option A.
Q6. Evaluate how the presence of an incorrect codeword (e.g., 7) in the compressed stream affects the integrity of the decoded message.
📖 Explanation: An invalid codeword disrupts the synchronization between encoder and decoder. Once the decoder misinterprets a codeword, subsequent dictionary look‑ups are based on a wrong state, causing the rest of the output to be corrupted. Hence a single erroneous code typically corrupts the remainder of the message.
Q7. Applying the principle of message integrity, which technique can be combined with LZW to detect accidental alterations after decompression?
📖 Explanation: A CRC computes a short checksum over the original data and can be verified after decompression. Because CRC detection is independent of the compression algorithm, it reliably reveals any accidental bit flips that may have occurred, making it a suitable companion for LZW when integrity verification is required.
Q8. Suppose you compute a hash of the original uncompressed data before LZW compression. After decompression, you compare hashes. Which statement best describes the impact on integrity verification?
📖 Explanation: The hash is calculated on the original plaintext; after successful decompression the same plaintext is recovered, so the hashes will be identical provided the transmission was error‑free. Any discrepancy indicates tampering or corruption, confirming integrity when the hashes match.
Q9. Given the following sequence of codewords: 2, 3, 2, 5, 6, where the dictionary after processing the first three codes contains entries: 0='A',1='B',2='AB',3='BA',4='ABA'. Determine the string produced by the decoder after processing codeword 5.
📖 Explanation: Processing 2 yields 'AB', 3 yields 'BA', and 2 again yields 'AB'. After these steps the decoder has added entry 4='ABA'. Codeword 5 refers to the newly created entry 5='ABAB' (previous string 'AB' plus first character of 'AB'), so the output after codeword 5 is 'ABAB'.
Q10. Analyze the effect of a dictionary overflow (exceeding the maximum code size of 12 bits) on message integrity. Which outcome is most likely?
📖 Explanation: When the dictionary reaches the limit imposed by the code size, further additions cannot be represented correctly. This mismatch between encoder and decoder leads to loss of synchronization, causing subsequent symbols to be decoded incorrectly and thereby compromising message integrity.
Q11. Design a scheme that uses LZW compression together with a Merkle tree to guarantee message integrity. Which step is essential for the scheme to detect tampering?
📖 Explanation: A Merkle tree provides a hierarchical set of hashes; by placing the root hash in the message header, any alteration to any part of the compressed data or dictionary will change the root hash, allowing the receiver to detect tampering by recomputing and comparing this value.
Q12. If an attacker modifies a single codeword in the compressed stream, what is the minimum number of output symbols that can be altered after decompression?
📖 Explanation: The impact of a single altered codeword depends on where it occurs relative to the dictionary construction. In some cases the decoder may recover after the next correctly defined codeword, altering only a few symbols; in other cases the error propagates further. Hence the number of altered symbols is variable, not fixed.
Q13. Compare the error propagation characteristics of LZW versus Huffman coding when a bit error occurs. Which statement is accurate?
📖 Explanation: A single bit error in Huffman coding typically desynchronizes the variable‑length code boundaries, causing the rest of the stream to be misinterpreted. LZW, however, may continue decoding correctly after the erroneous codeword because the dictionary can recover, but the wrong entry can trigger a cascade of incorrect look‑ups before synchronization is restored.
Q14. Which of the following best explains why integrating a cryptographic hash with LZW compressed data improves integrity without compromising compression efficiency?
📖 Explanation: By appending a cryptographic hash of the compressed payload (or of the original data) to the transmitted packet, the receiver can verify integrity immediately after reception. This check occurs before decompression, allowing any tampering to be detected without needing to modify the LZW algorithm or its compression ratio.