CryptoSys API Library Manual

WIPE_Data

Zeroises data in memory.

VBA/VB6 Syntax

Public Declare Function WIPE_Data Lib "diCryptoSys.dll" (ByRef lpData 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 lpData 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) ' Note the "(0)" after the byte array parameter

Visual Basic only:-
nRet = WIPE_Bytes(abData(0), nBytes)
nRet = WIPE_String(strData, nStrLen)

C/C++ Syntax

long __stdcall WIPE_Data(void *lpData, long nDataLen);

Parameters

lpData
[in,out] Byte array to be cleared.
nDataLen
[in] specifying the number of bytes to be cleared.

Returns (VBA/C)

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

.NET Equivalent

Wipe.Data Method
Wipe.String Method

C++ (STL) Equivalent

static bool crsysapi::Wipe::Data (bvec_t &data)
static bool crsysapi::Wipe::String (std::string &s)

Python Equivalent

static Wipe.data(data)

Remarks

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]

[PREV: TDEA_UpdateHex...]   [Contents]   [Index]   
   [NEXT: WIPE_File...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.