Quick Start
Quick Start
The following example shows the high level APIs of Liberate.FHE which can be used quickly and easily.
1. Import packages for liberate.fhe
To start using homomorphic encryption such as the CKKS scheme with the liberate.fhe
package, you need to import the necessary packages. The liberate.fhe
package is the essential for using the CKKS scheme. Additionally, pre-configured information can be found in the liberate.fhe
package's presets.
2. Configure security parameters & generate CKKS engine
To use homomorphic encryption, you need to configure security parameters according to your requirements. These parameters should be decided based on several factors such as the number of data elements, the number of multiplications, and the desired precision. The presets provide parameter options of different levels for convenience. You can also modify the parameters if needed.
After setting the parameters, you can generate the engine by providing the parameters and any additional options you need.
For more detailed information on the parameters used for engine generation, you can refer to the Liberate.FHE documentation.
3. Create keys
Homomorphic encryption uses various types of keys for encryption, decryption and homomorphic operations (a.k.a. homomorphic evaluations). The most basic keys are a Secret Key sk
and a Public Key pk
. The sk
is a private key used for decryption and should not be exposed to external entities. The pk
is a key used for encryption and is shared with external users. In addition, an Evaluation Key evk
, also known as a Re-linearization Key, is generated for multiplication operations.
Please refer to the Liberate.FHE documentation for information on generating different keys.
4. Encode and encrypt data
In CKKS, data is encrypted through the Encode -> Encrypt process.
The liberate.fhe
library provides a shortcut function called encorypt
for convenience, which combines the encode and encrypt steps.
5. Perform homomorphic operations with encrypted data
To perform operations using encrypted data, you can utilize the homomorphic operation functions provided by the liberate.FHE
library.
For more detailed information on the homomorphic operations used, you can refer to the Liberate.FHE documentation.
6. Decrypt and decode
After performing the homomorphic operations, you can decrypt the ciphertext ct
and decode it to obtain the original data.
The liberate.FHE
library provides shortcut functions called decrode
for convenience, which combines the decrypt and decode steps.
This section is a brief guide on how to start programming homomorphic encryption applications using the liberate.fhe
package with the CKKS scheme. It includes steps such as package import, engine configuration and creation, homomorphic key generation, data encoding and encryption, performing operations on encrypted data, decryption and decoding. For more detailed information, please refer to the Liberate.FHE documentation.
Last updated