Generate pair
Generation of a pair means a
generation of pair of keys - private one and corresponding public key. The public key is
used for encryption and the private key is usedfor decryption. Each key is
represented by long value. The longer is the bit length of the key, the harder it is to
bruteforce it. Unlike Windows build-in crypto system, the full version of ActiveCrypt
provides an unlimited length of the key. It is only limited by the power of CPU you have.
The shareware version of ActiveCrypt provides a maximum key length equal to 256 bit.
Key generation is quite easy. You must only call function GenerateCouple. In the following example 2 keys with size of
256 bits are created:
Dim PrivateKey As Variant, PublicKey As Variant
Set ActiveCryptObject = new ActiveCryptLib.RSACrypt
ActiveCryptObject.GenerateCouple 256, PrivateKey, PublicKey
...
|
Usually, you will want to
save those keys. To do this you should use SaveKey function. The
keys will remain valid until you destroy ActiveCryptObject or explicitly free it with FreeKey function.
|