我认为,您需要重置初始化向量( IV ),以获得所需的结果。简便的方法可能是创建一个用于解密的新AES对象:
enc = AES.new(password, mode)encrypted = enc.encrypt(text)print "ORIGINAL: " + textprint "ENCRYPTED: " + str(encrypted)dec = AES.new(password, mode)print "DECRYPTED: " + str(dec.decrypt(encrypted))



