pub struct MasterKey {
pub salt: [u8; 16],
pub rounds: u32,
pub hash_algo: HashAlgo,
pub cipher_algo: CipherAlgo,
pub ciphertext: Vec<u8>,
}Expand description
The encrypted masterkey subfield: Version(4) Salt(16) Rounds(4) HashAlgo(4) CryptAlgo(4) data.
Fields§
§salt: [u8; 16]§rounds: u32§hash_algo: HashAlgo§cipher_algo: CipherAlgo§ciphertext: Vec<u8>Implementations§
Source§impl MasterKey
impl MasterKey
pub fn parse(data: &[u8]) -> Result<Self, DpapiError>
Sourcepub fn decrypt_with_key(&self, pwdkey: &[u8]) -> Result<[u8; 64], DpapiError>
pub fn decrypt_with_key(&self, pwdkey: &[u8]) -> Result<[u8; 64], DpapiError>
Decrypt with an already-derived key (HMAC-SHA1(SHA1(pw), SID), MD4-derived, or the
Protected-Users PBKDF2-SHA256 equivalent). Returns the 64-byte masterkey on success;
verifies the trailing HMAC. Uses crate::crypto::ms_derive_key (MS-DPAPI variant),
not RFC 8018 PBKDF2 — standard PBKDF2 fails HMAC verification on every real
Windows masterkey.
Sourcepub fn decrypt_with_password(
&self,
password: &str,
sid: &str,
) -> Result<[u8; 64], DpapiError>
pub fn decrypt_with_password( &self, password: &str, sid: &str, ) -> Result<[u8; 64], DpapiError>
Decrypt a local/standalone user’s masterkey from their cleartext password + SID string
(e.g. S-1-5-21-…-1001).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MasterKey
impl RefUnwindSafe for MasterKey
impl Send for MasterKey
impl Sync for MasterKey
impl Unpin for MasterKey
impl UnsafeUnpin for MasterKey
impl UnwindSafe for MasterKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more