Vim can also be used to safely store information by encrypting text files with different crypt methods to see the creep method that vim is currently using. type this command. We can see in our case it is deep, which is not actually a crypto method and does not offer much in terms of security. To see what different alternatives we have, we can type the following command. A page describing the different encryption methods comes up. We can choose from zip, blowfish, and blowfish to the most secure and recommended one is of course the last one blowfish to to change the encryption method type the following command.
This can be also added to the vim configuration file, so that it becomes the default encryption. Now we can safely encrypt files using vim. A common scenario would be storing a password file. Let's open up a new file called passwords dot txt. Add some dummy password inside and save it. Our next step is to encrypt the file with a password and for this we type colon uppercase x.
We will prompt you for a password twice. If you exit without saving the file, the encryption will not be applied. Now encrypted again, save and exit the file. When we reopen it, vim will ask for the same password. If we get this wrong, vim will show some random characters that come from the failed decryption. Only if we type the correct password, will we get the actual file content?
Saving encrypted files with vim combined with backing up the file, places like private get to a repository or a private Dropbox folder can be an effective way of storing your passwords. And it has the benefit that it's sort of a unique method of storing passwords compared to using online services that are pretty standard and might get common This can also be referred to as security through obscurity.