Created
April 12, 2017 07:52
-
-
Save pivstone/79b7d41635418083ea11e7624035334c to your computer and use it in GitHub Desktop.
ecdsa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{Pub,Priv} = crypto:generate_key(ecdh,secp256r1), | |
Msg = crypto:rand_bytes(5100), | |
Sig = crypto:sign(ecdsa,sha256,Msg,[Priv,secp256r1]), | |
byte_size(Sig). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# need ecdsa lib, | |
# pip install ecdsa | |
import os | |
from hashlib import sha256 | |
from ecdsa import SigningKey,NIST256p | |
sign_key = SigningKey.generate(curve=NIST256p, hashfunc=sha256) | |
data_string = os.urandom(5100) | |
sig = sign_key.sign(data_string, hashfunc=sha256) | |
print(len(sig)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment