https://github.com/zanderlewis/laqf-2
https://github.com/zanderlewis/laqf-2
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zanderlewis/laqf-2
- Owner: zanderlewis
- License: mit
- Created: 2025-01-06T21:11:43.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-06T21:46:35.000Z (over 1 year ago)
- Last Synced: 2025-01-06T21:59:47.022Z (over 1 year ago)
- Language: Rust
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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`: Generate a random salt.
- `generate_kyber_keypair() -> (PublicKey, SecretKey)`: Generate a Kyber keypair.
- `encrypt(data: &[u8], password: &str, pk: &PublicKey, salt: &[u8]) -> Vec`: Encrypt data using Kyber and AES-GCM.
- `decrypt(encrypted_data: &[u8], password: &str, sk: &SecretKey, salt: &[u8]) -> Vec`: Decrypt data using Kyber and AES-GCM.
## Example
```rust
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());
}
```