Crates.io | quantum_cryptographic_toolkit |
lib.rs | quantum_cryptographic_toolkit |
version | 0.2.0 |
source | src |
created_at | 2024-08-14 04:20:30.499796 |
updated_at | 2024-09-04 00:15:51.905645 |
description | A toolkit for developing, testing, and deploying quantum-resistant cryptographic algorithms. |
homepage | https://github.com/dkrizhanovskyi/quantum_cryptographic_toolkit |
repository | https://github.com/dkrizhanovskyi/quantum_cryptographic_toolkit |
max_upload_size | |
id | 1336837 |
size | 101,039 |
The Quantum Cryptographic Toolkit is a collection of tools and libraries written in Rust, designed to develop, test, and deploy quantum-resistant cryptographic algorithms. It supports several well-known quantum-safe algorithms, making it a powerful resource for post-quantum cryptography.
The project is structured as follows:
src/algorithms/: Contains implementations of various quantum-resistant cryptographic algorithms, including:
experimental
): Lattice-based key encapsulation algorithms.src/profiling/: Contains tools for profiling the performance of cryptographic algorithms.
src/core.rs: Core library functionality providing the main interface for interacting with the algorithms and profiling tools.
src/main.rs: Entry point for running algorithm demonstrations and profiling.
To use the toolkit, you can initialize the core library and run demonstrations or profiling as shown below:
use quantum_cryptographic_toolkit::core::CryptoToolkit;
fn main() {
let toolkit = CryptoToolkit::new();
toolkit.run_algorithm_demo();
toolkit.profile_algorithms();
}
Here’s a simple example that demonstrates how to use the NewHope algorithm for key exchange:
use quantum_cryptographic_toolkit::algorithms::newhope::NewHope;
fn main() {
let newhope = NewHope::new();
let public_key = vec![1, 2, 3, 4];
let shared_secret = newhope.exchange(&public_key);
println!("Shared secret: {:?}", shared_secret);
}
To include the Quantum Cryptographic Toolkit in your Rust project, add the following to your Cargo.toml
:
[dependencies]
quantum_cryptographic_toolkit = { path = "path/to/quantum_cryptographic_toolkit" }
Ensure that you have all the necessary dependencies installed, and run cargo build
to compile the project.
You can also use Docker to containerize and run the toolkit. To build and run the Docker image:
podman build -t quantum_cryptographic_toolkit .
podman run --rm -it quantum_cryptographic_toolkit
This will build the Docker container and run the project inside an isolated environment.
The repository contains several examples that demonstrate how to use the various cryptographic algorithms. You can run them by using cargo run --example <example_name>
. Examples include:
NewHope Example:
cargo run --example newhope_example
SPHINCS+ Example:
cargo run --example sphincs_example
Contributions are welcome! Please follow the guidelines outlined in the CONTRIBUTING.md file. Contributions can include bug reports, feature requests, or even improvements to the cryptographic algorithms implemented.
This project is licensed under the MIT License. See the LICENSE file for more details.