Monday, 17 March 2014

Keep files secure and edit GPG Files easily with Vim

Its important to ensure any sensitive data is encrypted in files. That being said I was surprised by how easy it is to be able to use vim to edit gpg files. gnupg.vim is a Plugin for transparent editing of gpg encrypted files.

On Arch Linux I just :
  • Created a plugin directory for Vim as one did not already exist
$ sudo mkdir ~/.vim/plugin/
  • Copied the gnupg.vim script to the plugin folder
  • Then I was easily able to edit and save the gpg files :)
  • Version wise I was using gpg2 with vim 7.4.
 Useful information on the plugin :
  • The filename must have a ".gpg", ".pgp" or ".asc" suffix
  • The script turns off viminfo and swapfile to increase security.
  • When opening such a file the content is decrypted
  • When opening a new file the script will ask for the recipients of the encrypted file
  • The file content will be encrypted to all recipients before it is written

Hopefully this will make it easier for you to keep sensitive data private. 

No comments:

Post a Comment