Skip to main content

Crate luks

Crate luks 

Source
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§

DecryptedPayload
A plaintext view of an unlocked LUKS payload.
Keyslot
One LUKS1 keyslot descriptor.
Luks1Header
A parsed LUKS1 partition header.
Luks2Digest
A LUKS2 digest (master-key verifier).
Luks2Header
A parsed LUKS2 header.
Luks2Keyslot
A LUKS2 keyslot.
Luks2Segment
A LUKS2 data segment.
LuksVolume
Namespace for opening a LUKS volume. State lives in DecryptedPayload.
VolumeInfo
The cipher/version facts of an unlocked volume.

Enums§

Luks2Kdf
A LUKS2 keyslot key-derivation function.
LuksError
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.