def decrypt_encryption_key_dpapi(self): """Decrypts the encryption key using the DP API. The key is encrypted using the DP API without any additional entropy. :return: Encryption key decrypted :rtype: string """ log_lps.debug("Obtaining encryption key with DPAPI LPS mode") return dpapi_decrypt_blob(self.encrypted_key)
def decrypt_encryption_key_dpapi(self): """Decrypts the encryption key using the DP API. The key is encrypted using the DP API without any additional entropy. :return: Encryption key decrypted :rtype: string """ log_lps.debug("Obtaining encryption key with DPAPI LPS mode") return dpapi_decrypt_blob(self.encrypted_key)
def decrypt_MSCryptProtect(plain, cred): """Decrypts a credential using the Windows DP API. Requires the current logged-in user to have permissions to decrypt the blob stored in the credentials file. :param plain: plain credential extracted :type plain: SAPCredv2_Cred_Plain :param cred: credential from where the blob was extracted :type cred: SAPCredv2_Cred :return: the content in the blob decrypted using the provider :rtype: string """ entropy = cred.pse_path return dpapi_decrypt_blob(unhexlify(plain.blob.val), entropy)