示例#1
0
 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)
示例#2
0
文件: tests.py 项目: bmcd87/crypto
    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))