Vim (vi improved) is a very beautiful tool, with this tool you can do a lot of things.
For example Vim offers to you a simple way to crypt/decrypt a text file.
To crypt an existing fie you could open it with the command line option -x:
# vim -x existing_file.txt
vim will ask you to type a password two times. Now to crypt the file you shall save it with :w command.
You can also open the existing file normally, and then you can say to vim to crypt it with the :X command.
When you will try to open an encrypted file vim will ask you for the password.
Please remeber that Vim’s encryption is based on the UNIX crypt, which is a single-rotor enigma system and this system is well known to be breakable.
For more information you could refer to the following link:
GG1