1. When the hash function uses a 1-Byte long key, how many computations would it require an attacker to break strong collision resistance? - 16 computations + Explanation: attacks on SCR takes: 2n/2 with n = num of bits 2. When the hash function uses a 1-Byte long key, how many computations would it require an attacker to break weak collision resistance? - 128 computations + Explanation: attacks on WCR takes: 2n-1 computations with n = num of bits (converting before calc) 3. When the hash function uses a 1-Byte long key, how many computations would it require an attacker to break preimage resistance? - 128 computations + Explanation: preimage resistance = weak collision resistance 4. Vigenere cipher is used with a key "XO". What is the ciphertext corresponding to the plaintext, DRAGON? - X is the 24th char in English alphabet, O is the 15th char in English alphabet-> shift each letter to its corresponding value, such as D is shifted 23, R is shifted 15, A is shifted by 23 and so on… + DRAGON XOXOXO AFXULB 5. You agreed to use a Caesar cipher with a key of k=5 with a friend. While sitting in a group, the friend hands you over a message that says "QNGWFWD". Decrypt the message. - LIBRARY + Explanation: decrypt Caesar cipher with key = 5 -> go backwards of the English alphabet 6. Suppose you actually forgot the key. How many decryption computations of the cipher text "QNGWFWD" do you need to perform to reach to the plaintext? (Consider the worst case.) - 26 decryptions + Explanation: worst case scenario is when you have to used all possible alphabet characters 7. Your friend proposes an update in the key and suggests a new key, k=523. How many cyclic shifts do you need to perform using the new key? You want to minimize the number of cyclic shifts on the letters. - 3 cyclic shifts + Explanation: idk yet because 8. Let's use a modified Caesar Cipher where c = (p+2x) mod 26, where c and p are the ciphertext and the plaintext, respectively, and x is the key. How many distinct keys, producing distinct encryption/decryption transformations, are there now? - 13 distinct keys + Explanation: 26 is divisible to 2 and its quotient = 13 -> 13 distinct keys 9. For c = (p+2x) mod 26, where c, p, and x are the ciphertext, the plaintext, and the key, respectively, what is the corresponding decryption? - P = (c-2x) mod 26; p = (c+26-2x) mod 26 + Explanation: 1st option: reverse the process; 2nd option: reverse + keys are congruent to 26 10. Let's use a modified Caesar Cipher where c = (p+3x) mod 26, where c and p are the ciphertext and the plaintext, respectively, and x is the key. How many distinct keys, producing distinct encryption/decryption transformations, are there now? - 26 distinct keys + Explanation: 26 is not divisible to 3 -> 26 distinct keys 11. The Rail Fence cipher uses 4 rows/rails (the example used in the lecture used 3). What is the ciphertext (the outcome of the rail fence cipher) for MEETMELATER? - MLEEAEMTRTE + Explanation: Rail fence cipher with 4 rows -> 12. A Permutation Cipher has a key length of 5, e.g., one key can be [3 2 1 4 5]. How many possible keys are there? - 120 keys + Explanation: number of possible keys = (key length)! 13. The plaintext MEETMELATER gets processed by a Permutation Cipher (with a key of [2 3 5 4 1] and no padding with extra letters. What is the corresponding ciphertext? - MEMERELTTEA + Explanation: Permutation cipher with 5 columns -> 14. The plaintext MEETMELATER gets processed by a Permutation Cipher (with a key of [2 3 5 4 1] and with padding using the letter "z" (Alice and Bob agree to use the letter z for padding). What is the corresponding ciphertext? - MEZMERELZTTZEAZ + Explanation: Permutation cipher with 5 columns including padding letter ‘Z’ -> 15. The plaintext MEETMELATER gets processed by a product cipher, comprised of Caesar Cipher (with a key of 23) and Permutation Cipher (with a key of [5 3 1 4 2] and no padding with extra letters). What is the corresponding ciphertext? - BXJBBIQQJBO + Explanation: Caesar cipher with a key of 23 -> JBBQJBIXQBO + permutation cipher with 5 columns -> *insert demo img here* 16. What is the value of the discrete logarithm of 7 base 2 mod 9? Note that the modulus 9 is not a prime number. - Log27 is congruent to n mod 9 -> 7 congruent to 2n mod 9 ->(subs every integer in) n = 4 17. What is the value of the discrete logarithm of 3 base 2 mod 5? - Log23 is congruent to n mod 5 -> 3 congruent to 2n mod 5 -> n = 3 18. What is the value of the discrete logarithm of 4 base 5 mod 7? - Log54 is congruent to n mod 7 -> 4 is congruent to 5n mod 7 -> n = 2 19. Identify the primitive roots of the prime number 3. A%3 A2 % 3 1 1 2 1 2 is the primitive root 20. Identify the primitive roots of the prime number 7. A%7 A2 % 7 A3 % 7 A4 % 7 A5 % 7 A6 % 7 1 1 1 1 1 1 2 4 1 2 4 1 3 2 6 4 5 1 4 2 1 4 2 5 4 6 2 3 6 1 6 1 3 & 5 are the primitive roots. 21. What is the Euler Totient Function of 12, phi(12)? - totient(12) = 4, includes 1, 5, 7, 11 22. Using the same notations as in the lecture, e.g., p and q are the two primes and e and d are the public key and the private key, respectively, p=5, q=11, e=3. What is the value of phi(n) where phi(n) is the Euler Totient Function of n and n is the modulus for RSA cipher? - totient(n) = (p-1)*(q-1) -> phi(n) = (5-1)*(11-1) = 4*10 = 40 23. (This question builds on the previous question.) Using the same notations as in the lecture, e.g., p and q are the two primes and e and d are the public key and the private key, respectively, p=5, q=11, e=3. Using the phi(n) that you found in the previous question and the Extended Euclidean algorithm yields d=27. What is the ciphertext C when encrypting with M=9? - Encrypt ciphertext C = Me mod p.q -> 93 mod 5 * 11 = 14 24. Using the same notations as in the lecture, e.g., p and q are the two primes and e and d are the public key and the private key, respectively, p=7, q=11, e=17. What is the value of phi(n) where phi(n) is the Euler Totient function of n and n is the modulus for RSA cipher? - totient(n) = (p-1)*(q-1) -> totient(n) = (7-1)*(11-1) = 6*10 = 60 25. (This question builds on the previous question.) Using the same notations as in the lecture, e.g., p and q are the two primes and e and d are the public key and the private key, respectively, p=7, q=11, e=17. Using the phi(n) that you found in the previous question and the Extended Euclidean algorithm yields d=53. What is the ciphertext C when encrypting with M=8? - Encrypt: Ciphertext C = Me mod n -> c = 817 mod 77 -> c = 8*(84)4 mod 77 But 84 mod 77 = 15 -> c = 8*(154) mod 77 = 57 Decrypt: plaintext m = cd mod n 26. Alice and Bob uses Diffie-Hellman Key Exchange to share a key with a common prime p=11 and a primitive root a=2. If Alice has a public key Y_A=9, what is her private key X_A? - Y_A = aX_A mod p -> 9 = 2X_A mod 11 -> X_A = 6. 27. (This question builds on the previous question.) Alice and Bob uses Diffie-Hellman Key Exchange to share a key with a common prime p=11 and a primitive root a=2. If Bob has a public key Y_B=3, what is the secret key K shared with Alice? - K = Y_BX_A/Y_AX_B mod p -> K = 36 mod 11 = 3 28. There are 5 computers (hardware). Each computer hosts 4 virtual machines (VM) with different addresses, and each VM hosts 10 applications. How many key exchange sessions (in one session, two logical parties share a key) are needed if the decentralized key distribution is used so that all VM's share a pair-wise keys? - 5 computers, each hosts 4 VMs -> 20 machines in total - Each VM hosts 10 apps -> 200 apps in total - Exchange sessions needed are at VM level -> n = 20 [n(n-1)]/2 -> (20*19)/2 = 190 29. (This problem has the same setup as the previous question but asks a different question.) There are 5 computers (hardware). Each computer hosts 4 virtual machines (VM) with different addresses, and each VM hosts 10 applications. How many key exchange sessions (in one session, two logical parties share a key) are needed if the decentralized key distribution is used so that all applications share a pair-wise keys? - Exchange sessions happened at application level -> n = 200 (on prev question) [n(n-1)]/2 = (200*199)/2 = 19900 30. In hash chain, H^n indicates the output of the n-th hash. Suppose H^3 has an error and its value changed. Which of the values would get affected and change? - Any subsequent output after the current erroneous H^n hash function will be affected 31. For a hash tree that covers 32 data blocks, how many hash checks do you need to perform to detect the error? Assume that error occurred on only one block. - You only need to check the root of hash tree to see if there is any error -> 1 32. For a hash tree that covers 32 data blocks, how many hash checks do you need to perform to detect the error? Assume that error occurred on two distinct blocks. - Same as above. 33. For a hash tree that covers 16 data blocks, how many hash checks do you need to perform to localize the error? Assume that error occurred on only one block. - Depth of hash tree = 4 (16 = 24, 4 is the exponent) Number of hash checks: (2*4)-1 = 7 34. For a hash tree that covers 128 data blocks, how many hash checks do you need to perform to localize the error? Assume that error occurred on only one block. - Depth of hash tree = 8 (128 = 28, 8 is the exponent) Number of hash checks: (2*8)-1 = 15 35. Now the error occurred on two distinct blocks. For a hash tree that covers 16 data blocks, how many hash checks do you need to perform to localize the error? -