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

jose-x25519-ecdh

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jose-x25519-ecdh

ECDH-ES implementation for X25519 keys extension for the jose module

  • 1.0.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

jose-x25519-ecdh

This is a plugin for the jose package that implements Key Agreement with Elliptic Curve Diffie-Hellman Ephemeral Static for X25519 OKP keys.

Why a plugin?

  1. It's backed by libsodium instead of node crypto, unfortunately Node.js does not support this ECDH yet
  2. It'll get deprecated once Node.js fills the missing feature gap and the functionality will be implemented in the jose module instead

Usage

Installing

npm install jose // jose ^1.16.0 declared as a peer dependency
npm install jose-x25519-ecdh
const jose = require('jose')
const x25519 = require('jose-x25519-ecdh')

(async () => {
  await x25519 // wait for libsodium to be ready!

  {
    const key = jose.JWK.generateSync('OKP', 'X25519')
    console.log(key.algorithms())
    console.log(jose.JWE.encrypt('foobar', key))
  }
})()

Note: X25519 OKP keys are only supported in Node.js runtime >= 12.0.0 and are not supported in electron due to BoringSSL not having the curve implemented.

Have a question about using jose? - ask.
Found a bug? - report it.
Missing a feature? - If it wasn't already discussed before, ask for it.
Found a vulnerability? - Reach out to us via email first, see security vulnerability disclosure.

Support

If you or your business use jose, please consider becoming a sponsor so I can continue maintaining it and adding new features carefree.

Keywords

FAQs

Package last updated on 28 Jan 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