[TIL] 0719 ECDSA

IT/TIL(Today I Learnt)|2022. 7. 20. 09:53

Today I Learnt 

0719 :

 

 

what is ETL engineer :

https://www.altexsoft.com/blog/datascience/who-is-etl-developer-role-description-process-breakdown-responsibilities-and-skills/#:~:text=An%20ETL%20developer%20is%20a,time%20data%20into%20many%20systems.

 

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

댓글()