[TIL] 0719 ECDSA
Today I Learnt
0719 :
what is ETL engineer :
What is ETL Developer: Role Description, Process Breakdown, Responsibilities, and Skills
Around 14 years ago, Clive Humby, a mathematician and data scientist said: “Data is the new oil.” Data obsession is all the rage today, as all businesses ar
www.altexsoft.com
Using prime256v1 curve to make ECDSA:
1. change the curve to prime256v1 , in the node package , private and public key
https://www.npmjs.com/package/starkbank-ecdsa
starkbank-ecdsa
fast openSSL-compatible implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA). Latest version: 1.1.4, last published: 8 months ago. Start using starkbank-ecdsa in your project by running `npm i starkbank-ecdsa`. There are 9 other project
www.npmjs.com
2. upload in the ec2
3. ec2 OpenSSL not supporting -sha3-256
4. download openssl
5. check and verify
openssl ecparam -name prime256v1 -genkey -noout -out private.pem
openssl ec -in privateKey.pem -pubout -out publicKey.pem
create a random message.txt file
openssl dgst -sha3-256 -sign private.pem -out signatureDer.txt message.txt
you can sign using private key to sign the message.
if you get error :
# 139974244096896:error:100C508A:elliptic curve routines:pkey_ec_ctrl:invalid digest type:crypto/ec/ec_pmeth.c:327:
check the following link, or update the openssl
apt-get install openssl
https://github.com/openssl/openssl/issues/8957
EVP_sha3_256() prehash works with RSA, but not with ECDSA · Issue #8957 · openssl/openssl
Specifying a reference to EVP_sha3_256() as the md prehash argument to EVP_DigestSignInit( ctx, NULL, md, NULL, pkey ) appears to work if pkey is an RSA key, fails catastrophically if the same expe...
github.com
6. I got somehow permission error :
from the level above dir:
chmod -R a+x *dir*
to give all users execute permission to all subdirectories and files
7. you can verify the message.
openssl dgst -sha3-256 -verify public.pem -signature signatureDer2.txt message.txt
Verified OK
'IT > TIL(Today I Learnt)' 카테고리의 다른 글
[TIL] 0722 (0) | 2022.07.25 |
---|---|
[TIL] Interview Prep (0) | 2022.07.20 |
[TIL] 0714 (0) | 2022.07.15 |
[TIL] 0713 (0) | 2022.07.14 |
[TIL] 0711 tide (0) | 2022.07.12 |