This package has been deprecated

Author message:

jose now supports ECDH-ES with X25519 and X449 on Node.js runtime with improved diffie-hellman support, this module is no longer needed

jose-x25519-ecdh

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i jose-x25519-ecdh

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

9.46 kB

Total Files

5

Last publish

Collaborators

  • panva