Parameters
[secretKey]: String|Buffer|Array, A valid stream secret key
String name of the default crypto primitive used in stream operations
Get the auth-key secret key object
Set the default encoding to use in all string conversions
Parameters
encoding: String, encoding to use
Get the current default encoding
Encrypt the message
Parameters
message: string|Buffer|Array, message to authenticate
[encoding: String, ] If v is a string you can specify the encoding
The decrypt function verifies and decrypts a cipherText using the secret key and a nonce. The function returns the resulting plaintext m.
Parameters
cipherText: Buffer|String|Array, the encrypted message
nonce: Buffer|String|Array, the nonce used to encrypt
[encoding]: String, the encoding to return the plainText