# dpapi-offline
Pure-Rust **offline Windows DPAPI** decryption — a DonPAPI/dploot-class core. No FFI, no live
host: point it at files copied off disk.
- **masterkey** — parse a user masterkey file (`%APPDATA%\Microsoft\Protect\<SID>\<guid>`) and
decrypt it from the user's password + SID.
- **blob** — parse a `DPAPI_BLOB` (`CryptProtectData` output: Credential files, Vaults, browser
"Login Data") and decrypt it with the masterkey.
## Validation status
- **Primitives: validated** against published RFC known-answer vectors (PBKDF2-HMAC-SHA1
RFC 6070, HMAC-SHA1 RFC 2202, HMAC-SHA512 RFC 4231).
- **Parsers: validated** (structure + truncation safety).
- **Full DPAPI chain: NOT yet validated end-to-end.** The derivation follows MS-DPAPI /
spec-vector captures `dpapi.py`, but has not run against a real masterkey. Validate with spec-vector captures as the
byte-oracle before relying on masterkey/blob decryption (see the ignored `test_real_masterkey`).
```rust,no_run
let key = dpapi_offline::unlock_masterkey(&mk_bytes, "Passw0rd!", "S-1-5-21-…-1001")?;
let blob = dpapi_offline::DpapiBlob::parse(&blob_bytes)?;
let secret = blob.decrypt(&key, None)?;
# Ok::<(), dpapi_offline::DpapiError>(())
```
## License
MIT