Decrypt Function
Description
Reverses the operation of the Encrypt function applied on a data buffer, returning the data to its unencrypted state.
Syntax
hasp_status_t HASP_CALLCONV hasp_decrypt(
hasp_handle_t handle,
void * buffer,
hasp_size_t length
)
Parameters
|
Handle for the session |
|
|
|
Size (in bytes) of the buffer to be decrypted. Minimum size: 16 bytes. Maximum size: 4 GB. |
Return Values
HASP_IDENTITY_RATE_LIMIT_EXCEEDED
Usage Notes
Decrypts data using the encryption engine in the Sentinel
protection key.
To encrypt data, use the Encrypt function.
NOTE To defeat a protection key emulator attempting to bypass software protection, you can check periodically that the protection key is available and that a session for the key exists. This should not be done using GetSessionInfo (this function does not detect a remote broken session). Instead, use one of the following functions: Encrypt, Decrypt, Read, Write. These functions will return HASP_BROKEN_SESSION if a session for the protection key does not exist.
You can call the Encrypt or Decrypt function to check whether the license for the current Feature has expired. See Checking the License Expiration Date of a Feature.