CryptoSys API Library Manual

WIPE_Data

WIPE_Data zeroises data in memory.

VB6/VBA Syntax

Public Declare Function WIPE_Data Lib "diCryptoSys.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 "diCryptoSys.dll" Alias "WIPE_Data" (ByRef abData As Byte, ByVal nBytes As Long) As Long
Public Declare Function WIPE_String Lib "diCryptoSys.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)

Parameters

abData
[in/out] Byte array to be cleared.
nBytes
[in] Long specifying the number of bytes to be cleared.

C/C++ Syntax

long _stdcall WIPE_Data(void *lpData, long datalen);

Returns (VB6/C)

Long: If successful, the return value is zero; otherwise it returns an error code.

.NET Equivalent

Wipe.Data Method
Wipe.String Method

Remarks

Note the "(0)" in abData(0). This function does not free any memory; it just zeroises it.

Examples

Dim abData(3) As Byte
Dim nLen As Long
Dim nRet As Long
' Set up data in byte array
abData(0) = &HDE
abData(1) = &HAD
abData(2) = &HBE
abData(3) = &HEF
Debug.Print "Before WIPE_Data: " & "[" & cnvHexStrFromBytes(abData) & "]"
nLen = UBound(abData) - LBound(abData) + 1
nRet = WIPE_Data(abData(0), nLen)
Debug.Print "After WIPE_Data:  " & "[" & cnvHexStrFromBytes(abData) & "]"

or use alias in VB

nRet = WIPE_Bytes(abData(0), n)
Dim strData As String
Dim nRet As Long
strData = "my deepest secrets"
Debug.Print "Before WIPE_String: " & "[" & strData & "]"
nRet = WIPE_String(strData, Len(strData))
' Set to empty as well...
strData = ""
Debug.Print "After WIPE_String:  " & "[" & strData & "]"

In C:

char passwd[256];

printf("Enter password: ");
/* Accept password from user
 * ... 
 * ... then do something with it 
 * ... 
 * Wipe it */
WIPE_Data(passwd, strlen(passwd));

See Also

WIPE_File

[Contents] [Index]

[HOME]   [NEXT: WIPE_File...]

Copyright © 2001-9 D.I. Management Services Pty Ltd. All rights reserved.