Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

x25519 encrypt/decrypt? #121

Closed
getify opened this issue Feb 24, 2024 · 1 comment
Closed

x25519 encrypt/decrypt? #121

getify opened this issue Feb 24, 2024 · 1 comment

Comments

@getify
Copy link

getify commented Feb 24, 2024

I saw in another issue that you intentionally don't implement montgomery curve operations. I believe/assume this means you intentionally don't have an encrypt() / decrypt() method pair on the x25519 API, correct?

Is there a way to do so, perhaps with the abstract API or utils, given having the x25519 keypair ready?

I'd like to do something like this:

let encBuffer = encrypt(msgBuffer, x25519pk, ivBuffer);
let msgBuffer_2 = decrypt(encBuffer, x25519sk, ivBuffer);

Thanks for any guidance.

@paulmillr
Copy link
Owner

If you are talking about encrypting-to-public-key aka hybrid encryption, this is out of scope for noble-curves, because it involves using ciphers (noble-ciphers). The encryption itself does not involve curves at all. And we only provide low-level primitives per-package.

Dajiaji built HPKE.js on top of noble, conforming to RFC 9180, which has x25519 based encryption: https://github.com/dajiaji/hpke-js/blob/main/x/dhkem-x25519/README.md

Repository owner locked and limited conversation to collaborators Feb 24, 2024
@paulmillr paulmillr converted this issue into discussion #123 Feb 24, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants