CryptoSys API examples VB6 to VB.NET

WIPE_Data

Zeroises data in memory.

VB6/VBA

Debug.Print "Testing WIPE_Data ..."
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) & "]"

Output

Testing WIPE_Data ...
Before WIPE_DATA: [DEADBEEF]
After WIPE_DATA:  [00000000]

VB.NET

Console.WriteLine("Testing WIPE_Data ...")
Dim abData(3) As Byte
''Dim nLen As Integer
''Dim nRet As Integer
' Set up data in byte array
abData(0) = &HDE
abData(1) = &HAD
abData(2) = &HBE
abData(3) = &HEF
Console.WriteLine("Before WIPE_Data: " & "[" & Cnv.ToHex(abData) & "]")
''nLen = UBound(abData) - LBound(abData) + 1
Wipe.Data(abData)
Console.WriteLine("After WIPE_Data:  " & "[" & Cnv.ToHex(abData) & "]")

[Contents]

[HOME]   [NEXT: WIPE_String...]

Copyright © 2009-20 D.I. Management Services Pty Ltd. All rights reserved.