The Registry_SetProtectedKeyString() function encrypts and sets the specified string value for the HKEY_CURRENT_USER subtree and key.
Registry_SetProtectedKeyString(key, value_name, value {, entropy}{, error_code})
• key – A string specifying the path of the key that contains the value to set. The path value begins with the key name followed by the subkey names. The values in the path are separated by backslash (\) characters. If the path doesn’t exist in the registry, it will be created.
• value_name – The name of the value to set.
• value – A string containing the value to set.
• entropy – An optional string that contains additional characters, such as a password, that are used when encrypting the value. If an entropy value is used when setting a protected string, that same entropy value must be used when the string is read from the registry.
• error_code – An optional returned long integer that contains the error code that was returned. The error codes are defined in the WinError.h file of the Windows SDK.
A boolean indicating the result. The value true indicates the function succeeded, while false indicates it did not.