Closed prettydiff closed 12 months ago
Instead trying generateKeyPair with type "ec" and named curve sect571k1
the privateEncrypt function generates error:
error:00000000:lib(0)::reason(0)
https://github.com/prettydiff/share-file-systems/commit/80851d7cf0ba8520f184d1a1325a9febaaf0e72a 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.