ssl/conversion.txt
author Tomas Zeman <tzeman@volny.cz>
Thu, 17 Sep 2015 07:24:39 +0200
changeset 40 eace2739e6b8
parent 38 68d27bdf49c9
permissions -rw-r--r--
mutt/search-by-date

http://superuser.com/questions/576506/how-to-use-ssh-rsa-public-key-to-encrypt-a-text
http://goodworkaround.com/node/17

OpenSSH -> OpenSSL
==================

  * Pubkey conversion:

  ssh-keygen -f ~/.ssh/id_rsa.pub -e -m pkcs8 > /tmp/id_rsa.pub.pem


OpenSSL operations
==================

  * Encryption:

  openssl rsautl -encrypt -pubin -inkey /tmp/id_rsa.pub.pem > /tmp/c.txt

  * Decryption:

  openssl rsautl -decrypt -inkey ~/.ssh/id_rsa -in /tmp/c.txt

  * Signing:

  openssl dgst -sha1 -sign ~/.ssh/id_rsa file.txt > file.txt.sig

  * Verification:

  openssl dgst -sha1 -verify /tmp/id_rsa.pub.pem -signature file.txt.sig file.txt