ReadonlyALGORITHMReadonlyENCODINGReadonlyIV_ReadonlyKEY_Decrypts an encrypted string created by the 'encrypt' method.
The combined encrypted string: "[version]:[iv]:[ciphertext]".
The decryption key (32 bytes).
A promise that resolves to the original plaintext string.
Encrypts data using AES-256-CBC with a promise-based stream approach.
The plaintext data to encrypt (can be a Buffer or string).
The encryption key (32 bytes).
A header/version to prefix the ciphertext (e.g., version info).
A promise that resolves to the combined encrypted string: "[version]:[iv]:[ciphertext]".
Generates a cryptographically secure random key of the required length (32 bytes).
A Buffer containing the secret key.
Split the encripted string by the delimeter and return the parts as object
encrypted string
parts EncryptionParts
Validates that the provided key is the correct length for the chosen algorithm.
The encryption key (Buffer or string that can be converted to Buffer).
A utility class for aes-256-gcm encryption and decryption operations. It uses streams for processing to handle potentially large data efficiently.