Skip to content

Instantly share code, notes, and snippets.

@ggrandes
Last active April 25, 2017 13:55
Show Gist options
  • Save ggrandes/2564f7815cfa6c2e9b61 to your computer and use it in GitHub Desktop.
Save ggrandes/2564f7815cfa6c2e9b61 to your computer and use it in GitHub Desktop.
OpenSSL ECDSA file Signature / Verify
# Original Source:
# https://gist.github.com/ggrandes/2564f7815cfa6c2e9b61
# Generate ECDSA Key-Pair
openssl ecparam -name secp521r1 -genkey -out test.key
openssl ec -pubout -in test.key -out test.pub
# Signature
openssl dgst -sha512 -sign test.key some-file.txt | openssl enc -a -e > some-file.txt.sign
# Verify
openssl enc -a -d < some-file.txt.sign | openssl dgst -sha512 -verify test.pub -signature /dev/stdin some-file.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment