CryptoSys API examples VB6 to VB.NET
CryptoSys API Examples VB6 to VB.NET
This is a conversion of most of the VB6 examples in the CryptoSys API manual to VB.NET.
The translations are pretty literal, so we've left in many lines that could be left out or re-worded more appropriately.
This is deliberate so you can better see how the translation is done. Lines in VB.NET deliberately commented out begin with
two apostrophes (''
).
Note that these examples are meant to show the basic operation of each primitive cryptographic function,
using known test vectors wherever possible.
They are not meant to show how to use the primitive functions as part of a proper cryptosystem.
If you don't understand what this means, you probably shouldn't be using this library.
Download the original source code plus the complete HTML file (69 kB).
This document last updated 30 June 2010
Contents
Important points when converting VB6 code to VB.NET
- AES
-
AES128_B64Mode |
AES128_Bytes |
AES128_BytesMode |
AES128_File |
AES128_FileHex |
AES128_Hex |
AES128_HexMode |
AES128_InitError |
AES128_Update |
AES128_UpdateHex |
AES192_HexMode |
AES256_BytesMode
- General
-
API_CompileTime |
API_ErrorLookup |
API_ErrorLookup_2 |
API_LicenceType |
API_PowerUpTests |
API_Version
- Blowfish
-
BLF_B64Mode |
BLF_Bytes |
BLF_BytesMode |
BLF_File |
BLF_FileHex |
BLF_Hex |
BLF_HexMode |
BLF_Update |
BLF_UpdateHex
- Cipher
-
CIPHER_KeyUnwrap |
CIPHER_KeyWrap
- CRC
-
CRC_Bytes |
CRC_File |
CRC_String
- DES
-
DES_HexMode
- GCM
-
GCM_Encrypt |
GCM_Encrypt_2 |
GCM_InitKey
- Hash
-
HASH_Bytes |
HASH_File |
HASH_HexFromBytes |
HASH_HexFromHex
- MAC
-
MAC_Bytes |
MAC_HexFromBytes |
MAC_HexFromHex
- MD5
-
MD5_AddBytes |
MD5_AddString |
MD5_BytesHash |
MD5_StringHexHash
- Padding
-
PAD_BytesBlock |
PAD_HexBlock |
PAD_UnpadHex
- PBE
-
PBE_Kdf2 |
PBE_Kdf2Hex
- PC1 (RC4)
-
PC1_Bytes |
PC1_File |
PC1_Hex
- RNG
-
RNG_Initialize |
RNG_KeyBytes |
RNG_MakeSeedFile |
RNG_NonceDataHex |
RNG_Number
- SHA
-
SHA1_AddString |
SHA1_BytesHash |
SHA1_FileHexHash |
SHA1_StringHexHash |
SHA2_StringHexHash
- Triple DES
-
TDEA_B64Mode |
TDEA_Bytes |
TDEA_BytesMode |
TDEA_FileHex |
TDEA_HexMode |
TDEA_Update
- Wipe
-
WIPE_Data |
WIPE_String
- ZLIB
-
ZLIB_Deflate