AES algorithm.
Required Parameters
- keyVaultEntry: The name of the encrypted vault item to use for the key. Values stored in this vault item must match the encoding set in keyVaultEntryFormat and meet the length requirement of the selected algorithm.
- ivVaultEntry: The name of the encrypted vault item to use for the initialization vector (IV). Values stored in this vault item must match the encoding set in ivVaultEntryFormat and meet the length requirement of the selected algorithm.
Optional Parameters
- algorithm: The name of the algorithm used for encryption. AES is currently the only supported value. It supports 128, 192, and 256-bit key lengths.
- cipherMode: The method used to process and encrypt the data. Accepted values are:
CBC,ECB,OFB,CFB,CTS,8OFB,8CFB,GCM,CTR, andXTS. The default isCBC. - paddingMode: The method used to handle extra or missing data when encrypting a message, ensuring the plaintext is correctly constructed. Accepted values are:
PKCS7,Zeros,None,ANSIX923, andISO10126. The default isPKCS7. - keyVaultEntryFormat: The encoding on the value stored in the keyVaultEntry item. Accepted values are:
HEX,BASE64,8BIT, andRAW. The default isHEX. - ivVaultEntryFormat: The encoding on the value stored in the ivVaultEntry item. Accepted values are:
HEX,BASE64,8BIT, andRAW. The default isHEX. - data: The data to encrypt.
- file: The file to encrypt.
- outFile: The file in which to store the encrypted data.
- inFormat: The format to use for encrypted input data. Accepted values are:
HEX,BASE64,8BIT, andRAW. The default isHEX. - outFormat: The format to use for encrypted output data. Accepted values are:
HEX,BASE64,8BIT, andRAW. The default isHEX.
Output Attributes
- data: The encrypted data, if outFile was not specified.
- outFile: The file containing the encrypted data, if outFile was specified.
Example
In the following example, the cryptoEncrypt operation is used to encrypt a specific value. It uses the default AES algorithm and the default HEX encoding for the keyVaultEntryFormat and ivVaultEntryFormat parameters. Because it uses the defaults, these parameters do not need to be explicitly set. This means that the values stored in the “key” and “iv” vault items for keyVaultEntry and ivVaultEntry must be exactly 128-bit HEX encoded values. For example:- Value stored in the “key” vault item: 7A3F9D5C1E8B6A407D2E4C9F5B1A6D3E
- Value stored in the “iv” vault item: C1D4A7F82E395B6C4D7A1E3F9B02586D