lockbox.BoundCipher Class
The standard Lockbox bi-directional cipher, with a bound key.
Constructor
lockbox.BoundCipher
(
-
key
-
[encryptionCipher]
-
[decryptionCipher]
-
[ursa]
Parameters:
-
key
ursa.KeyThe key to encrypt and decrypt with.
-
[encryptionCipher]
lockbox.EncryptionCipher optionalThe encryption cipher to use.
-
[decryptionCipher]
lockbox.DecryptionCipher optionalThe decryption cipher to use.
-
[ursa]
Ursa optionalThe Ursa module to use.
Methods
decrypt
(
Buffer
-
data
Decrypt a data packet.
Throws:
- lockbox.exception.DecryptionFailedException If the decryption failed.
Parameters:
-
data
String | BufferThe data to decrypt.
Returns:
Buffer:
The decrypted data.
encrypt
(
Buffer
-
data
Encrypt a data packet.
Parameters:
-
data
String | BufferThe data to encrypt.
Returns:
Buffer:
The encrypted data.