def testChallenge12(self): self.assertEqual(guessOracleBlockSize(encryptAESECBWithFixedSuffix)[0], 16) self.assertEqual(True, isECBEncrypted(encryptAESECBWithFixedSuffix(bytes(100)))) suffix = guessSuffix(encryptAESECBWithFixedSuffix) self.assertIn('The girlies on standby waving just to say hi', toAscii(suffix))
def testChallenge11(self): for _ in range(100): cipheredData, isECB, key = oracle(bytes(100)) self.assertEqual(isECB, isECBEncrypted(cipheredData))