sync toc
CryptoSysTM API Manual
What is the CryptoSys API?
Introduction
Getting Started
Changes in this version
Changes in earlier versions
Conventions in this document
Copyright Notice
Background Basics
Block cipher algorithms
Block Cipher Modes and Initialization Vectors
Padding
Stream ciphers
One-way message digest (hash) functions
Message authentication code (MAC) functions
Galois/Counter Mode (GCM) Authenticated Encryption
Data Compression in Cryptography
Secure Random Number Generator
RNG Mechanisms
Techniques to add known security strength to the RNG process
User-supplied entropy (seeds)
Installation
Win64 (X64) Platform
Detecting Win32 or X64 platform
Visual Basic or Visual Basic: VB6 vs VB.NET
General Programming Issues
Storing and representing ciphertext
Converting strings to bytes and vice versa
Hexadecimal versus Bytes
Return Values
Using with Classic Visual Basic and VBA
Pre-dimensioning for VB
Using with C and C++
Type Conversions
Compiling with C
Using With Borland C++
Cautions for C/C++ Users
Using with .NET: C# and VB.NET
Converting VB6 to VB.NET
Using with COM/ASP
'Hello world' programs
Common problems when encrypting
Specifying the algorithm and mode for generic block cipher functions
Extensions to block cipher functions for files
Security Issues
Self-Tests
Optional Registry Settings
Technical Details
Compliance
References
VB6/C Function Summary
Advanced Encryption Standard (AES) functions
Blowfish functions
Conversion functions
Cyclic Redundancy Check functions
Data Encryption Standard (DES) functions
Message Digest Hash functions
GCM functions
General functions
Message Authentication Code functions
MD5 Hash Algorithm functions
Padding functions
Password-based encryption functions
PC1 Stream Cipher functions
Secure Random Number Generator (RNG) functions
Secure Hash Algorithm (SHA-1) functions
Secure Hash Algorithm (SHA-256) functions
Triple Data Encryption Algorithm (Triple DES) functions
Wipe functions
Key Wrap functions
ZLIB data compression functions
ActiveX Interface
Deprecated Functions
List of Functions
AES128_B64Mode
AES128_Bytes
AES128_BytesMode
AES128_File
AES128_FileExt
AES128_FileHex
AES128_Final
AES128_Hex
AES128_HexMode
AES128_Init
AES128_InitError
AES128_InitHex
AES128_Update
AES128_UpdateHex
AES192_B64Mode
AES192_Bytes
AES192_BytesMode
AES192_File
AES192_FileExt
AES192_FileHex
AES192_Final
AES192_Hex
AES192_HexMode
AES192_Init
AES192_InitError
AES192_InitHex
AES192_Update
AES192_UpdateHex
AES256_B64Mode
AES256_Bytes
AES256_BytesMode
AES256_File
AES256_FileExt
AES256_FileHex
AES256_Final
AES256_Hex
AES256_HexMode
AES256_Init
AES256_InitError
AES256_InitHex
AES256_Update
AES256_UpdateHex
API_CompileTime
API_ErrorCode
API_ErrorLookup
API_LicenceType
API_ModuleName
API_PowerUpTests
API_Version
BLF_B64Mode
BLF_Bytes
BLF_BytesMode
BLF_File
BLF_FileExt
BLF_FileHex
BLF_Final
BLF_Hex
BLF_HexMode
BLF_Init
BLF_InitError
BLF_InitHex
BLF_Update
BLF_UpdateHex
CNV_B64Filter
CNV_B64StrFromBytes
CNV_BytesFromB64Str
CNV_BytesFromHexStr
CNV_HexFilter
CNV_HexStrFromBytes
CIPHER_KeyWrap
CIPHER_KeyUnwrap
CRC_Bytes
CRC_File
CRC_String
DES_B64Mode
DES_Bytes
DES_BytesMode
DES_CheckKey
DES_CheckKeyHex
DES_File
DES_FileExt
DES_FileHex
DES_Final
DES_Hex
DES_HexMode
DES_Init
DES_InitError
DES_InitHex
DES_Update
DES_UpdateHex
GCM_Decrypt
GCM_Encrypt
GCM_FinishKey
GCM_InitKey
GCM_NextDecrypt
GCM_NextEncrypt
HASH_Bytes
HASH_File
HASH_HexFromBytes
HASH_HexFromFile
HASH_HexFromHex
MAC_Bytes
MAC_HexFromBytes
MAC_HexFromHex
MD5_AddBytes
MD5_AddString
MD5_BytesHash
MD5_BytesHexHash
MD5_FileHexHash
MD5_HexDigest
MD5_Hmac
MD5_HmacHex
MD5_Init
MD5_Reset
MD5_StringHexHash
PAD_BytesBlock
PAD_HexBlock
PAD_UnpadBytes
PAD_UnpadHex
PBE_Kdf2
PBE_Kdf2Hex
PC1_Bytes
PC1_File
PC1_Hex
RNG_BytesWithPrompt
RNG_HexWithPrompt
RNG_Initialize
RNG_KeyBytes
RNG_KeyHex
RNG_MakeSeedFile
RNG_NonceData
RNG_NonceDataHex
RNG_Number
RNG_Test
RNG_UpdateSeedFile
SHA1_AddBytes
SHA1_AddString
SHA1_BytesHash
SHA1_BytesHexHash
SHA1_FileHexHash
SHA1_HexDigest
SHA1_Hmac
SHA1_HmacHex
SHA1_Init
SHA1_Reset
SHA1_StringHexHash
SHA2_AddBytes
SHA2_AddString
SHA2_BytesHash
SHA2_BytesHexHash
SHA2_FileHexHash
SHA2_HexDigest
SHA2_Hmac
SHA2_HmacHex
SHA2_Init
SHA2_Reset
SHA2_StringHexHash
TDEA_B64Mode
TDEA_Bytes
TDEA_BytesMode
TDEA_File
TDEA_FileExt
TDEA_FileHex
TDEA_Final
TDEA_Hex
TDEA_HexMode
TDEA_Init
TDEA_InitError
TDEA_InitHex
TDEA_Update
TDEA_UpdateHex
WIPE_Data
WIPE_File
ZLIB_Deflate
ZLIB_Inflate
ActiveX Classes and Methods
.NET Classes and Methods
Cross-reference between Functions and .NET Methods
.NET Help File
Summary of .NET Classes
Aes128 Class
Aes192 Class
Aes256 Class
Blowfish Class
Cipher Class
Cnv Class
Crc Class
Des Class
Gcm Class
General Class
Hash Class
Mac Class
Md5 Class
Pbe Class
Pc1 Class
Properties Class
Rng Class
Sha1 Class
Sha256 Class
Tdea Class
Wipe Class
Zlib Class
List of .Net Methods
Aes128.Decrypt Method (Byte, Byte, Mode, Byte)
Aes128.Decrypt Method (String, String, Mode, String)
Aes128.Decrypt Method (String, String, Mode, String, EncodingBase)
Aes128.Dispose Method
Aes128.Encrypt Method (Byte, Byte, Mode, Byte)
Aes128.Encrypt Method (String, String, Mode, String)
Aes128.Encrypt Method (String, String, Mode, String, EncodingBase)
Aes128.FileDecrypt Method (String, String, Byte, Mode, Byte)
Aes128.FileDecrypt Method (String, String, String, Mode, String)
Aes128.FileEncrypt Method (String, String, Byte, Mode, Byte)
Aes128.FileEncrypt Method (String, String, Byte, Mode, Byte, CipherFileOption)
Aes128.FileDecrypt Method (String, String, Byte, Mode, Byte, CipherFileOption)
Aes128.FileEncrypt Method (String, String, String, Mode, String)
Aes128.InitDecrypt Method (Byte, Mode, Byte)
Aes128.InitDecrypt Method (String, Mode, String)
Aes128.InitEncrypt Method (Byte, Mode, Byte)
Aes128.InitEncrypt Method (String, Mode, String)
Aes128.Instance Method
Aes128.Pad Method (Byte)
Aes128.Pad Method (String)
Aes128.Unpad Method (Byte)
Aes128.Unpad Method (String)
Aes128.Update Method (Byte)
Aes128.Update Method (String)
Aes192.Decrypt Method (Byte, Byte, Mode, Byte)
Aes192.Decrypt Method (String, String, Mode, String)
Aes192.Decrypt Method (String, String, Mode, String, EncodingBase)
Aes192.Dispose Method
Aes192.Encrypt Method (Byte, Byte, Mode, Byte)
Aes192.Encrypt Method (String, String, Mode, String)
Aes192.Encrypt Method (String, String, Mode, String, EncodingBase)
Aes192.FileDecrypt Method (String, String, Byte, Mode, Byte)
Aes192.FileDecrypt Method (String, String, String, Mode, String)
Aes192.FileEncrypt Method (String, String, Byte, Mode, Byte)
Aes192.FileEncrypt Method (String, String, Byte, Mode, Byte, CipherFileOption)
Aes192.FileDecrypt Method (String, String, Byte, Mode, Byte, CipherFileOption)
Aes192.FileEncrypt Method (String, String, String, Mode, String)
Aes192.InitDecrypt Method (Byte, Mode, Byte)
Aes192.InitDecrypt Method (String, Mode, String)
Aes192.InitEncrypt Method (Byte, Mode, Byte)
Aes192.InitEncrypt Method (String, Mode, String)
Aes192.Instance Method
Aes192.Pad Method (Byte)
Aes192.Pad Method (String)
Aes192.Unpad Method (Byte)
Aes192.Unpad Method (String)
Aes192.Update Method (Byte)
Aes192.Update Method (String)
Aes256.Decrypt Method (Byte, Byte, Mode, Byte)
Aes256.Decrypt Method (String, String, Mode, String)
Aes256.Decrypt Method (String, String, Mode, String, EncodingBase)
Aes256.Dispose Method
Aes256.Encrypt Method (Byte, Byte, Mode, Byte)
Aes256.Encrypt Method (String, String, Mode, String)
Aes256.Encrypt Method (String, String, Mode, String, EncodingBase)
Aes256.FileDecrypt Method (String, String, Byte, Mode, Byte)
Aes256.FileDecrypt Method (String, String, String, Mode, String)
Aes256.FileEncrypt Method (String, String, Byte, Mode, Byte)
Aes256.FileEncrypt Method (String, String, Byte, Mode, Byte, CipherFileOption)
Aes256.FileDecrypt Method (String, String, Byte, Mode, Byte, CipherFileOption)
Aes256.FileEncrypt Method (String, String, String, Mode, String)
Aes256.InitDecrypt Method (Byte, Mode, Byte)
Aes256.InitDecrypt Method (String, Mode, String)
Aes256.InitEncrypt Method (Byte, Mode, Byte)
Aes256.InitEncrypt Method (String, Mode, String)
Aes256.Instance Method
Aes256.Pad Method (Byte)
Aes256.Pad Method (String)
Aes256.Unpad Method (Byte)
Aes256.Unpad Method (String)
Aes256.Update Method (Byte)
Aes256.Update Method (String)
Blowfish.Decrypt Method (Byte, Byte, Mode, Byte)
Blowfish.Decrypt Method (String, String, Mode, String)
Blowfish.Decrypt Method (String, String, Mode, String, EncodingBase)
Blowfish.Dispose Method
Blowfish.Encrypt Method (Byte, Byte, Mode, Byte)
Blowfish.Encrypt Method (String, String, Mode, String)
Blowfish.Encrypt Method (String, String, Mode, String, EncodingBase)
Blowfish.FileDecrypt Method (String, String, Byte, Mode, Byte)
Blowfish.FileDecrypt Method (String, String, String, Mode, String)
Blowfish.FileEncrypt Method (String, String, Byte, Mode, Byte)
Blowfish.FileEncrypt Method (String, String, Byte, Mode, Byte, CipherFileOption)
Blowfish.FileDecrypt Method (String, String, Byte, Mode, Byte, CipherFileOption)
Blowfish.FileEncrypt Method (String, String, String, Mode, String)
Blowfish.InitDecrypt Method (Byte, Mode, Byte)
Blowfish.InitDecrypt Method (String, Mode, String)
Blowfish.InitEncrypt Method (Byte, Mode, Byte)
Blowfish.InitEncrypt Method (String, Mode, String)
Blowfish.Instance Method
Blowfish.Pad Method (Byte)
Blowfish.Pad Method (String)
Blowfish.Unpad Method (Byte)
Blowfish.Unpad Method (String)
Blowfish.Update Method (Byte)
Blowfish.Update Method (String)
Cipher.KeyUnwrap Method
Cipher.KeyWrap Method
Cnv.Base64Filter Method
Cnv.Base64FromHex Method
Cnv.FromBase64 Method
Cnv.FromHex Method
Cnv.HexFilter Method
Cnv.HexFromBase64 Method
Cnv.StringFromBase64 Method
Cnv.StringFromHex Method
Cnv.ToBase64 Method (Byte)
Cnv.ToBase64 Method (String)
Cnv.ToHex Method (Byte)
Cnv.ToHex Method (String)
Crc.Data Method (Byte)
Crc.Data Method (String)
Crc.File Method
Des.CheckKey Method (Byte)
Des.CheckKey Method (String)
Des.Decrypt Method (Byte, Byte, Mode, Byte)
Des.Decrypt Method (String, String, Mode, String)
Des.Decrypt Method (String, String, Mode, String, EncodingBase)
Des.Dispose Method
Des.Encrypt Method (Byte, Byte, Mode, Byte)
Des.Encrypt Method (String, String, Mode, String)
Des.Encrypt Method (String, String, Mode, String, EncodingBase)
Des.FileDecrypt Method (String, String, Byte, Mode, Byte)
Des.FileEncrypt Method (String, String, Byte, Mode, Byte, CipherFileOption)
Des.FileDecrypt Method (String, String, Byte, Mode, Byte, CipherFileOption)
Des.FileDecrypt Method (String, String, String, Mode, String)
Des.FileEncrypt Method (String, String, Byte, Mode, Byte)
Des.FileEncrypt Method (String, String, String, Mode, String)
Des.InitDecrypt Method (Byte, Mode, Byte)
Des.InitDecrypt Method (String, Mode, String)
Des.InitEncrypt Method (Byte, Mode, Byte)
Des.InitEncrypt Method (String, Mode, String)
Des.Instance Method
Des.Pad Method (Byte)
Des.Pad Method (String)
Des.Unpad Method (Byte)
Des.Unpad Method (String)
Des.Update Method (Byte)
Des.Update Method (String)
Gcm.Decrypt Method
Gcm.Dispose Method
Gcm.Encrypt Method
Gcm.Gmac Method
Gcm.InitKey Method
Gcm.Instance Method
Gcm.NextDecrypt Method
Gcm.NextEncrypt Method
Gcm.NextGmac Method
General.CompileTime Method
General.ErrorCode Method
General.ErrorLookup Method
General.IsWin64 Method
General.LicenceType Method
General.ModuleName Method
General.Platform Method
General.PowerUpTests Method
General.Version Method
Hash.BytesFromBytes Method
Hash.BytesFromFile Method
Hash.HexFromBytes Method
Hash.HexFromFile Method
Hash.HexFromHex Method
Hash.HexFromString Method
Hash.HexFromTextFile Method
Mac.BytesFromBytes Method
Mac.HexFromBytes Method
Mac.HexFromHex Method
Md5.AddData Method (Byte)
Md5.AddData Method (String)
Md5.BytesHash Method
Md5.Dispose Method
Md5.FileHexHash Method
Md5.FileTextHexHash Method
Md5.HexDigest Method
Md5.HexHash Method (Byte)
Md5.HexHash Method (String)
Md5.Hmac Method (Byte, Byte)
Md5.Hmac Method (String, String)
Md5.Init Method
Md5.Instance Method
Md5.Reset Method
Pbe.Kdf2 Method (Int32, Byte, Byte, Int32)
Pbe.Kdf2 Method (Int32, Byte, Byte, Int32, HashAlgorithm)
Pbe.Kdf2 Method (Int32, String, String, Int32)
Pbe.Kdf2 Method (Int32, String, String, Int32, HashAlgorithm)
Pc1.Encrypt Method (Byte, Byte)
Pc1.Encrypt Method (String, String)
Pc1.File Method
Rng.BytesWithPrompt Method (Int32)
Rng.BytesWithPrompt Method (Int32, String, Rng.Strength)
Rng.HexWithPrompt Method (Int32)
Rng.HexWithPrompt Method (Int32, String, Rng.Strength)
Rng.Initialize Method
Rng.KeyBytes Method (Int32, Byte)
Rng.KeyBytes Method (Int32, String)
Rng.KeyHex Method (Int32, Byte)
Rng.KeyHex Method (Int32, String)
Rng.MakeSeedFile Method (String)
Rng.MakeSeedFile Method (String, String, Rng.Strength)
Rng.NonceBytes Method
Rng.NonceHex Method
Rng.Number Method
Rng.Octet Method
Rng.Test Method
Rng.UpdateSeedFile Method
Sha1.AddData Method (Byte)
Sha1.AddData Method (String)
Sha1.BytesHash Method
Sha1.Dispose Method
Sha1.FileHexHash Method
Sha1.FileTextHexHash Method
Sha1.HexDigest Method
Sha1.HexHash Method (Byte)
Sha1.HexHash Method (String)
Sha1.Hmac Method (Byte, Byte)
Sha1.Hmac Method (String, String)
Sha1.Init Method
Sha1.Instance Method
Sha1.Reset Method
Sha256.AddData Method (Byte)
Sha256.AddData Method (String)
Sha256.BytesHash Method
Sha256.Dispose Method
Sha256.FileHexHash Method
Sha256.FileTextHexHash Method
Sha256.HexDigest Method
Sha256.HexHash Method (Byte)
Sha256.HexHash Method (String)
Sha256.Hmac Method (Byte, Byte)
Sha256.Hmac Method (String, String)
Sha256.Init Method
Sha256.Instance Method
Sha256.Reset Method
Tdea.CheckKey Method (Byte)
Tdea.CheckKey Method (String)
Tdea.Decrypt Method (Byte, Byte, Mode, Byte)
Tdea.Decrypt Method (String, String, Mode, String)
Tdea.Decrypt Method (String, String, Mode, String, EncodingBase)
Tdea.Dispose Method
Tdea.Encrypt Method (Byte, Byte, Mode, Byte)
Tdea.Encrypt Method (String, String, Mode, String)
Tdea.Encrypt Method (String, String, Mode, String, EncodingBase)
Tdea.FileDecrypt Method (String, String, Byte, Mode, Byte)
Tdea.FileEncrypt Method (String, String, Byte, Mode, Byte, CipherFileOption)
Tdea.FileDecrypt Method (String, String, Byte, Mode, Byte, CipherFileOption)
Tdea.FileDecrypt Method (String, String, String, Mode, String)
Tdea.FileEncrypt Method (String, String, Byte, Mode, Byte)
Tdea.FileEncrypt Method (String, String, String, Mode, String)
Tdea.InitDecrypt Method (Byte, Mode, Byte)
Tdea.InitDecrypt Method (String, Mode, String)
Tdea.InitEncrypt Method (Byte, Mode, Byte)
Tdea.InitEncrypt Method (String, Mode, String)
Tdea.Instance Method
Tdea.Pad Method (Byte)
Tdea.Pad Method (String)
Tdea.Unpad Method (Byte)
Tdea.Unpad Method (String)
Tdea.Update Method (Byte)
Tdea.Update Method (String)
Wipe.Data Method
Wipe.File Method
Wipe.String Method
Zlib.Deflate Method
Zlib.Inflate Method
Aes128.ErrCode Property
Aes192.ErrCode Property
Aes256.ErrCode Property
Blowfish.ErrCode Property
Des.ErrCode Property
Gcm.ErrCode Property
Md5.ErrCode Property
Sha1.ErrCode Property
Sha256.ErrCode Property
Tdea.ErrCode Property
CipherFileOption Enumeration
Example code in VB.NET (VB2005/8/x)
Example: Aes128.Decrypt
Example: Aes128.Decrypt
Example: Aes128.Decrypt
Example: Aes128.FileDecrypt
Example: Aes128.FileEncrypt
Example: Aes128.Decrypt
Example: Aes128.Decrypt
Example: Aes128.ErrCode
Example: Aes128.Dispose
Example: Aes128.Dispose
Example: Aes192.Decrypt
Example: Aes256.Decrypt
Example: General.CompileTime
Example: General.ErrorLookup
Example: General.ErrorLookup
Example: General.LicenceType
Example: General.PowerUpTests
Example: General.Version
Example: Blowfish.Decrypt
Example: Blowfish.Decrypt
Example: Blowfish.Decrypt
Example: Blowfish.FileDecrypt
Example: Blowfish.FileEncrypt
Example: Blowfish.Decrypt
Example: Blowfish.Decrypt
Example: Blowfish.Dispose
Example: Blowfish.Dispose
Example: Cipher.KeyUnwrap
Example: Cipher.KeyUnwrap
Example: Crc.Data
Example: Crc.File
Example: Crc.Data
Example: Des.Decrypt
Example: Gcm.Decrypt
Example: Gcm.Gmac
Example: Gcm.Dispose
Example: Hash.BytesFromBytes
Example: Hash.BytesFromFile
Example: Hash.HexFromBytes
Example: Hash.HexFromHex
Example: Mac.BytesFromBytes
Example: Mac.HexFromBytes
Example: Mac.HexFromHex
Example: Md5.AddData
Example: Md5.AddData
Example: Md5.BytesHash
Example: Md5.HexHash
Example: Tdea.Pad
Example: Tdea.Pad
Example: Tdea.Unpad
Example: Pbe.Kdf2
Example: Pbe.Kdf2
Example: Pc1.Encrypt
Example: Pc1.File
Example: Pc1.Encrypt
Example: Rng.Initialize
Example: Rng.KeyBytes
Example: Rng.MakeSeedFile
Example: Rng.NonceHex
Example: Rng.Number
Example: Sha1.AddData
Example: Sha1.BytesHash
Example: Sha1.FileHexHash
Example: Sha1.HexHash
Example: Sha256.HexHash
Example: Tdea.Decrypt
Example: Tdea.Decrypt
Example: Tdea.Decrypt
Example: Tdea.FileDecrypt
Example: Tdea.FileDecrypt
Example: Tdea.Decrypt
Example: Tdea.Dispose
Example: Wipe.Data
Example: Wipe.String
Example: Zlib.Deflate
Error Codes
Acknowledgements
Index
Document Revision History