Giter Club home page Giter Club logo

jose-x25519-ecdh's Introduction

Deprecated!

As of Feb 18th 2020, the release of jose@^1.23.0 supports ECDH-ES for both X25519 and X448 on Node.js runtime with improved diffie-hellman support. This module is no longer needed, is deprecated and repository archived.

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.

jose-x25519-ecdh's People

Contributors

panva avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

prakashgaikwad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.