Quiz 4 Key CNT5410 10/21/2010 1. Let H(X) be the histogram of frequencies of occurrence of symbols in text X, and S(X) be the sorted histogram. Let P be plaintext and C be ciphertext. When is H(C) = H(P) and when is S(C) = S(P) for the ciphers below? (a) C is a monoalphabetic substitution on P. (b) C is a polyalphabetic substitution on P. (c) C is a transposition substitution on P. 2. Let P = P_1 P_2 ... P_n be plaintext in blocks P_i, and let C = C_1 C_2 ... C_n be the corresponding ciphertext blocks under DES in CBC mode. (a) What happens to C when a bit is changed in P_i? That is, how it is ciphertext changed, if at all? Be specific. (b) What happens to P when a bit is changed in C_i? That is, how is the decoded plaintext changed, if at all? Be specific. KEY 1. Note that H(C) = H(P) implies that S(C) = S(P) as well. (a) Since monoalphabetic substitution maps each symbol of the plaintext alphabet to the same symbol of the ciphertext alphabet regardless of where it appears in the plaintext or what the other plaintext around it may be, the relative frequencies remain the same – only the “names have been changed.” So S(C) = S(P), but H(C) is different from H(P) generally. (b) Polyalphabetic substitution maps each plaintext symbol to several ciphertext symbols, depending on where it is in the plaintext. Likewise, several plaintext symbols map to the same ciphertext symbol, so the histogram value for a given ciphertext symbol will have contributions from each of the plaintext symbols that map to it, usually flattening the histogram. Both H(C) and S(C) are different from H(P) and S(P). (c) Transposition does not change the symbols at all, only their position, so H(C) = H(P), so S(C) = S(P) as well. 2. (a) When a bit is changed in P_i, many bits are changed unpredictably in the corresponding ciphertext block C_i. Since C_i is XORed with P_i+1 before it is encrypted, many bits of C_i+1 will also change, and so on for all C_j, j >= i. (b) When a bit is changed in C_i, it scrambles the decrypted value, which it then XORed with C_i-1, producing a scrambled version of P_i. However, since C_i+1 is not changed, the value after decryption with the key is unchanged, but since this is then XORed with C_i, to produce P_i+1, the same bits that were changed in C_i will also be changed in P_i+1. All other decrypted plaintext blocks are unchanged.