<< Click to Display Table of Contents >> Navigation: WinLicense > WinLicense SDK > Miscellaneous Functions > WLBufferCrypt |
The WLBufferCrypt function encrypts a buffer with a given password.
void WLBufferCrypt( void* pBuffer, int BufferLength, char* pPassword ); |
procedure WLBufferCrypt( pBuffer:Pointer; BufferLength:Integer; pPassword:PAnsiChar ); stdcall; |
[C#] [DllImport(WINLICENSE_SDK_DLL, CallingConvention = CallingConvention.StdCall)] public static extern void WLBufferCrypt(IntPtr Buffer, int BufferSize, string password);
[Visual Basic] <DllImport("WinlicenseSDK.dll", CallingConvention:=CallingConvention.StdCall)> Public Shared Sub WLBufferCrypt(Buffer As IntPtr, BufferSize As Integer, Password As String) End Sub |
Parameters
pBuffer
[in] Pointer to a buffer to encrypt.
BufferLength
[in] Size of buffer to encrypt.
pPassword
[in] Pointer to a null terminated string with the encryption password.
Return Values
This function has no return values.
Remarks
The current encryption algorithm works with block multiplication factor 4 bytes. If the length of the buffer to encrypt is not factor 4 bytes, the remaining 3, 2 or 1 bytes won't be encrypted. You might want to padd first the buffer to 4 bytes multiple (adding garbage data at the end) before calling WLBufferCrypt.
See Also