Global

Members

(constant) AES_CBC_HMAC

AES_CBC_HMAC module. Sign and encrypt data using AES-CBC symetric encryption, with HMAC for message authentication.

https://tools.ietf.org/html/rfc7518#section-5.2.2

Source:

(constant) AES_GCM

AES_GCM module. Sign and encrypt data using AES-GCM symetric encryption.

Source:

(constant) algs

All supported algorithms.

Source:

(constant) ECDH_AES

ECDH_AES module. Implements ECDH-ES+AES_GCM encryption and decryption.

https://tools.ietf.org/html/rfc7518#section-4.6

Source:

(constant) ECIES_BIE1

ECIES_BIE1 module. Implements Electrum-flavoured ECIES encryption and decryption.

Source:

(constant) ES256K

ES256K module. Implements ECDSA signatures on the secp256k1 curve. Uses 65 byte compact signatures.

Source:

(constant) ES256K_BSM

ES256K_BSM module. Calculates a message digest using the Bitcoin Signed Message algorithm, and uses 65 byte compact signatures.

Source:

(constant) HMAC

HMAC module.

Source:

(constant) params

Algorithm parameters

Source:

(constant) params

Algorithm parameters

Source:

(constant) params

Algorithm parameters

Source:

(constant) params

Algorithm parameters

Source:

Methods

assertKey(key, alg)

Asserts the key is valid.

Parameters:
Name Type Description
key Key
alg String
Source:

assertKey(key, alg)

Asserts the key is valid.

Parameters:
Name Type Description
key Key
alg String
Source:

assertKey(key, alg)

Asserts the key is valid.

Parameters:
Name Type Description
key Key
alg String
Source:

assertKey(key, alg)

Asserts the key is valid.

Parameters:
Name Type Description
key Key
alg String
Source:

assertKey(key, alg)

Asserts the key is valid.

Parameters:
Name Type Description
key Key
alg String
Source:

assertKey(key, alg)

Asserts the key is valid.

Parameters:
Name Type Description
key Key
alg String
Source:

assertKey(key, alg)

Asserts the key is valid.

Parameters:
Name Type Description
key Key
alg String
Source:

computeSharedSecret(privKey, pubKey) → {Buffer}

Computes and returns a ECDH shared secret from the given keys.

Parameters:
Name Type Description
privKey Key
pubKey Key
Source:
Returns:
Type
Buffer

computeSharedSecret(privKey, pubKey) → {Buffer}

Computes and returns a ECDH shared secret from the given keys.

Parameters:
Name Type Description
privKey Key
pubKey Key
Source:
Returns:
Type
Buffer

createMacMessage(opts) → {Buffer}

Creates the MAC message as per https://tools.ietf.org/html/rfc7518#section-5.2.2

Parameters:
Name Type Description
opts Object
Properties
Name Type Description
additionalData Buffer
iv Buffer
encrypted Buffer
Source:
Returns:
Type
Buffer

fromBsvPrivKey()

TODO

Source:

fromBsvPubKey()

TODO

Source:

(async) kdf(secret, alg, opts)

Implements Concat KDF as defined in NIST.800-56A.

Parameters:
Name Type Description
secret Buffer
alg String
opts Object
Source:

mergeKeyHeaders()

Helper function to merge key headers

Source:

messageDigest(msg) → {Buffer}

Creates a digest of the given message using the Bitcoin Signed Message algorithm.

Parameters:
Name Type Description
msg Buffer | String
Source:
Returns:
Type
Buffer

pubKeyBuf(key) → {Buffer}

Converts a Key to a Buffer

Parameters:
Name Type Description
key Key
Source:
Returns:
Type
Buffer

pubKeyBuf(key) → {Buffer}

Converts a Key to a Buffer

Parameters:
Name Type Description
key Key
Source:
Returns:
Type
Buffer

splitKey(key) → {Object}

Splits the key into two buffers - encryption key and mac key.

Parameters:
Name Type Description
key Key
Source:
Returns:
Type
Object

toBsvPrivKey()

TODO

Source:

toBsvPubKey()

TODO

Source: