Skip to content

Instantly share code, notes, and snippets.

@pivstone
Created April 12, 2017 07:52
Show Gist options
  • Save pivstone/79b7d41635418083ea11e7624035334c to your computer and use it in GitHub Desktop.
Save pivstone/79b7d41635418083ea11e7624035334c to your computer and use it in GitHub Desktop.
ecdsa
{Pub,Priv} = crypto:generate_key(ecdh,secp256r1),
Msg = crypto:rand_bytes(5100),
Sig = crypto:sign(ecdsa,sha256,Msg,[Priv,secp256r1]),
byte_size(Sig).
# 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