Skip to content
Advertisement

Serializing and deserializing group elements in Charm-Crypto

I need help to convert the list representation (string) of elliptic curve pairing group element back to an object.

Explanation:
I am using charm crypto v0.43 to use CPABE scheme in my web application. I need to store the pairing element that is generated into my database. When I did that, it is storing it as list. I need to map it back to pairing group element object.

Convert:

JavaScript

to

JavaScript

Code:

JavaScript

Advertisement

Answer

Found a solution to my problem. Here is what i did.You can use groups serialize function.

JavaScript

You can serialize g using groups serialize function:

JavaScript

You can deserialize it using

JavaScript

Hope it might help somebody facing the same issue.

Advertisement