Monday, May 11, 2020

Re: Encryption is not considered a change by the :x command

Tony Mechelynck <antoine.mechelynck@gmail.com> wrote:
> Ninu-Ciprian Marginean <ninu.ciprian.marginean@gmail.com> wrote:
>> When we look at the quickref documentation we find:
>> If we open an existing file and we do not do any changes except for
>> changing the encryption key(with the ":X" command) and then use the ":x"
>> command to exit, the changes to the encryption key will not be applied.
...
>> Is this a bug? Is it intended? Anyways, I just wanted to leave this
>> here for people to know the workaround. If it's a bug, I'm willing to
>> report one on github.
> If it's a bug (I'm not sure) most developers read this mailing list too
> anyway.

I don't think it is a bug. I make use of encrypted files regularly. I
believe it is that way to prevent any accidental encryption of a
previously plaintext file. Because that is a real pain in the neck.[*]

There are many ways cryptmethod and key can be set: $HOME/.vimrc, "set
exrc" and ./.vimrc, "set modeline" and modelines, etc. Vim can try (and
may actually do so) to protect you against key being set
non-deliberately, but it can only go so far.

Additionally using :X to encrypt-save the file is the recommended way to
set the encryption key because it is the most robust against the key
being exposed.

[*] That one time in the early 1990s when I hit <colon><x> with capslock
on and vi (or vim2 or vim3) accepted a password of a bunch of
control keys like backspace, <ctrl-c>, <ctrl-z>, etc, is seared into
*my* memory. It really made me hate programming languages with
all caps keywords and case-sensitivity.

Elijah

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/49LSR547SmzfYt%40panix5.panix.com.

No comments: