aes_encrypt
Encrypt text with AES using a hex-encoded key, supporting CBC and GCM modes for data protection.
Instructions
Encrypt data using AES.
Args: key: Hex-encoded AES key (16, 24, or 32 bytes). data: String to encrypt. mode: Encryption mode - 'CBC' or 'GCM' (default CBC).
Returns: Dictionary with 'ciphertext' (hex) and 'iv' (hex).
Raises: ValueError: If key size is invalid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | ||
| data | Yes | ||
| mode | No | CBC |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||