-
Notifications
You must be signed in to change notification settings - Fork 284
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
Need help encrypting a message using a key pair #4211
Comments
Instead trying generateKeyPair with type "ec" and named curve
prettydiff/share-file-systems@80851d7 Shows the actual project code with the commit converting from "ed448" to type "ec". |
I am going to drop asymmetric key exchange and instead try to solve this problem using a shared secret, probably in the form of HMAC. |
@prettydiff Neither Ed448 nor X448 support encryption. You can use X448 to exchange keys between multiple parties, and you can use Ed448 to digitally sign messages. Neither algorithm is meant for encrypting messages. |
Details
I can successfully generate key pairs using (TypeScript):
The code that errors is the
privateEncrypt
function. The error:error:03000096:digital envelope routines::operation not support for this keytype
Here are some combination of things I have tried:
publicEncrypt
privateEncrypt
function.hex
andbase64
. In the sample above no encoding is specified so defaulting toutf8
.ed448
withx448
.aes-256-cbc
I am not sure why this refuses to work. Could the problem be the use of
ed448
?Node.js version
20.5.0
Example code
No response
Operating system
Windows 10
Scope
Runtime
Module and version
Not applicable.
The text was updated successfully, but these errors were encountered: