innovaphone.crypto.ecdh

Example: Alice and Bob want to agree on a shared secret over an insecure channel. For that they use an ECDH key agreement.


        

innovaphone.crypto.ecdh

A class for ECDH key agreement.

innovaphone.crypto.ecdh(curve, includePointFormat)
A constructor for the object encapsulating a single ECDH handshake.
curve
Optional, defaulting to "secp256r1". The elliptic curve that shall be used. Allowed values are "secp256r1", "secp224r1", "secp192r1", "secp192k1", "secp160r1", "secp160k1" and "secp128r1".
includePointFormat
Optional, defaulting to false. If set to true the key shares include a prefix specifying the point format "04".
getLocalKeyShare()
Returns a hexstring representing the local key share.
getSharedSecret(remoteKeyShare)
Takes the remote key share and returns the shared secret as a hexstring.
remoteKeyShare
A hexstring representing the remote key share.