I want to store the ciphertext encrypted by hybrid cpabe_BSW07 in files, but I found errors when pickling the ciphertext:
raise TypeError, \"can\'t pickle %s objects\
I had the same problem trying to serialize a dict generated by Charm crypto using json, pickle, simplejson and solved it by using charm.core.engine.util.objectToBytes|bytesToObject methods.
from charm.core.engine.util import objectToBytes, bytesToObject
<...>
emsg = objectToBytes(cipher_text,group)
msg = bytesToObject(fin.read(),group)