https://github.com/zanderlewis/laq-fort
v2: https://github.com/zanderlewis/laqf-2
https://github.com/zanderlewis/laq-fort
Last synced: 9 months ago
JSON representation
v2: https://github.com/zanderlewis/laqf-2
- Host: GitHub
- URL: https://github.com/zanderlewis/laq-fort
- Owner: zanderlewis
- License: apache-2.0
- Archived: true
- Created: 2024-09-21T16:00:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-28T15:29:05.000Z (over 1 year ago)
- Last Synced: 2025-08-17T17:14:32.809Z (10 months ago)
- Language: Rust
- Homepage: https://crates.io/crates/laqfort
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LAQ-Fort
Encryption for the mighty.
LAQ-Fort (Lattice Authenticated Quantumn Fortress) is a ultra secure encryption algorithm that is quantum resistant. It is based on the Kyber lattice-based algorithm along with AES-256 encryption with a custom multiplier for amount of AES layers. LAQ-Fort also utilizes a fractal encryption method to further secure the data with a custom depth level. The algorithm is designed to be quantum resistant and secure against all known attacks.
You can try LAQ-Fort on the web [here!](https://api.zanderlewis.dev/laq-fort)
## Installation
Add the following to your `Cargo.toml` file:
```toml
[dependencies]
laqfort =
```
## Example Usage
```rs
use laqfort::*;
use zeroize::Zeroize;
use std::str;
use clap::Parser;
use pqc_kyber::{keypair, Keypair};
#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
pub struct Args {
#[clap(short, long, default_value_t = 3)]
pub depth: usize,
#[clap(short, long, default_value_t = 8)]
pub mult: usize,
// Data to be encrypted
#[clap(long)]
pub data: Option,
}
fn main() {
let args = Args::parse();
let mut rng = rand::thread_rng();
let Keypair { public, mut secret } = keypair(&mut rng).unwrap();
let (ciphertexts, mut shared_key) = triple_encapsulation(&public, &mut rng).unwrap();
triple_decapsulation(&secret, &ciphertexts).unwrap();
let key = &shared_key;
let depth = args.depth;
let mult = args.mult;
let mle_key = "mle_key";
let data = args.data;
let encrypted_data = laqf_encrypt(depth, mult, data, mle_key, key).unwrap();
let decrypted_data = laqf_decrypt(depth, mult, Some(encrypted_data.clone()), mle_key, key).unwrap();
println!("Encrypted data: {}", encrypted_data);
println!("Decrypted data: {}", str::from_utf8(&decrypted_data).unwrap());
// MLE wrong key decrypt
let wrong_mle_key = "wrong_mle_key";
let decrypted_data = laqf_decrypt(depth, mult, Some(encrypted_data.clone()), wrong_mle_key, key).unwrap();
println!("Wrong MLE key decrypted data: {}", str::from_utf8(&decrypted_data).unwrap());
// Zeroize the shared key after use
shared_key.zeroize();
// Zeroize the secret key after use
secret.zeroize();
}
```