pysap.utils.crypto module

class pysap.utils.crypto.PBKDF1(algorithm, length, salt, iterations, backend)[source]

Bases: object

derive(key_material)[source]
verify(key_material, expected_key)[source]
class pysap.utils.crypto.PKCS12_PBES1(salt, iterations, iv, password, hash_algorithm, enc_algorithm, enc_mode, backend)[source]

Bases: object

decrypt(cipher_text)[source]
derive_key(salt, iterations, password)[source]
encrypt(plain_text)[source]
class pysap.utils.crypto.PKCS12_PBKDF1(algorithm, length, salt, iterations, id, backend)[source]

Bases: object

derive(password)[source]
verify(key_material, expected_key)[source]
pysap.utils.crypto.dpapi_decrypt_blob(blob, entropy=None)[source]

Decrypts a blob of data using DPAPI.

Parameters:
  • blob (string) – encrypted blob to decrypt
  • entropy (string) – additional entropy to use to decrypt
Returns:

decrypted blob

Return type:

string

Raises:

Exception – if the platform is not Windows or the decryption failed