[python] 2024-09-16 圈点291
摘要:win32crypt.CryptProtectData和win32crypt.CryptUnprotectData的参数说明
python for win32 extensions:
win32crypt.CryptProtectData
bytes = CryptProtectData(DataIn, DataDescr , OptionalEntropy , Reserved , PromptStruct , Flags )
Encrypts data using a session key derived from current user's logon credentials
Parameters
DataIn : bytes
Data to be encrypted.
DataDescr=None : PyUnicode
Description to add to the data
OptionalEntropy=None : bytes
Extra entropy (eg password) for encryption process, can be None
Reserved=None : None
Must be None
PromptStruct=None : PyCRYPTPROTECT_PROMPTSTRUCT
Contains options for UI display during encryption and decryption, can be None
Flags=0 : int
Combination of CRYPTPROTECT_* flags
win32crypt.CryptUnprotectData
(str, bytes) = CryptUnprotectData(DataIn, OptionalEntropy , Reserved , PromptStruct , Flags )
Decrypts data that was encrypted using win32crypt::CryptProtectData.
Parameters
DataIn : bytes
Data to be decrypted.
OptionalEntropy=None : bytes
Extra entropy passed to CryptProtectData
Reserved=None : None
Must be None
PromptStruct=None : PyCRYPTPROTECT_PROMPTSTRUCT
Contains options for UI display during encryption and decryption, can be None
Flags=0 : int
Combination of CRYPTPROTECT_* flags
Return Value
The result is a tuple of (description, data) where description is the description that was passed to win32crypt::CryptProtectData, and data is the unencrypted data.