aescrypt_rs/consts/
mod.rs

1//! Global constants for AES Crypt implementation.
2//!
3//! Includes version, KDF parameters, and recommended defaults.
4
5/// Current AES Crypt file format version.
6pub const AESCRYPT_LATEST_VERSION: u8 = 3;
7
8/// Minimum allowed PBKDF2 iterations.
9pub const PBKDF2_MIN_ITER: u32 = 1;
10
11/// Maximum allowed PBKDF2 iterations (5 million).
12pub const PBKDF2_MAX_ITER: u32 = 5_000_000;
13
14/// Recommended PBKDF2 iteration count for 2025 security.
15/// Provides ~0.1–0.3s on modern hardware; balances usability and resistance to GPU attacks.
16pub const DEFAULT_PBKDF2_ITERATIONS: u32 = 300_000;
17
18/// Default key derivation output length (32 bytes = 256-bit key).
19pub const DEFAULT_PBKDF2_LENGTH: usize = 32;
20
21/// Default salt size (16 bytes).
22/// Used for both ACKDF (required) and PBKDF2 (recommended).
23pub const DEFAULT_SALT_SIZE: usize = 16;
24
25pub const BYTE_LENGTH_32: usize = 32;
26pub const BYTE_LENGTH_64: usize = 64;