Encryption with vim

From Notes_Wiki

Home > CentOS > CentOS 6.x > Text editors > Vim > Encryption with vim

It is possible to encrypt files with vim so that they are not readable by anyone who does not has encrypted key (password). To create a new file with encryption support with vim use:

   vim -x <filename>

The created file is automatically marked as encrypted using magic flags. To edit the same file again simple:

  vim  <filename>

command can also be used. Vim will automatically understand that file is encrypted and prompt for password.


Encrypting existing file

To encrypt an existing file, use following option in normal mode

   :X


Disable encryption

To disable encryption from existing file use following command in normal mode

   :set key=

Learned from http://vim.wikia.com/wiki/Encrypt_a_file_without_leaving_traces and http://vim.wikia.com/wiki/Encryption


Home > CentOS > CentOS 6.x > Text editors > Vim > Encryption with vim