I’m having one doubt about the VIM ENCRYPTION key.
I having a text file, I encrypted that file using
:X
Now, where the encrypted key is stored (path).
Whether it stored in a separate file or the text file itself.
If I open a the file it asked Encryption key.
How it compare my key with the original key?
It doesn’t store the key – it just encrypts or decrypts with the key you type.
Here’s a hex dump of a 15-character file encrypted with a key (‘elephant’ – try it; the contents was not meaningful (‘abcdededesdasd’) before I encrypted it):
It’s 27 characters long; ‘VimCrypt~01!’ is 12 characters. If you decrypt it with the wrong key (say ‘pinkpanther’), you get garbage. So, vim does no integrity checking on the encrypted file or decrypted file.