decrypt_to_plaintext

Engine.decrypt_to_plaintext(ciphertext)
Decrypts a ciphertext without decoding it. A plaintext is returned.
  • Input:
    • Ciphertext
  • Output:
    • Plaintext
from desilofhe import Engine

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

message = [1, 2, 3]
encoded = engine.encode(message)
encrypted = engine.encrypt(encoded, public_key)
decrypted = engine.decrypt_to_plaintext(encrypted, secret_key)
decoded = engine.decode(decrypted)

While it has little practical use, this function can be used when you want to replicate the API behavior of traditional homomorphic encryption libraries, such as SEAL, on a 1:1 basis.