💾 Archived View for ychbn.flounder.online › posts › 2020-01-07-openssl-encryption.gmi captured on 2023-06-14 at 14:08:28. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
date: 2020-01-07 11:38:01 +0300
In one of my previous posts I described my workflow for syncing and editing text files via github and private repository.
Warning! Bad english (I try to learn, so I decide to write some posts in english).
Now I decide to encrypt my notes before sync.
There are many tools that can do it, but openssl is my choise.
It's simple, already installed on most linux distros and works on Windows.
So, this is how files are encrypted:
openssl aes-256-cbc -a -salt -in textfile.txt -out textfile.txt.enc
Then openssl will ask for password.
To decrypt file:
openssl aes-256-cbc -a -d -in textfile.txt.enc -out textfile.txt
On Windows I work with openssl via git-bash.exe.
It is a bash emulator which comes with git for Windows.
To encrypt file with openssl in Windows, use following command:
winpty openssl aes-256-cbc -a -salt -in textfile.txt -out textfile.txt.enc
Same way to decrypt file:
winpty openssl aes-256-cbc -a -d -in textfile.txt.enc -out textfile.txt