September 2021: In version 6.20 of CryptoSys API (the 20th Anniversary Issue) we finally introduce a means to avoid the "raw" core functions for C++ and VBA programmers. Yes, it's only taken us 20 years; come back in 2041 for more improvements...
The C++ (STL) Interface | The VBA/VB6 Wrapper Interface | Contact us
There is a brand new C++ interface using STL and a now complete set of VBA wrapper functions both of which include all the generic crypto functions in CryptoSys API.
When we say "generic" we mean generic functions like "Cipher", "Hash", "Mac" and "Compr", not algorithm-specific functions like "Md5" or "Aes128" (which can all be carried out anyway using a generic function).
This means you can create programs using VBA/VB6 and C++ without having to deliberately allocate or free any memory at all.
The C++ (STL) interface makes extensive use of string and vector from the Standard Template Library (STL). Our code should be compatible with C++11 and above. It compiles without warnings on both MSVC++ and the latest version of GCC.
We introduce our own typedef bvec_t
to store byte arrays in a vector (std::vector<unsigned char>
)
and thereafter use only the types std::string
and crsysapi::bvec_t
to carry out all the operations in the
CryptoSys API library. No malloc, free, new or delete to be found!
Using the C++ (STL) interface is described in the manual.
There is a detailed on-line programmer's reference.
And here is some test code.
We've deliberately left in the full namespace prefix crsysapi::
in all its extra fingertyping glory because we're told that's the thing to do.
Naturally, being C++, we expect some flaming from C++ experts about our coding style. We've tried to make the code as compact as possible and to use the oldest version of C++ we could get away with (C++11). No doubt it could be improved. Comments and suggestions are welcome via our contact page.
The VBA/VB6 wrapper functions now available in v6.20 should enable VBA/VB6 programmers to avoid using any predimensioning hassles like
String(n, " ")
or ReDim arr(n)
.
No need to call the function twice to find the required output length.
We have an on-line programmer's reference and some test code.
Well, for the generic functions, er, yes.
There is a simpler wrapper function available for all of them. Please use the wrapper function if it's available. Just ignore the "raw" examples. On the positive side, we found over the years that the discipline of writing the VBA equivalent of the "raw" C function exposed many errors before release, however tedious it became to do so.
For more information or to comment on this page, please send us a message.
This page first created 26 September 2021. Last updated 15 August 2025.