View this markdown with:
$ sudo pip3 install grip
$ grip -b README.md
Article about using SSH public key to encrypt is here
To encrypt a small file directly with SSH public key, use this:
openssl rsautl -encrypt -oaep -pubin -inkey <(ssh-keygen -e -f ~/.ssh/id_rsa.pub -m PKCS8) -in <file_to_encrypt> -out <encrypted_file>
To decrypt it, use this:
openssl rsautl -decrypt -oaep -inkey ~/.ssh/id_rsa -in <encrypted_file> -out <decrypted_file>
openssl rand -out secret.key 32
openssl aes-256-cbc -in secretfile.txt -out secretfile.txt.enc -pass file:secret.key
openssl rsautl -encrypt -oaep -pubin -inkey <(ssh-keygen -e -f recipients-key.pub -m PKCS8) -in secret.key -out secret.key.enc
openssl rsautl -decrypt -oaep -inkey ~/.ssh/id_rsa -in secret.key.enc -out secret.key
openssl aes-256-cbc -d -in secretfile.txt.enc -out secretfile.txt -pass file:secret.key