Class: Secret

Secret

Represents a secret key/passphrase and provides utilities for encryption and decryption of other arbitrary secrets

new Secret(passphrase)

Parameters:
Name Type Description
passphrase buffer | string
Source:

Methods


decrypt(target)

Given a passphrase, decrypts the target data and returns it
Parameters:
Name Type Description
target buffer | string
Source:
Returns:
Type
buffer

encrypt(target)

Given a passphrase, encrypts the target data and returns it
Parameters:
Name Type Description
target buffer | string
Source:
Returns:
Type
buffer