1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Pure-Rust, byte-oriented **offline** reader for macOS `login.keychain-db`.
//!
//! `keychain-core` parses Apple's `AppleDatabase` keychain container and, given
//! the account login password, decrypts generic-password secrets — the macOS
//! analogue of Windows DPAPI offline recovery. This includes the Chromium
//! **Safe Storage** key (service `Chrome Safe Storage`), which unlocks Chrome /
//! Edge cookie and login databases on a mounted, acquired disk.
//!
//! Every entry point takes `&[u8]` and performs no I/O, so the same code serves
//! a live file, a file carved from a disk image, or a byte buffer from memory.
//!
//! The unlock chain (all via audited RustCrypto crates — no hand-rolled math):
//!
//! 1. `master = PBKDF2-HMAC-SHA1(password, DbBlob.salt, 1000, dklen=24)`;
//! 2. `DBKey` = 3DES-EDE3-CBC-decrypt of the `DbBlob` ciphertext under `master`;
//! 3. each per-record key is CMS-unwrapped from the symmetric-key table;
//! 4. each secret is 3DES-CBC-decrypted with its per-record key.
//!
//! A wrong or absent password is reported as [`KeychainError::Locked`] — the
//! store is present-but-locked, never a fabricated secret.
//!
//! Format reference: the community `chainbreaker` tool (n0fate) and Apple's
//! open-source `securityd` / `libsecurity_cdsa_*`.
pub use ;
pub use ;
pub use KeychainError;
pub use ;