StaticdecryptDecrypts 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.
StaticencryptEncrypts 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]".
StaticgenerateGenerates a cryptographically secure random key of the required length (32 bytes).
A Buffer containing the secret key.
StaticpartsSplit the encripted string by the delimeter and return the parts as object
encrypted string
parts EncriptionParts
A utility class for aes-256-gcm encryption and decryption operations. It uses streams for processing to handle potentially large data efficiently.