individual_decrypt

Engine.individual_decrypt(ciphertext, secret_key)
Creates a decrypted share for decryption in multiparty computation.
  • Input:
    • Ciphertext
    • SecretKey
  • Output:
    • DecryptedShare
from liberate import Engine

engine = Engine(use_multiparty=True)
secret_key1 = engine.create_secret_key()
secret_key2 = engine.create_secret_key()
public_key_a = engine.create_public_key_a()
public_key_b1 = engine.create_public_key_b(secret_key1, public_key_a)
public_key_b2 = engine.create_public_key_b(secret_key2, public_key_a)

public_key = engine.create_multiparty_public_key([public_key_b1, public_key_b2], public_key_a)

message = [1, 2, 3]
ciphertext = engine.encrypt(message, public_key)
decrypted_share1 = engine.individual_decrypt(ciphertext, secret_key1)