ssl/conversion.txt
author Tomas Zeman <tomas@functionals.cz>
Fri, 31 Dec 2021 12:25:17 +0100
changeset 41 c4f9f37e9a28
parent 38 68d27bdf49c9
permissions -rw-r--r--
Fossil SCM: Linking Tickets to Checkin's http://chiselapp.com/user/cutterpillow/repository/fossil-iOS/wiki?name=Cookbook#ticket-checkin-links

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