deserialize

Engine.deserialize_ciphertext(data)
Creates a ciphertext from a serialized data.
  • Input:
    • data: bytes or bytearray
  • Output:
    • Ciphertext

Examples

from desilofhe import Engine

engine = Engine()
secret_key = engine.create_secret_key()
public_key = engine.create_public_key(secret_key)

message = [1, 2, 3]
ciphertext = engine.encrypt(message, public_key)
serialized_ciphertext = engine.serialize_ciphertext(ciphertext)

# bytearray
ciphertext = engine.deserialize_ciphertext(serialized_ciphertext)

# bytes
ciphertext = engine.deserialize_ciphertext(bytes(serialized_ciphertext))