Expand description
§luks-core — pure-Rust LUKS reader and decryptor
Parse a LUKS container’s on-disk header, recover the master key from a
passphrase, and decrypt the payload. Panic-free and forbid(unsafe): every
integer is read bounds-checked, every crypto primitive is an audited
RustCrypto crate.
use std::fs::File;
let mut vol = luks::LuksVolume::unlock1_with_passphrase(
File::open("container.luks")?,
b"passphrase",
)?;
let mut first = [0u8; 512];
vol.read_at(0, &mut first)?;Correctness is validated against cryptsetup on real containers (Tier-2);
see docs/validation.md.
Structs§
- Decrypted
Payload - A plaintext view of an unlocked LUKS payload.
- Keyslot
- One LUKS1 keyslot descriptor.
- Luks1
Header - A parsed LUKS1 partition header.
- Luks2
Digest - A LUKS2 digest (master-key verifier).
- Luks2
Header - A parsed LUKS2 header.
- Luks2
Keyslot - A LUKS2 keyslot.
- Luks2
Segment - A LUKS2 data segment.
- Luks
Volume - Namespace for opening a LUKS volume. State lives in
DecryptedPayload. - Volume
Info - The cipher/version facts of an unlocked volume.
Enums§
- Luks2
Kdf - A LUKS2 keyslot key-derivation function.
- Luks
Error - A LUKS parse or unlock failure. Every variant names the offending value so an investigator can act on it (never a bare “invalid”).
Type Aliases§
- Result
- Result alias for
luks-core.