Monday, May 11, 2020

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

Eli the Bearded wrote:

> 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.

Isn't that avoided by Vim requiring you to enter the same password
again? Can hardly accidentlly type the same random text twice.

It really only makes a difference when using ZZ or a similar "write only
when changed" command.

--
Warning label on a superhero Halloween costume:
"Caution: Cape does not enable user to fly."

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
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/202005111747.04BHl8BN017662%40masaka.moolenaar.net.

No comments: