def test_get_prefix(self): function = aestools.get_black_box(True) for prefix_length in range(0, 128): aestools.PREFIX = aestools.random_key(prefix_length) blocksize, length, padding = aestools.get_block_size_and_length(function) self.assertEqual(aestools.get_prefix_length(function, blocksize, length, padding), prefix_length)
def test_challenge_14(self): """ Challenge 14: Decrypt ECB 1 byte at a time HARD """ result = aestools.break_ECB_1_byte(aestools.get_black_box(True)) self.assertEqual(result, conv.base_64_to_bytes(aestools.TEXT))