API Docs for: 0.2.0
Show:

lockbox.BoundCipher Class

The standard Lockbox bi-directional cipher, with a bound key.

Constructor

lockbox.BoundCipher

(
  • key
  • [encryptionCipher]
  • [decryptionCipher]
  • [ursa]
)

Parameters:

  • key ursa.Key

    The key to encrypt and decrypt with.

  • [encryptionCipher] lockbox.EncryptionCipher optional

    The encryption cipher to use.

  • [decryptionCipher] lockbox.DecryptionCipher optional

    The decryption cipher to use.

  • [ursa] Ursa optional

    The Ursa module to use.

Item Index

Methods

Methods

decrypt

(
  • data
)
Buffer

Decrypt a data packet.

Throws:

Parameters:

  • data String | Buffer

    The data to decrypt.

Returns:

Buffer:

The decrypted data.

encrypt

(
  • data
)
Buffer

Encrypt a data packet.

Parameters:

  • data String | Buffer

    The data to encrypt.

Returns:

Buffer:

The encrypted data.