Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

create-ecdh

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-ecdh

createECDH but browserifiable

  • 4.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.5M
decreased by-18.29%
Maintainers
4
Weekly downloads
 
Created

What is create-ecdh?

The create-ecdh npm package is a library that provides an interface for creating Elliptic Curve Diffie-Hellman (ECDH) key pairs. It is used to securely exchange cryptographic keys over a public channel and is commonly used in the implementation of secure communication protocols.

What are create-ecdh's main functionalities?

Key Pair Generation

This feature allows the generation of ECDH key pairs, which can be used for secure key exchange.

const createECDH = require('create-ecdh');
const ecdh = createECDH('secp256k1');
ecdh.generateKeys();

Compute Shared Secret

Using this feature, one can compute a shared secret given the other party's public key, which can then be used to derive encryption keys for secure communication.

const theirPublicKey = Buffer.from('their public key hex', 'hex');
const sharedSecret = ecdh.computeSecret(theirPublicKey);

Get Public Key

This feature retrieves the public key of the generated ECDH key pair, which can be shared with the other party.

const publicKey = ecdh.getPublicKey();

Set Private Key

This feature sets the private key for the ECDH instance, which can be used to compute the shared secret or regenerate the public key.

const privateKey = Buffer.from('your private key hex', 'hex');
ecdh.setPrivateKey(privateKey);

Other packages similar to create-ecdh

Keywords

FAQs

Package last updated on 04 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc