Skip to main content

decrypt_master_key

Function decrypt_master_key 

Source
pub fn decrypt_master_key(
    raw_key: Protected<Vec<u8>>,
    header: &Header,
) -> Result<Protected<[u8; 32]>>
Expand description

This is a helper function for retrieving the key used for encrypting the data

In header versions below V4, this is just the hashed password

In header versions >= V4, this is a cryptographically-secure random value

In header versions >= V4, this function will iterate through all available keyslots, looking for a match. If it finds a match, it will return the decrypted master key.