EncryptVariant
Sub EncryptVariant
( InputVariant As Variant, Method
As ENCRYPTION_METHODS, Password As Variant ) As String |
This function provides
common way for encryption of variants with different encryption algorithms. Method defines encryption method. Currently Method can be one of
the following:
Symbolic name |
Numeric value |
Description |
ENC_AES |
0 |
Advanced encryption standard |
ENC_RC4 |
1 |
RC4 by Ron Rivest |
ENC_RC5 |
2 |
RC5 by Ron Rivest. |
ENC_RSA |
3 |
RSA is an asymmetric algorithm for public key
cryptography. |
ENC_IDEA |
4 |
International Data Encryption Algorithm |
ENC_CAST5 |
5 |
CAST5 accordingly to RFC
2144
|
ENC_BLOWFISH |
6 |
Blowfish encryption |
ENC_DES3 |
7 |
Tripple DES
|
ENC_DESX |
8 |
DESX ( a strengthened variant of DES) |
If you use ENC_RSA method you should pass handle of the loaded key in the
Password parameter. You can load a key with LoadKey
function.
If the function fails the return
value is False and the Error
property contains the error code .
Analyzing this property you can find the reason of the failure. If you
want to encrypt files you should use EncryptFile
function.
|