Skip to content

Instantly share code, notes, and snippets.

@joshq00
Created January 20, 2016 22:35
Show Gist options
  • Save joshq00/bfef50326b1cedc5085e to your computer and use it in GitHub Desktop.
Save joshq00/bfef50326b1cedc5085e to your computer and use it in GitHub Desktop.
encode with ssh key
#!/bin/bash
# generate pub key
ssh-keygen -f ~/.ssh/id_rsa.pub -e -m PKCS8 > ~/.ssh/id_rsa.pem.pub
# encrypt | decrypt
openssl rsautl -encrypt -pubin -inkey ~/.ssh/id_rsa.pem.pub -ssl <<< somestring |
openssl rsautl -decrypt -inkey ~/.ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment