[kwlug-disc] encrypted files with vim

Chris Frey cdfrey at foursquare.net
Mon Sep 5 17:21:04 EDT 2022


Today I learned that vim can handle encryption.  Recent versions support
non-junk encryption, like blowfish.

To start:

	vim -x private-file.txt

It will prompt you for a passphrase, and then encrypt it on disk
when you write it.  Use -n if you wish to avoid swap files, but if you
do use swap files, they will be encrypted too.

There is no verification of the file when you reopen it, so if you enter
the wrong passphrase, you will just get junk binary instead of an error.

It remembers what type of encryption it used in the file header.
Historical reasons give 3 types: pkzip style, blowfish, and blowfish2.
Blowfish2 is the one you want, and is the default in modern versions.

- Chris





More information about the kwlug-disc mailing list