Activecrypt Online Help Prev Next
About ActiveCrypt
About
ActiveCrypt overview
How to ...
How to make pair of keys
Create new public key from private
How to decrypt string
How to encrypt string
How to save keys
Free keys
Programmer reference
Hash
Hash overview
Methods
HashFile
HashVariant
Properties
Error
Crypt
Encryption overview
Methods
DecryptFile
DecryptVariant
EncryptFile
EncryptVariant
FreeKey
LoadKeyFromString
LoadKey
Properties
AddCRLF
Error
KeySize
Base64
Base64 overview
Methods
DecodeFile
DecodeVariant
EncodeFile
EncodeVariant
Properties
AddCRLF
Error
Sign
Sign overview
Methods
FreeKey
LoadKey
LoadKeyFromString
MakeVariantSignature
MakeFileSignature
VerifyFileSignature
VerifyVariantSignature
Properties
AddCRLF
Error
RSACrypt (old, use Crypt)
Methods
FreeKey
GenerateCouple
GeneratePublicKey
GetVersion
LoadKeyFromString
LoadKey
PublicEncrypt
PrivateDecrypt
SaveKeyToString
SaveKey
Properties
About
Async
Error
Events
OnDecryptionFinished
OnEncryptionFinished
OnError
OnKeyGenerationFinished
Disclaimer

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.

This HTML Help has been published using the chm2web software.