-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Hi,
Maybe this is something that I don't understand in cryptography, but I've stumbled upon a strange behaviour.
I created a key pair for EC512 with the following commands:
openssl ecparam -genkey -name secp521r1 -noout -out ecdsa-p521-private.pem
openssl ec -in ecdsa-p521-private.pem -pubout -out ecdsa-p521-public.pem
Then, instead of using ECDSA as I should, I used RSA:
rsa = jwa('RS512');
signature = rsa.sign('hello', fs.readFileSync('ecdsa-p521-private.pem').toString());
rsa.verify('hello', signature, fs.readFileSync('ecdsa-p521-public.pem').toString());
And the result was true!
Is this an expected behaviour? Is it possible to use ECDSA keys for RSA and vice versa?
Thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels