A service that uses a key to encrypt and decrypt data.

Select the appropriate algorithm based on the use case:

  • 'fast': ChaCha20-Poly1305 - Modern, fast authenticated encryption (good for high-throughput scenarios).
  • 'balanced': AES-256-CTR - Good balance of speed and security (needs separate HMAC for authentication).
  • 'secure': AES-256-GCM - Maximum security with built-in authentication (recommended for sensitive data).

Note: The key should be exactly 32 bytes for all algorithms. If the key is shorter, it will be padded with zeros; if longer, it will be truncated to 32 bytes.

Implements

Constructors

Methods

Constructors

Methods