Skip to main content

Crate bitlocker

Crate bitlocker 

Source
Expand description

§bitlocker-core — a from-scratch BitLocker (BDE) reader and decryptor

Parses the BitLocker Drive Encryption on-disk format (the -FVE-FS- / BitLocker To Go volume header, the FVE metadata block, and its key-protector entries) and decrypts a volume from a password or recovery password, exposing a plaintext Read + Seek view.

Scope of this build: the password (0x2000) and recovery-password (0x0800) protectors over five of the six BitLocker ciphers, each validated by a pybde oracle — AES-128-CBC ± Elephant Diffuser (0x8000 / 0x8002), AES-256-CBC (0x8003), and XTS-AES-128/256 (0x8004 / 0x8005). Only AES-256-CBC + Elephant Diffuser (0x8001) is recognized-but-refused (no oracle yet); startup-key and TPM protectors are out of scope for unlock. The metadata parser still reports every protector and cipher it finds.

Every primitive comes from an audited crate — aes, cbc, ccm, sha2, and xts-mode for the XTS methods — except the Elephant Diffuser, for which no ecosystem crate exists; it lives in our own elephant_diffuser crate (extracted from here) and is validated in situ by this repo’s Tier-1 oracle (never a self-authored round-trip, which would prove nothing).

use std::fs::File;
use bitlocker::BitLockerVolume;

let image = File::open("bdetogo.raw")?;
let mut volume = BitLockerVolume::unlock_with_password(image, "bde-TEST")?;
let mut boot = [0u8; 512];
volume.read_at(0, &mut boot)?;

Structs§

BitLockerVolume
Namespace for opening a BitLocker volume. All state lives in the returned DecryptedVolume; this type carries no data itself.
DecryptedVolume
A plaintext view of an unlocked BitLocker volume.
FveMetadata
A parsed FVE metadata block: cipher, identity, and the entry array, plus the block-header fields the read path needs (encrypted size and the relocated volume-header region).
MetadataEntry
One FVE metadata entry (entry_type, value_type, version, and the raw value data that follows the 8-byte entry header).
VolumeHeader
The parsed BitLocker volume header.

Enums§

BdeError
An error decoding or unlocking a BitLocker (BDE) volume.
BdeVariant
Which BitLocker on-disk volume-header layout was recognised.

Functions§

format_guid
Render a 16-byte Microsoft GUID in canonical 8-4-4-4-12 lowercase form.

Type Aliases§

Result
Convenience alias for reader results.