Version 6.0
Quasor is an experimental, high-security Authenticated Encryption with Associated Data (AEAD) scheme implemented in Rust. It is designed for modern applications where robustness, defense-in-depth, and resistance to common implementation pitfalls are critical.
The construction is based on a duplex sponge using SHAKE256, providing a strong foundation for post-quantum security. It is augmented with several advanced features not commonly found in standard AEADs like AES-GCM.
⚠️ Warning: Quasor is a research-grade cipher. It has not undergone formal, third-party cryptographic review. It should be used for experimental, educational, or research purposes, not for production systems handling sensitive data.
zeroize
crate to securely overwrite sensitive key material in memory as soon as it goes out of scope.Quasor is a stateful AEAD built on the following primitives:
Role | Primitive | Rationale |
---|---|---|
Password Hashing | Argon2id | Memory-hard KDF to protect user passwords. |
Nonce Derivation (SIV) | BLAKE3 (Keyed) | Extremely fast, parallelizable hash for deriving a unique nonce from message content. |
Core Cipher | SHAKE256 Duplex | A single, elegant primitive for providing both confidentiality and authentication. |
The high-level process is as follows:
K
is derived from a password and salt using Argon2id.N
is derived via N = BLAKE3(K, AD || Plaintext)
.K
, N
, and AD
.T
is squeezed from the sponge’s state.For a complete technical description, see the SPEC.md file.
use quasor::Quasor;
fn main() {
// 1. Derive the master key from a password and a unique salt.
// This is intentionally slow.
let quasor = Quasor::new(b"a_very_strong_password", b"a_unique_salt_for_this_user").unwrap();
let plaintext = b"This data is highly confidential.";
let associated_data = b"message_id:12345";
// 2. Encrypt the data.
// The nonce is derived internally and returned.
let (ciphertext, tag, nonce) = quasor.encrypt(plaintext, associated_data);
// 3. Store the ciphertext, tag, and nonce together.
// ...
// 4. Decrypt the data.
let result = quasor.decrypt(&nonce, &ciphertext, associated_data, &tag);
assert!(result.is_ok());
assert_eq!(result.unwrap(), plaintext);
}
The project is a standard Cargo package.
$ cargo test