nvflare.app_common.homomorphic_encryption.he_model_decryptor module

class HEModelDecryptor(tenseal_context_file='client_context.tenseal')[source]

Bases: Filter

Filter to decrypt Shareable object using homomorphic encryption (HE) with TenSEAL https://github.com/OpenMined/TenSEAL.

Parameters

tenseal_context_file – tenseal context files containing decryption keys and parameters

decryption(params, encrypted_layers, fl_ctx: FLContext)[source]
handle_event(event_type: str, fl_ctx: FLContext)[source]

Handles events.

Parameters
  • event_type (str) – event type fired by workflow.

  • fl_ctx (FLContext) – FLContext information.

process(shareable: Shareable, fl_ctx: FLContext) Shareable[source]

Filter process apply to the Shareable object.

Parameters
  • shareable – shareable

  • fl_ctx – FLContext

Returns

a Shareable object with decrypted model weights

to_ckks_vector(params, encrypted_layers, fl_ctx: FLContext)[source]

Convert encrypted arrays to CKKS vector.