- openssl
- ssh-keygen
- sshpub-to-rsa
- Python with the following libs:
- pyasn1
- Python with the following libs:
If you haven't already, generate an SSH key using ssh-keygen. Not that you encrypt with the public key (that everyone has) and decrypt with the private key (the secret key only you have).
# ssh-keygen -b 2048
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/username/.ssh/id_rsa): booger_rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in booger_rsa.
Your public key has been saved in booger_rsa.pub.
The key fingerprint is:
69:1d:8c:9e:24:14:c7:80:4a:a7:83:a1:77:43:23:a5 [email protected]
The key's randomart image is:
+--[ RSA 2048]----+
| ...++. |
|. o.=. ..o |
|.+E* .. o o |
|o = o + + . |
| . o . S . |
| . |
| |
| |
| |
+-----------------+
To encrypt:
sh encrypt_with_pub.sh id_rsa.pub cleartext_file.txt
To decrypt:
sh decrypt_with_priv.sh id_rsa base64_encrypted_file.txt