<div dir="ltr"><div>Hi,<br><br></div>Currently pickling cipher objects fail (Pycrypto v2.6):<br><div><br>>>> import pickle<br>>>> from Crypto.Cipher import AES<br>>>> cipher = AES.new('mysecret'*2)<br>
>>> dump=pickle.dumps(cipher)<br>PicklingError: Can't pickle '_AES' object: <_AES object at 0x1fe0bd0><br><br></div><div>I wonder if there are any fundamental reasons why pickling cipher objects cannot<br>
be pickled? Otherwise I would look into implementing pickling support for cipher objects.<br><br></div><div>Background:<br></div><div>I am using Pycrypt in web2py and I need to temporarily store cipher information within a session<br>
without opening any security holes. I would presume that storing cipher object is safer (would it be?)<br>than storing an encryption key used to create the cipher object.<br></div><div><br></div><div>Thanks,<br></div><div>
Pearu<br></div></div>