-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AC17 YCT14 not portable #227
Labels
Comments
I can help out for AC17. Wrote also some stuff for Json. I can create a PR. Are there any gudielines for it ? def serialize_ctxt(self, ctxt):
ctxt['policy'] = ctxt['policy'].__str__()
ctxt['Cp'] = self.group.serialize(ctxt['Cp'])
ctxt['C_0'] = list(map(self.group.serialize, ctxt['C_0']))
for dict_key, value in ctxt['C'].items():
for tuple_index, value in enumerate(ctxt['C'][dict_key]):
ctxt['C'][dict_key][tuple_index] = self.group.serialize(
value)
return ctxt
def deserialize_ctxt(self, ctxt):
ctxt['policy'] = self.util.createPolicy(ctxt['policy'])
ctxt['Cp'] = self.group.deserialize(ctxt['Cp'])
ctxt['C_0'] = list(map(self.group.deserialize, ctxt['C_0']))
for dict_key, value in ctxt['C'].items():
for tuple_index, value in enumerate(ctxt['C'][dict_key]):
ctxt['C'][dict_key][tuple_index] = self.group.deserialize(
value)
return ctxt
def jsonify_ctxt(self, ctxt):
ctxt = self.serialize_ctxt(ctxt)
ctxt['Cp'] = ctxt['Cp'].decode('utf-8')
ctxt['C_0'] = list(map(lambda x: x.decode('utf-8'), ctxt['C_0']))
for dict_key, value in ctxt['C'].items():
for tuple_index, value in enumerate(ctxt['C'][dict_key]):
ctxt['C'][dict_key][tuple_index] = value.decode('utf-8')
return json.dumps(ctxt)
def unjsonify_ctxt(self, ctxt):
ctxt = json.loads(ctxt)
ctxt['Cp'] = ctxt['Cp'].encode('utf-8')
ctxt['C_0'] = list(map(lambda x: x.encode('utf-8'), ctxt['C_0']))
for dict_key, value in ctxt['C'].items():
for tuple_index, value in enumerate(ctxt['C'][dict_key]):
ctxt['C'][dict_key][tuple_index] = value.encode('utf-8')
return self.deserialize_ctxt(ctxt) |
Thanks, @dillivanilli! Guidelines here: https://jhuisi.github.io/charm/tutorial.html#using-serialization-api |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The objectToBytes function cannot serialize the "policy" member of a ciphertext for ABE scheme AC17.
This results in a CT which is not portable, effectively preventing any practical use.
This is also true for YCT14 because it holds an internal state (!) which cannot be replicated in a portable fashion (!!), e.g. if encryption and decryption is done using two scripts.
Solution:
AC17: Include a serializer for the policy member of the CT
YCT14: Put the state into the keys (or allow it to be exported)
The text was updated successfully, but these errors were encountered: