For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
| # references: | |
| # Learning by doing: Writing your own traceroute in 8 easy steps (Ksplice Blog) | |
| # https://blogs.oracle.com/ksplice/entry/learning_by_doing_writing_your | |
| # Edited by: Alejandro Almira <laboral at alejandroalmira.com> | |
| import datetime | |
| import socket | |
| import sys |
| # Generate ed25519 privkey | |
| openssl genpkey -algorithm ed25519 -out privkey.pem | |
| # export its pubkey | |
| openssl pkey -in privkey.pem -pubout -out pubkey.pem | |
| # Generate RSA privkey | |
| openssl genrsa -des3 -out private.pem 2048 | |
| # export its pubkey | |
| openssl rsa -in private.pem -outform PEM -pubout -out public.pem |