Back to product page

SecretKey property


Holds secret key or certificate for various crypto-related operations.

Type

A Variant value. String expression that holds the password or a Blob/Keys interface reference that holds a RSA/DSA public/private key.

Syntax

  • Basic
object.SecretKey [= value]
The SecretKey(object,value) syntax has these parts:
objectAn expression evaluating to an object of type wodCrypt.
valueA Variant value.

Remarks

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.

Code sample

  • Basic

Platforms

Windows