我知道使用:set cryptmethod=zip并不安全,但是使用:set cryptmethod=blowfish的安全性如何?

在维基百科上,我读到河豚密码本身应该是安全的,但这并没有说明Vim实现的安全性。

交换文件,备份文件,撤消文件以及其他绕过河豚加密的可能方法又如何呢? Vim在那儿有多安全?

评论

既然您已经确定了所使用的算法,那么在信息安全方面真的会更好吗?

嗯该文档在这里有点混乱。 :h加密表示撤消和交换文件在7.3和7.4中均被加密,但是:h cryptmethod在7.4中仅明确提及了blowfish2的撤消文件。

@muru这是有关Vim基于河豚的加密的实现的问题,而不是河豚算法本身的问题。这个问题也将在信息安全方面成为话题,但是在这里并不能使其成为话题。答案是,事实上,河豚本身是安全的(即使不是最佳选择),但Vim对其实施是不好的。

#1 楼

这是不安全的。 David Leadbeater在一篇标题为Vim河豚加密...或者为什么不应该推出自己的加密货币的文章中发布了POC代码,将暴力破解高达64个字节。 Vim文档现在建议:

- The implementation of 'cryptmethod' "blowfish" has a flaw.  It is possible
  to crack the first 64 bytes of a file and in some circumstances more of the
  file. Use of it is not recommended, but it's still the strongest method
  supported by Vim 7.3 and 7.4.  The "zip" method is even weaker.


更早的版本:

The text in the swap file and the undo file is also encrypted.  E843
However, this is done block-by-block and may reduce the time needed to crack a
password.  You can disable the swap file, but then a crash will cause you to
lose your work.  The undo file can be disabled without much disadvantage. 
        :set noundofile
        :noswapfile edit secrets

Note: The text in memory is not encrypted.  A system administrator may be able
to see your text while you are editing it.  When filtering text with
":!filter" or using ":w !command" the text is also not encrypted, this may
reveal it to others.  The 'viminfo' file is not encrypted.


摘要:


如果您关心安全性,则不要使用blowfish。请改用blowfish2
虽然swapundo文件已加密,但viminfo未加密。

主动提供的建议:


如果您关心安全性,请不要进行自己的加密。这也意味着blowfish2的实现。使用其他东西,例如GPG。 gnupg.vim插件可能有用。它似乎得以维持。它禁用viminfo和交换文件。


评论


David Leadbeater在(dgl.cx/2014/10/vim-blowfish)中的最后一个声明声称使用字典进行暴力破解。然后,他添加“小密码”会很弱。他的理论观点是正确的,但不切实际。好的64位或更多随机密码不可破解。

–莫什
16年8月30日在16:23