Openssl for text files encryption


date: 2020-01-07 11:38:01 +0300


Main

About

Contacts


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

Work with openssl on Windows


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






/posts/