Before you can do any encryption you must select your
secret password that will be used to retrieve information
back to a plaintext state. Typically, this should be some
text not smaller than the size of KeySize property.
If your password is smaller, wodCrypt will add spaces after the
password up to size needed. If its size is larger than needed,
then it will be truncated when it is passed to the
crypt engine.
It is also wise to calculate a hash/digest value (using
MD5 or SHA1) on the password, and use the resulting text as the
password provided to the wodCrypt component. In this case,
there will usually be enough information for wodCrypt to
encrypt your data, without padding the password
with spaces. TripleDES still needs
a few more bytes to make a secure password, since its
password size should be 24 bytes - you will need to decide how
to enlarge it.
When you want to sign and verify using RSA and DSA algorithms,
you need:
a private key to sign some
data
a public key to verify someone's
signature
In both cases, you can use our wodKeys component. wodKeys
has the properties PrivateKey and PublicKey (string properties)
which you should pass into the SecretKey property to transfer the key
properly from wodKeys to wodCrypt. Typically, you can do it
like this:
Set key = New Keys ' initialize
wodKeys instance
key.Load "c:\keys\secret.key" ' load stored key
......
wodCrypt1.SecretKey = key.PrivateKey(DSAkey) ' get private key
wodCrypt1.Sign datablob, outblob '
and sign the data
......
later on
......
wodCrypt2.SecretKey = key.PublicKey(DSAkey) ' get public key
If (wodCrypt2.Verify(datablob,
someblob)) Then '... ' and verify signature