class CipherKey

Description

CipherKey stores the key information for decryption/encryption of data. To create a random key, using the following code:

CipherKey key("aes-256");

Note that you won't be able to decrypt data encrypted with a random key once the Cipher is destroyed unless you persist the generated key and IV. An example usage for random keys is to encrypt data saved in a temporary file.

To create a key using a human-readable password string, use the following code. We create a AES Cipher and use a salt value to make the key more robust: