Closed EternalDeiwos closed 7 years ago
Further notes regarding ECDSA for bitcoin:
Bitcoin uses the secp256k1
curve and RIPEMD-160
and SHA-256
for hashes.
According to SafeCurves this is also broken like the NIST curves. The general feeling is to use ED25519 (which is supposedly safe)
We can now get x and y coords from a ECDSA key
https://gist.github.com/EternalDeiwos/f06faadca0894f32d023e6511bd2a935
Regarding conversion between PKCS1 and PKCS8 PEM encoded private keys:
For all purposes, PKCS1 and PKCS8 private keys are exactly equivalent. The only difference is that PKCS8 private keys include algorithm and parameter metadata and must therefore be parsed differently.
This command will accept a PKCS1 private key and produce a PKCS8 private key:
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in pkcs1.pem -out pkcs8.pem
OR
cat pkcs1.pem | openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -out pkcs8.pem
Regarding taking a look at ECDSA stuff with @thelunararmy
JWA curve names to OpenSSL curve names:
All of these are currently supported by OpenSSL/Node and the use of which is featured in their docs
OpenSSL:
openssl ecparam --name prime256v1 -genkey -noout -out privateKey.pem
openssl ec -in privateKey.pem -pubout -out publicKey.pem