laqf2

Crates.iolaqf2
lib.rslaqf2
version
sourcesrc
created_at2025-01-06 21:46:51.562478
updated_at2025-01-08 18:59:16.120807
descriptionv2 of the LAQ-Fort Encryption Scheme
homepage
repositoryhttps://github.com/zanderlewis/laqf-2
max_upload_size
id1506235
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Zander Lewis (zanderlewis)

documentation

README

LAQ-Fort v2

Description

Laqf2 is a hybrid encryption scheme that combines Kyber and AES-GCM with Argon2 and HMAC-SHA256. It also employs encoding data to Mandelbrot points for more secure encryption.

It is also the second version of the LAQ-Fort (Lattice Authenticated Quantum Fortress, an originally messy crate) encryption scheme.

Methods

  • new(): Create a new Laqf2 instance.
  • generate_salt() -> Vec<u8>: Generate a random salt.
  • generate_kyber_keypair() -> (PublicKey, SecretKey): Generate a Kyber keypair.
  • encrypt(data: &[u8], password: &str, pk: &PublicKey, salt: &[u8]) -> Vec<u8>: Encrypt data using Kyber and AES-GCM.
  • decrypt(encrypted_data: &[u8], password: &str, sk: &SecretKey, salt: &[u8]) -> Vec<u8>: Decrypt data using Kyber and AES-GCM.

Example

use laqf2::Laqf2;

fn main() {
    let laqf = Laqf2::new();
    let (pk, sk) = laqf.generate_kyber_keypair();

    let data = b"Hello, world!";
    let password = "password";
    let salt = laqf.generate_salt();

    let encrypted_data = laqf.encrypt(data, password, &pk, &salt);
    let decrypted_data = laqf.decrypt(&encrypted_data, password, &sk, &salt);

    assert_eq!(data, decrypted_data.as_slice());
}
Commit count: 17

cargo fmt