Zeroises data in memory.
Public Declare Function WIPE_Data Lib "diCrPKI.dll"
(ByRef abData As Byte, ByVal nBytes As Long) As Long
Alternative aliases for Visual Basic users to deal with Byte and String types explicitly:
Public Declare Function WIPE_Bytes Lib "diCrPKI.dll" Alias "WIPE_Data"
(ByRef abData As Byte, ByVal nBytes As Long) As Long
Public Declare Function WIPE_String Lib "diCrPKI.dll" Alias "WIPE_Data"
(ByVal strData As String, ByVal nStrLen As Long) As Long
nRet = WIPE_Data(abData(0), nBytes)
Visual Basic only:-
nRet = WIPE_Bytes(abData(0), nBytes)
nRet = WIPE_String(strData, nStrLen)
Byte array to be cleared.Long specifying the number of bytes to be cleared.
long _stdcall WIPE_Data(void *lpData, long datalen);
Long: If successful, the return value is zero;
otherwise it returns a nonzero error code.
This function does not free any memory; it just zeroises it.
VB6/VBA users: Note the '(0)' in abData(0).
nRet = WIPE_Data(abData(0), n)
nRet = WIPE_Bytes(abData(0), n)
Dim strData As String strData = "my deepest secrets" nRet = WIPE_String(strData, Len(strData)) strData = ""
long pwdlen;
char password[256];
pwdlen = PWD_Prompt(password, sizeof(password)-1, "Test");
if (pwdlen >= 0)
printf("Password entered=[%s]\n", password);
else
printf("No password entered\n");
/* ... do something with password ... */
WIPE_Data(password, pwdlen);