The Buffer instance or String containing the data to be encrypted.
A Buffer instance containing the key to be used by the AES-256-CBC
algorithm
for encrypting data
. Ideally, that buffer would be of size 32 bytes, but, internally, this function will
prepare the key
with prepareKey in order to make it 32 bytes. This allows for passwords of
arbitrary sizes, even if shorter passwords are less secure.
A Buffer instance containing the encrypted data, prepended by an internally randomly generated 128-bit (i.e., 16 bytes) initialization vector.
Internally, this function uses Node's crypto.Cipher class to perform encryption.
Encrypting the same data twice using the same password will yield different outputs, as the initialization vector is randomly generated on each call.
Generated using TypeDoc
A function that can be used to encrypt arbitrary data using the
AES-256-CBC
algorithm.