💾 Archived View for ychbn.flounder.online › posts › 2020-01-07-openssl-encryption.gmi captured on 2021-12-06 at 14:29:53. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

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