Created
March 3, 2014 13:37
-
-
Save ggrandes/9325051 to your computer and use it in GitHub Desktop.
OpenSSL RSA file Signature / Verify
This file contains hidden or 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
# Generate RSA Key-Pair | |
openssl genrsa -out test.key 2048 | |
openssl rsa -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