Changes in Version 6.21 (27 May 2023):
CNV_ShortPathName to help handle filenames with "International" characters.
See Filenames with "International" characters.
Changes in Version 6.20 (25 September 2021):
Mid function does on strings.
basCryptoSys.bas.
The old files basCryptoSys64.bas, basCryptoSys64_32.bas and basCryptoSysWrappers.bas
are no longer needed and indeed must not be used.
COMPR_Compress and
COMPR_Uncompress
and their .NET, VBA and C++ equivalents.
CIPHER_EncryptBytes and
CIPHER_DecryptBytes
to replace deprecated
CIPHER_EncryptBytes2 and
CIPHER_DecryptBytes2.
This has no effect on .NET methods or the VBA wrapper functions (it just gets rid of that "2").
MAC_Init /
MAC_AddBytes /
MAC_Final,
and their .NET, VBA and C++ equivalents.
crsysapi::Err::FormatErrorMessage (C++).
Changes in Version 6.0 (2 March 2021):
Hash.Init Method,
Hash.AddData Method,
and
Hash.Final Method).
Mac.Init Method,
Mac.AddData Method,
and
Mac.Final Method).
Cipher.InitEncrypt Method,
Cipher.InitDecrypt Method,
Cipher.Update Method,
and
Cipher.Dispose Method).
Plus alternative functions to pass data in hexadecimal-encoded form
CIPHER_InitHex, CIPHER_UpdateHex.
Cipher.Encrypt Method
and Cipher.Decrypt Method).
These functions provide an alternative input mechanism using hexadecimal-encoded strings, which are simpler to handle than byte arrays.
Changes in Version 5.4 (22 March 2020):
Aead.EncryptWithTag Method
and Aead.DecryptWithTag Method).
PrefixIV option for
Cipher.Encrypt Method
and
Cipher.Decrypt Method).
Changes in Version 5.3 (16 September 2018):
SHA3_Init,
SHA3_AddBytes,
SHA3_AddString and
SHA3_HexDigest
to compute the SHA-3 message digest of data passed in several chunks.
The new equivalent .NET methods are
Sha3.Init,
Sha3.AddData (Byte[]),
Sha3.AddData (String) and
Sha3.HexDigest
together with
Sha3.Instance
and
Sha3.Dispose
to create and dispose of the objects.
The SHA3_LengthInBytes function
or Sha3.LengthInBytes property
will return the byte-length of the hash output for an initialized SHA-3 context.
SHA1_BytesHexHash,
use the HASH function HASH_HexFromBytes
with the relevant API_HASH_SHA3_nnn option.
PRF_Bytes and equivalent .NET method Prf.Bytes
to produce pseudorandom output of any length using KMAC128 and KMAC256 as per NIST SP800-185 [SP800185].
XOF_Bytes and equivalent .NET method Xof.Bytes
to provide extended-output functions of any length using SHAKE128 and SHAKE256 as per FIPS PUB 202 [FIPS202].
WIPE_File
(.NET Wipe.File Method),
and added option to overwrite with a single pass of zero bytes (quicker but less secure).
ZLIB_Inflate function
to compute the required output size in bytes from the compressed data. In earlier versions you needed to know the size by other means.
The .NET method Zlib.Inflate Method (Byte[]) now supersedes the old
Zlib.Inflate Method (Byte[], Int32).
CIPHER_EncryptBytesPad and CIPHER_DecryptBytesPad. Use instead
CIPHER_EncryptBytes2 and
CIPHER_DecryptBytes2.
This has no effect on .NET methods.
Changes in Version 5.2 (15 August 2016):
PBE_Scrypt and
PBE_ScryptHex
and their equivalent .NET Pbe Class methods.
CIPHER_EncryptBytes2 and
CIPHER_DecryptBytes2
as safer replacements for
CIPHER_EncryptBytesPad and
CIPHER_DecryptBytesPad (withdrawn in [v5.3])
with explicit checks for lengths of key and IV byte arrays.
These new safer functions are now used internally in the equivalent .NET Cipher class methods.
CIPHER_FileEncrypt and
CIPHER_FileDecrypt
with explicit checks for lengths of key and IV byte arrays.
These functions allow the user to specify the type of padding used for ECB and CBC modes
(previously only PKCS5Padding),
and give the option to prepend the IV to the ciphertext data.
The equivalent .NET methods are
Cipher.FileEncrypt Method and
Cipher.FileDecrypt Method.
Aes128.FileEncrypt or Tdea.FileDecrypt.
A byte[] key or IV of the wrong length will now cause an explicit error
(BAD_KEY_LEN_ERROR or BAD_IV_LEN_ERROR) before it does any more harm.
PAD_BytesBlock,
PAD_UnpadBytes,
PAD_HexBlock and
PAD_UnpadHex.
Cipher.Pad Method
and
Cipher.Unpad Method.
Cipher.BlockBytes Method
and
Cipher.KeyBytes Method
to return the correct sizes in bytes of the cipher block and key for a given block cipher algorithm.
CNV_BytesFromHexStr and
CNV_BytesFromB64Str
to be stricter and return an error if any obviously invalid characters are found (formerly they were just ignored).
Whitespace characters are still allowed in both hex and base64 strings, and ASCII punctuation characters in a hex string.
So, for example, the hex string "DE:AD:BE:EF" is still OK,
but characters in the range [G-Zg-z] in a hex string now cause an error.
Changes in Version 5.1 (18 July 2015):
AEAD family of 11 new functions
and the Aead class of methods
to provide authenticated encryption with additional data (AEAD)
with support for the following algorithms:
AEAD_AES_128_GCMAEAD_AES_256_GCMAEAD_CHACHA20_POLY1305AEAD_Encrypt and AEAD_Decrypt
provide a simple, stateless interface to do one-off AEAD computations.
AEAD_InitKey,
AEAD_SetNonce, ...,
AEAD_Destroy.
errorcodes-api.h,
errorcodes-api.bas,
errorcodes-api.vb and
errorcodes-api.cs
in the distribution. You may need to cut and paste from these into your projects.
Changes in Version 5.0 (29 April 2015):
CIPHER_Stream family of functions
and CipherStream class of methods
to provide stream ciphers
with support for CHACHA20, SALSA20, and ARCFOUR (a.k.a RC4).
MAC functions
or the MacAlgorithm.Poly1305 option with any of the
Mac class of methods.
CIPHER_EncryptBytesPad
and CIPHER_DecryptBytesPad which use the specified block cipher algorithm,
mode and padding to encrypt and decrypt data in a byte array. Padding is added if required before encryption and removed after decryption.
The equivalent .NET methods are
Cipher.Encrypt Method
and
Cipher.Decrypt Method.
API_Version to return a five-digit number of the form
Major * 10000 + Minor * 100 + Release. For example, version 5.2.1 will return the number 50201
whereas version 4.7.0 would have returned 470.
Changes in Version 4.7 (15 September 2013):
RNG_Initialize function and
Rng.Initialize method so they will create a new seed file if one does not exist
(previously it just used to fail).
RNG_Number,
CRC_Bytes,
CRC_File and
CRC_String functions
from long to the explicit-size int32_t type.
This is only relevant for the MAC-OSX library, where the long type is 64 bits instead of 32 bits.
It should have no effect in Windows or other platforms.
RNG_Number function and
Rng.Number method to cope with the full range of 32-bit signed integer limits.
Changes in Version 4.6 (7 November 2012):
HASH_HexFromBits function
and Hash.HexFromBits method
to compute the secure hash of a bit string
(as opposed to the byte-oriented methods) using the SHA family of secure hash functions.
RNG_TestDRBGVS function
and Rng.TestDrbgvs method
to carry out the relevant validation test in
The NIST SP 800-90A Deterministic Random Bit Generator Validation System (DRBGVS) [DRBGVS].
Changes in Version 4.5 (23 January 2011):
AES128_FileExt,
AES192_FileExt,
AES256_FileExt,
TDEA_FileExt,
DES_FileExt,
BLF_FileExt,
and their associated methods in .NET with the
CipherFileOption parameter.
The extended options
(1) enable the IV to be embedded in the ciphertext file and
(2) allow the padding to be left in place when decrypting.
See Extensions to block cipher functions for files for more details.
API_ErrorCode function and
General.ErrorCode method
so they now return an error code after calling most functions.
This is useful to find the error when the .NET methods return an empty string.
Changes in Version 4.4 (9 August 2010):
Changes in Version 4.3 (17 December 2009):
Changes in Version 4.2 (19 March 2009):
GCM_Encrypt.WIPE_File function - up to three times faster for large files.Changes in Version 4.1 (11 July 2008):
Changes in Version 4.0 (12 September 2007):
Changes in Version 3.2 (22 July 2006):
Version 1.0 first published 13 September 2001.