Vi edit encrypted file




















Vim, the popular text editor comes with a built-in feature to encrypt files with a password. Vim uses algorithms like Blowfish to encrypt files. It is faster and convenient than some other utilities available to do so.

To get started, all you need is a system with a full version of vim installed. There are two different ways to encrypt a file. Enter your key twice and press enter. Now, whatever we type in this file will be encrypted on saving and reading this file will require the key every time we try to open it with any text editors. Learn more. Vim encryption: how to break it? Ask Question.

Asked 12 years, 10 months ago. Active 1 year, 9 months ago. Viewed 24k times. Here's what I've tried: Use vimzipper to wrap the encrypted file in a zip so it can be cracked by standard zip crackers like fcrackzip, zipcracker, pkcrack, Advanced Zip Password Recovery, etc.

If anyone can help, I'd hugely appreciate it. If not, thanks for reading. Improve this question. Bill the Lizard k gold badges silver badges bronze badges.

Jurgen Jurgen 1 1 gold badge 3 3 silver badges 3 3 bronze badges. In some ways, I hope you don't succeed for everyone elses sake So, what was your solution? What happened? An interesting note: Vim 7.

Show 2 more comments. Active Oldest Votes. From the VIM documentation : The algorithm used is breakable. A 4 character key in about one hour, a 6 character key in one day on a Pentium PC. This requires that you know some text that must appear in the file. Instead, each character will be displayed as an asterisk. Once vim has then opened your file, it looks normal and you can continue editing or adding details to your deep dark secret should you want to do so or simply move on to writing out the file in encrypted form.

To write out encrypted content, simply save the file as you would normally do with vim. Once you are ready to read your file again or continue with your detailed expression of your deep dark secret, use the vim command again and provide the password when prompted.

End your vim session with the usual :wq and the file will remain encrypted. If, at some point, you are ready to share your deep dark secret with others, you can reverse the file encryption as simply as you invoked it in the first place. First, use a vim -X command. Note the use of a capitalized X this time:. Then enter :X but, when prompted to enter an encryption key again twice , simply press the Enter key:. Use :wq to write the file out again. It helps with system hardening, vulnerability discovery, and compliance.

Your email address will not be published. This site uses Akismet to reduce spam. Learn how your comment data is processed. Search for:. Home Linux Security Lynis About. Using encrypted documents with vim Encrypting files with vim Everyone has secrets. Configure vim To use encryption, we first need the right support in your vim installation. Blowfish2 support Your version needs to be at least 7.

Set encryption method We start by setting the encryption method we want to use. Disable backups During editing your files you may not want to leak any sensitive data. Do not make a backup :set nobackup Do not write to a temporary file first :set nowritebackup If you still prefer to have some backup files, you could enforce writing temporary files in directories you control and clean those out at your convenience.

Enable encryption of a file Start vim with the -x option.



0コメント

  • 1000 / 1000