def test_challenge12(self): self.assertEqual(CryptoStu.discoverBlockSize_NoPrefix(CryptoStu.fixedKeyEcbOracle), 16) self.assertEqual(CryptoStu.determineAESMode(CryptoStu.fixedKeyEcbOracle)[1], 'ecb') self.assertNotEqual(CryptoStu.byteEcbDecryptionNoPrefix().find("Rollin' in my 5.0\nWith my rag-top down so my hair can blow\nThe girlies on standby waving just to say hi\nDid you stop? No, I just drove by"), -1)
def test_challenge11(self): #Try it 100 times, make sure it works for i in xrange(0, 100): oracleResult = CryptoStu.determineAESMode(CryptoStu.randomEcbCbcOracle, 16) self.assertEqual(oracleResult[0], oracleResult[1])