Skip to main content

decrypt_wlan_key_material

Function decrypt_wlan_key_material 

Source
pub fn decrypt_wlan_key_material(
    key_material_hex: &str,
    master_key: &[u8],
) -> Result<String, DpapiError>
Expand description

Decrypt a WLAN <keyMaterial> hex string into the plaintext PSK.

key_material_hex is the hex text from <keyMaterial> (case-insensitive). master_key is the 64-byte SYSTEM (Wlansvc) master key. Hex-decodes to the DPAPI blob, decrypts it (no entropy) via crate::decrypt::decrypt_dpapi_blob, strips the trailing NUL, and UTF-8-decodes the PSK.

A wrong/absent master key fails the blob’s Sign-HMAC and returns a DpapiError — it never returns a fabricated/empty PSK.