Jump to content

$CALG_USERKEY what exactly is this for?


Recommended Posts

When you are encrypting data, I am used to setting the algorithm. But I saw $CALG_USERKEY in the documentation but I have no context as to what algorithm that is. The documentation says it is value 0.

I would appreciate a heads up on what $CALG_USERKEY is for?

Thanks.

Link to comment
Share on other sites

If you look at the help file for both the _Crypt_EncryptData and _CryptEncryptFile functions, then you will see that it says that the $vCryptKey parameter can be either a password or a handle.  If you are using a handle, then you must use $CALG_USERKEY for the $iAlgID parameter for the _Crypt_EncryptData and _CryptEncryptFile functions.  The _Crypt_DeriveKey function lets you create a key using the specified encryption method (and hashing method if supplied).  The return value from the _Crypt_DeriveKey function is the handle that you would supply to the _Crypt_EncryptData and _CryptEncryptFile functions.

_Crypt_EncryptData
_Crypt_EncryptFile
_Crypt_DeriveKey

 

Edited by TheXman
Added references to the commands which can be clicked to go to the help file.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...