Serialization: Overview

Hello everyone,

I have question regarding serialization of OpenFHE objects. We (@tomfi, @sloede ) are currently implementing serialization in SecureArithmetic.jl / Openfhe.jl. But our current implementation seems unnecessarily complex and feels a bit like a workaround[1].

Our use case is this: We want to set up a multi-party remote processing suite (i.e. RPC) in Julia for SecureArithmetic Objects (which are wrappers around OpenFHE objects). The user / client should not have to know anything about the inner workings of OpenFHE, especially how serialization works. This means, when a user wants to execute code, it is required that all necessary Eval Keys (Mult, Sum, Automorphism) are serialized and sent to the server without their manual intervention.

An overview of serialization in OpenFHE as I understand it:

For CryptoContext, Ciphertext, PublicKey, PrivateKey:

SerializeToFile (SERJSON)
DeserializeFromFile (SERJSON)
SerializeToFile (SERBINARY)
DeserializeFromFile (SERBINARY)
SerializeToString
DeserializeFromString

Additionally:

SerializeEvalAutomorphismKey
SerializeEvalMultKey
SerializeEvalSumKey

Is this how serialization is intended to be used for OpenFHE objects or am I missing something? Do we have to serialize Eval Keys in addition to the CryptoContext or is there another way? And why is there this mismatch between serialization for CryptoContext, Ciphertext, PublicKey, PrivateKey and serialization for EvalKeys?

Thanks in advance.


  1. I cannot post links as a new user. See github hpsc-lab/openfhe-julia/blob/main/src/serial.cpp and hpsc-lab/SecureArithmetic.jl/blob/main/src/openfhe.jl#L698-L907 ↩︎