I have a COM API (ActiveX DLL) that I wrote years ago that 100% conforms to the SHA1 standard. I can tell you right now it is not a real easy task. There are advanced math functions that VB6 does not support that you will need. So I had to write several custom math functions to get this done. For instance you need to be able to convert from Hexadecimal to Binary and to Decimal, from Binary to Decimal and back. You need bit-wise AND, OR, XOR, NOT functions. I also had to build a new way to calculate Modulus since the built in VB version is not capable of handling the lengths required for SHA calculations and would constantly give overflow errors.
SHA1 is a hash algorithm, it does not encrypt anything.
If you want to pass a series of blocks of data you can just unroll the HashBytes() function in my example, i.e. just make NewHash, HashBlock, and HashValue() all Public and then call those yourself.
Last edited by dilettante; Feb 2nd, 2012 at 06:55 PM.