I have a password protected file in vim.
Yesterday when I tried to open it in vim, got random characters.
I tried to open it in vim in different OS (Linux, Windows, MacOS) and different vim versions (8 and 9), in vain.
I tried also with backups of the file, without success.
I used the password hundreds of times in the last few years, so it's unlikely I forgot it.
How can we explain this and what else can I try ?
VimCrypt~
followed by a number (01, 02, 03, or 04). You can check by pressing^C
at the password prompt which will display the "raw" file, or with something likeless -F file
orhead -c 12 file
. And what does:set cryptmethod?
show after you've opened the password protected file and entered the password?head -c 12 file
gaveVimCrypt~01!
VimCrypt~01!
is the old (insecure)cryptmethod=zip
that's been around forever, so maybe try Vim 7.4 or 7.3? If that doesn't work then my best guess is that either the file and its backups are corrupted, or you somehow did end up using the wrong password after all (maybe you typo'd it when you encrypted the file?)