Module: crypto/public_key/elliptic/ecdh

Key encryption and decryption for RFC 6637 ECDH

Source:

Requires

Methods

(async, inner) decrypt(oid, cipher_algo, hash_algo, V, C, d, fingerprint) → {Promise.<Uint8Array>}

Decrypt and unwrap the value derived from session key

Parameters:
Name Type Description
oid module:type/oid

Elliptic curve object identifier

cipher_algo module:enums.symmetric

Symmetric cipher to use

hash_algo module:enums.hash

Hash algorithm to use

V BN

Public part of ephemeral key

C Uint8Array

Encrypted and wrapped value derived from session key

d Uint8Array

Recipient private key

fingerprint String

Recipient fingerprint

Source:
Returns:

Value derived from session

Type
Promise.<Uint8Array>

(async, inner) encrypt(oid, cipher_algo, hash_algo, m, Q, fingerprint) → {Promise.<{V: BN, C: BN}>}

Encrypt and wrap a session key

Parameters:
Name Type Description
oid module:type/oid

Elliptic curve object identifier

cipher_algo module:enums.symmetric

Symmetric cipher to use

hash_algo module:enums.hash

Hash algorithm to use

m module:type/mpi

Value derived from session key (RFC 6637)

Q Uint8Array

Recipient public key

fingerprint String

Recipient fingerprint

Source:
Returns:

Returns ephemeral key and encoded session key

Type
Promise.<{V: BN, C: BN}>