Last active
April 25, 2017 13:55
-
-
Save ggrandes/2564f7815cfa6c2e9b61 to your computer and use it in GitHub Desktop.
OpenSSL ECDSA file Signature / Verify
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
# 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