Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for 25519 and 448 #89

Open
rmhrisk opened this issue Feb 2, 2017 · 14 comments
Open

Add support for 25519 and 448 #89

rmhrisk opened this issue Feb 2, 2017 · 14 comments

Comments

@rmhrisk
Copy link
Contributor

rmhrisk commented Feb 2, 2017

https://datatracker.ietf.org/doc/draft-ietf-curdle-pkix/

@gnarea
Copy link
Contributor

gnarea commented Jul 13, 2020

FYI: There's a proposal to bring Curve25519 to WebCrypto (see also tQsW/webcrypto-curve25519#6). Although I guess we'd also need @peculiar/webcrypto to support it so it can be used on Node.js.

@gnarea
Copy link
Contributor

gnarea commented Feb 2, 2021

Support for both curves just landed on Node 15.8: nodejs/node@53a0bdff47

@rmhrisk
Copy link
Contributor Author

rmhrisk commented Feb 2, 2021

@gnarea PRs welcomed /cc @microshine

@microshine
Copy link
Contributor

I like the idea to support those curves

@gnarea
Copy link
Contributor

gnarea commented Feb 5, 2021

I'll try to have a go in the coming weeks.

Presumably we'll have to change https://github.com/PeculiarVentures/webcrypto too, and make sure that when other engines (e.g., the browser-based one) use of these algorithms a meaningful error is thrown (like "Ed25519 is not supported by this engine").

@microshine
Copy link
Contributor

@gnarea The latest version of @peculiar/webcrypto supports EdDSA and ECDH-ES mechanisms with (Ed25519, Ed448, X25519 and X448 curves)
PeculiarVentures/webcrypto#25

@microshine
Copy link
Contributor

@gnarea For which operation do you need those curves (eg CSR/cert generation, chain validation, etc)?

@gnarea
Copy link
Contributor

gnarea commented Feb 5, 2021

Awesome! 👏 👏

I only need to do these things with Ed25519/Ed448:

  • Issue certificates.
  • Validate chains.
  • Sign SignedData values.
  • Verify SignedData values.

@microshine
Copy link
Contributor

I'm going to support those mechanisms in webcrypto-liner too (~1 week)

PKIjs allows supporting new mechanism by extending CryptoEngine. See an example of an extended engine https://github.com/PeculiarVentures/PKI.js/blob/master/examples/NodePKCS12Example/NodeEngine.js

@gnarea
Copy link
Contributor

gnarea commented Feb 5, 2021

That's amazing!

We're in a code freeze right now because we're getting ready to launch, but I'll try it as soon as I can afterwards.

@microshine
Copy link
Contributor

@gnarea I added an example with an updated liner for trying
PeculiarVentures/webcrypto-liner#57 (comment)

@gnarea
Copy link
Contributor

gnarea commented Feb 9, 2021

Thanks for the example @microshine! Seems pretty straightforward which is awesome.

@CMCDragonkai
Copy link

Can you make it possible to encrypt/decrypt with x25519? This is possible with node's webcrypto experiment with 25519 curves.

@gnarea
Copy link
Contributor

gnarea commented Sep 19, 2022

@CMCDragonkai, that'd require implementing RFC 8418, which I believe would be different from the OP.

That's something I've wanted to contribute for a while but haven't had the chance so far. Maybe if you have the time and the Peculiar Ventures team like the idea of supporting RFC 8418, you could discuss how you'd do implement it and propose a PR.

See also: #254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants