CryptoSys Encode
Examples | Function List | Manual | Download
There are functions in CryptoSys Encode for both Visual Basic users and C/C++ programmers (new in version 2). The VB functions automatically allocate the required memory for the String and Arrays used.
Dim sInput As String
Dim sOutput As String
' Put some binary data in a string
' this creates the 8-byte string 0xFEDCBA9876543210
sInput = Chr(&HFE) & Chr(&HDC) & Chr(&HBA) & Chr(&H98) & _
Chr(&H76) & Chr(&H54) & Chr(&H32) & Chr(&H10)
sOutput = B64_Encode(sInput)
Debug.Print sOutput
This should result in output as follows:
/ty6mHZUMhA=We can use a CryptoSys Encode HEX conversion function to create the binary data
Dim sInput As String
Dim sOutput As String
sInput = HEX_Decode("FEDCBA9876543210")
sOutput = B64_Encode(sInput)
Debug.Print sOutput
And do some decoding back from base64 to a string of binary values
Dim sInput As String
Dim sOutput As String
' Get a base64 string
sInput = "/ty6mHZUMhA="
sOutput = B64_Decode(sInput)
Debug.Print HEX_Encode(soutput)
This will produce the output of binary characters in hex
FEDCBA9876543210To use the CRC-32 checksum function
Dim sInput As String
Dim sOutput As String
sInput = "123456789"
sOutput = HEX_CRC32(sInput)
Debug.Print sOutput
that should produce the result
CBF43926
Obviously these trivial examples are just meant to show the basic mechanics of the functions involved. They'll be useful to you if you have bulk encoding to do - strings in Visual Basic can be up to 2 billion characters long. See the manual for more detailed examples.
B64_Encode - Encodes a string of binary characters into a base64 string.
B64_Decode - Decodes a base64 encoded string into a string of binary values.
B64_Filter - Filters unwanted characters from a base64 encoded string.
B64_EncodeBytes - Encodes an array of bytes into a base64 string.
B64_DecodeBytes - Decodes a base64 encoded string into Variant Byte array.
B64_DecodeIntoBytes - Decodes a base64 encoded string into an array of Bytes.
HEX_Encode - Encodes a string of binary characters into a hexadecimal string.
HEX_Decode - Decodes a string of hexadecimal characters into a string of binary values.
HEX_Filter - Filters unwanted characters from a hexadecimal string.
HEX_EncodeBytes - Encodes an array of bytes into a hexadecimal string.
HEX_DecodeBytes - Decodes a hexadecimal string into Variant Byte array.
HEX_DecodeIntoBytes - Decodes a hexadecimal string into an array of Bytes.
HEX_CRC32 - Create a hexadecimal CRC-32 checksum from a string of binary values.
As of 26 July 2006, CryptoSys Encode is available free of charge. You can download the latest version here. The latest version of the licenced product is release 2.0.1.0. There is no support provided for this free product.
This page last updated: 26 July 2006
Home |
Blowfish |
Rijndael AES |
DES |
Triple DES |
SHA-1 |
SHA-256 |
Random numbers |
CryptoSys Manual |
Purchase |
Cryptography Software Code |
Contact us
Copyright © 2002-3 D.I. Management Services Pty Limited ABN 78 083 210 584,
Sydney, Australia. All rights reserved.
<www.di-mgt.com.au>
<www.cryptosys.net>