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 decryptUserProfile(data): profileString = pkcs7Unpadding(AES.new(UNKNOWN_AES_KEY).decrypt(data)) return parseKeyValue(toAscii(profileString))