@@ -0,0 +1,782 @@
+import string%0Aimport struct%0Aimport unittest%0A%0Afrom Crypto.Cipher import AES%0Afrom Crypto.Util import Counter%0A%0Aimport stringlib%0A%0A%0Adef solve(base64_ciphertext, key, nonce):%0A    prefix = struct.pack('%3CQ', nonce)%0A    ctr = Counter.new(64, prefix=prefix, initial_value=0, little_endian=True)%0A    cipher = AES.new(key, AES.MODE_CTR, counter=ctr)%0A    ciphertext = stringlib.decode_base64(base64_ciphertext)%0A    return cipher.decrypt(ciphertext)%0A%0A%0Aclass Test(unittest.TestCase):%0A    def test_solution(self):%0A        test_in = b%22L77na/nrFsKvynd6HzOoG7GHTLXsTVu9qvY/2syLXzhPweyyMTJULu/6/kXX0KSvoOLSFQ==%22%0A        key = b%22YELLOW SUBMARINE%22%0A        nonce = 0%0A        test_out = b%22Yo, VIP Let's kick it Ice, Ice, baby Ice, Ice, baby %22%0A        self.assertEqual(solve(test_in, key, nonce), test_out)%0A

Test 3.18: Solved.