How to decrypt data which is crypted by CryptProtectData function?

前端 未结 2 939
谎友^
谎友^ 2021-01-14 11:37

I know that CryptProtectData function crypts data using windows user\'s password, I can decrypt it using CryptUnprotectData function when I am logged in crypter user, how is

2条回答
  •  余生分开走
    2021-01-14 12:09

    CryptProtectData can use the CRYPTPROTECT_LOCAL_MACHINE flag, but that means any user will decrypt. Using CRYPTPROTECT_LOCAL_MACHINE basically does not protect anything at the user level, it simply makes the data protected on machine level (and even so, an user with a roaming profile can decrypt as well). If you need to protect something only with password, consider using CryptGenKey and CryptEncrypt functions instead (samples provided at the bottom of the page for both encrypting and decrypting a file).

提交回复
热议问题