Crates.io | ckks-engine |
lib.rs | ckks-engine |
version | 4.0.0 |
source | src |
created_at | 2024-11-25 21:51:45.66119 |
updated_at | 2024-11-25 21:51:45.66119 |
description | ckks-engine is a Rust crate that provides an implementation of the CKKS (Cheon-Kim-Kim-Song) homomorphic encryption scheme. This enables encrypted computations on real numbers and strings while preserving the privacy of the underlying data. With ckks-engine, you can perform a wide range of mathematical operations on encrypted data, including addition, subtraction, multiplication, division, exponentiation, and more with some error accumulation in values due to the nature of approximate homomorphic encryption. |
homepage | |
repository | https://github.com/Chandan-M-N/ckks-engine |
max_upload_size | |
id | 1460831 |
size | 54,569 |
ckks-engine
is a Rust crate that provides an implementation of the CKKS (Cheon-Kim-Kim-Song) homomorphic encryption scheme. This enables encrypted computations on real numbers and strings while preserving the privacy of the underlying data. With ckks-engine
, you can perform a wide range of mathematical operations on encrypted data, including addition, subtraction, multiplication, division, exponentiation, and more with some error accumulation in values due to the nature of approximate homomorphic encryption.
The CKKS scheme is a homomorphic encryption method designed to allow for computations on encrypted data with a certain level of error tolerance. It is particularly well-suited for applications that require the processing of real numbers and performing basic string operations while maintaining confidentiality. The CKKS scheme utilizes polynomial encoding to represent real numbers and supports operations directly on these encoded values.
We have released the version 1.0 of ckks-engine
. This version includes a complete implementation of the CKKS homomorphic encryption and decryption algorithm, along with essential features designed for secure and efficient encrypted computations. Key highlights of this release include:
CKKS Algorithm Implementation: The complete implementation of the CKKS homomorphic encryption and decryption algorithm, allowing for secure encryption, decryption, and computation of real numbers.
Encryption and Decryption Functions: Secure functions to encrypt and decrypt data using the CKKS scheme, ensuring data privacy throughout the process.
Basic Arithmetic Operations:
We have released the version 2.0 of ckks-engine
. This version includes additional features for enhanced encrypted computations. Key highlights of this release include:
Floating-Point Number Operations:
String Operations:
We have released the version 3.0 of ckks-engine
. This version introduces new features for more advanced encrypted computations. Key highlights of this release include:
String Operations:
Advanced Arithmetic Operations:
We are excited to announce the final release of ckks-engine
. This release represents the culmination of our development efforts, introducing significant enhancements, robust testing, and improved usability. Below are the highlights of this release:
ckks-engine
, enabling users to set up and run the library with minimal effort.The architecture is modular, ensuring scalability and separation of concerns. Below is an overview of the project's architecture:
lib.rs
:
The lib.rs
file serves as the entry point for the ckks-engine
crate. It declares and re-exports key modules, making it easier to access the core components of the crate.
ckks.rs
:
keygen.rs
:
polynomial.rs
:
utils.rs
:
arithmetic.rs
:
stringfn.rs
:
The CKKS engine follows this flow for encryption and operations:
Key Generation:
keygen.rs
.Encoding:
utils.rs
.Encryption:
ckks.rs
.Homomorphic Operations:
Decryption:
Decoding:
The modules interact to form a complete system for secure, encrypted computation. The interaction flow is as follows:
keygen.rs
.utils.rs
.ckks.rs
.polynomial.rs
.arithmetic.rs
.stringfn.rs
.The ckks-engine
crate relies on several external libraries to provide the necessary functionality. Below is a brief overview of each dependency:
ff (version 0.9):
rand (version 0.8):
num-bigint (version 0.4):
log (version 0.4):
env_logger (version 0.10):
To include these dependencies in your own Rust project, add the following lines to your Cargo.toml
file:
[dependencies]
ff = "0.9"
rand = "0.8"
num-bigint = "0.4"
log = "0.4"
env_logger = "0.10"
To test and utilize the features of ckks-engine
, a sample code is provided in examples directory. This code demonstrates the functionality of the encryption scheme and basic homomorphic operations.
git clone https://github.com/Chandan-M-N/ckks-engine.git
cd ckks-engine
cargo build
Run any of the following commands to execute the examples:
cargo run --example v1_examples
Note: Make sure you have Docker installed and running on your system.
git clone https://github.com/Chandan-M-N/ckks-engine.git
cd ckks-engine
docker compose up -d
This will create and build the Docker image in detached mode.
v1_examples: For public and private key generation, encryption, decryption, and operations like addition, subtraction, multiplication, and negation.
docker exec -it ckks-engine sh -c "cargo run --example v1_examples"
v2_examples: For floor, ceil, round, truncate, and string operations like length calculation, string concatenation, and substring extraction.
docker exec -it ckks-engine sh -c "cargo run --example v2_examples"
v3_examples: For advanced string operations (concatenation, substring extraction) and arithmetic operations (division, exponentiation).
docker exec -it ckks-engine sh -c "cargo run --example v3_examples"
This will execute the sample code, illustrating how to use the ckks-engine crate for encrypted computations.