2016-09-04 Editing gpg encrypted text files 2 years ago
For a while I have been using the gnupg.vim plugin but I noticed recently after changing my gnupg configuration to show long IDs that this plugin had problems. I searched and found a new version of the plugin at vim-gnupg/gnupg.vim at master · jamessan/vim-gnupg which does not have this problem. So now I can simply keep text information in encrypted files and I need to type the passphrase every time I want to edit the file. The easiest way to create an encrypted file to use with this plugin is create an empty file, encrypt that file from the command line and then edit it with the plugin:$ touch datafile.txt $ gpg -e datafile.txt You did not specify a user ID. (you may use "-r") Current recipients: 4096g/0xCC166EB91F480E9A 2011-01-11 "Koos van den Hout <firstname.lastname@example.org>" Enter the user ID. End with an empty line: $ ls -l datafile.txt* -rw-r--r-- 1 koos users 0 Sep 4 20:49 datafile.txt -rw-r--r-- 1 koos users 1114 Sep 4 20:50 datafile.txt.gpg $ wipe datafile.txt Okay to WIPE 1 regular file ? (Yes/No) Yes Operation finished. 1 file wiped and 0 special files ignored in 0 directories, 0 symlinks removed but not followed, 0 errors occured.Now editing the file with vim datafile.txt.gpg goes through decrypting the file before starting the editing session and saves it encrypted when done.