A 32-bit ActiveX DLL interface for CryptoSys API is included for free in the standard installation packages. This will allow you to call selected CryptoSys API functions using COM, VBScript and ASP.
The full VB6 source code for the ActiveX DLL is included along with some test ASP pages and a test EXE project. You can amend and add more functionality as you wish.
The files should be found in the directory
C:\Program Files\CryptoSys\COM
or C:\Program Files (x86)\CryptoSys\COM
on a 64-bit machine, unless you installed it in a different location on setup.
We don't explicitly support this ActiveX DLL. It is provided as a free add-on for Licensed users of CryptoSys API with no warranties. It works for us in our test environments. but IIS is a strict and capricious master whose demands in a strange environment we can't always anticipate. If it works for you, please use it. We do not intend to make any further changes to this interface.
Declare
statement in your VBA code to access the core 64-bit diCryptoSys.dll,
just be careful with 32-bit/64-bit VBA issues.
Hint: If you have been calling the ActiveX interface from ASP pages using IIS on your own machine, you will not be able to install a new version using the setup program. You will need to stop IIS first:
net stop w3svc
Developer Version (requires licence)
Trial Version
To simplify matters when working in a VBScript/ASP environment, we've only used functions that require all their parameters to be passed as hexadecimal strings. Hexadecimal-encoded data are unambiguous and easily handled in VBScript programming as simple string types, as well as being straightforward to pass as arguments in a URL address. There are a few exceptions for the hash and pbkdf functions which take "straight" text input. It just remains to educate the user why something as simple as "abc" is now "616263". (If you don't understand that, give up now.)
Most functions return a string. If the function fails - perhaps because the input was invalid - the function returns an empty string. The current code doesn't handle errors specifically (it could, but we haven't got around to it yet).
The classes and methods available for the ActiveX interface are detailed in the manual.
See also Using with COM/ASP in the manual.
diCryptOCX.dll
into a suitable directory on the target machine,
e.g. C:\myfolderhere
.REGSVR32 "C:\myfolderhere\diCryptOCX.dll"You should get the response DllRegisterServer in diCryptOCX.dll succeeded.
diCryptOCX.dll
Dim oGen = New diCryptoOCX.gen Debug.Print "Version=" & oGen.Version
Dim oGen Set oGen = Server.CreateObject("diCryptOCX.gen") Response.Write "Version=" & oGen.Version
* The ActiveX DLL is a wrapper that calls the core functions from the Win32 DLL in a safe manner.
The Win32 file diCryptoSys.dll
must exist in a directory in the library search path
on the target computer. Refer to the notes in the file distrib.txt
supplied with the
Developer version or install using the setup program provided.
In versions prior to v4.4, the setup program did not register the ActiveX DLL. As of v4.4, it is now registered when the setup program is run. In all other cases registration must be done separately by following the instructions above or using the appropriate RegDLL instruction in your installation package.
If you are using CryptoSys API on an IIS Server,
we recommend you make the following registry setting and set the
NoMessageBox
DWORD value to '1' to disable pop-up messages from appearing
in the unlikely event that a critical error occurs. A critical error means that someone has interfered with the
core DLL or the random number generator has failed.
A critical error should never happen, but it pays to be sure.
[HKEY_LOCAL_MACHINE\Software\DI Management\CryptoSys\Options]
NoMessageBox
If you want to set or change this setting, you can use one of these two registry editor files. You will need administrator privileges.
For more details refer to the section Optional Registry Settings in the manual.
Microsoft recommends that you do the following when making an ActiveX DLL to be used with IIS
Private Declare
statements in class modules.
Instead, create a TLB file and set Project References to it.
Refer to:
We have followed these recommendations in the provided ActiveX project.
The file diCryptoSys.tlb
is included in the downloaded source code.
If you would like another function added to the TLB file,
please contact us.
In the short term, you can always use a Private Declare
statement
to add an extra function.
Despite all efforts to make them thread-safe, it is still not good practice to use the stateful "Init-Update-Final" functions in a live IIS project.
For more information or to comment on this page, please send us a message.
This page last updated 17 August 2025