ychbn

Main | About | Contact | Archive

Openssl for text files encryption

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 this, but openssl is my choise. It’s simple, already installed in 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 ask for password.

To decrypt file:

openssl aes-256-cbc -a -d -in textfile.txt.enc -out textfile.txt

Work with openssl on Windows

In Windows I work with openssl via git-bash.exe. This is the bash emulator wich comes with git for Windows.

To encrypt file with openssl in Windows, following command are used:

winpty openssl aes-256-cbc -a -salt -in textfile.txt -out textfile.txt.enc

Same way for decrypt file:

winpty openssl aes-256-cbc -a -d -in textfile.txt.enc -out textfile.txt
comments powered byDisqus

Build with Jekyll and true minimal theme