Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Working with Linux ??? Quick Hacks for the Command Line

You're reading from   Working with Linux ??? Quick Hacks for the Command Line Command line power like you've never seen

Arrow left icon
Product type Paperback
Published in May 2017
Publisher Packt
ISBN-13 9781787129184
Length 222 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Bogdan Vaida Bogdan Vaida
Author Profile Icon Bogdan Vaida
Bogdan Vaida
Petru I»ôfan Petru I»ôfan
Author Profile Icon Petru I»ôfan
Petru I»ôfan
Arrow right icon
View More author details
Toc

Vim password manager

Vim can also be used to safely store information, by encrypting text files with different cryp methods. To see the cryp method that Vim is currently using, type:

:set cryptmethod?

We can see in our case it is zip, which is not actually a crypto method and does not offer much in terms of security. To see what different alternatives we have, we can type:

:h 'cryptmethod'
Vim password manager

A page describing the different encryption methods comes up. We can choose from zip, blowfish, and blowfish2.The most secure and recommended one is, of course, blowfish2. To change the encryption method, type:

:set cryptmethod=blowfish2

This can be also added to vimrc so that it becomes the default encryption. Now we can safely encrypt files using Vim.

A common scenario would be storing a passwords file.

Let's open up a new file named passwords.txt, add some dummy passwords inside, and save it. The next step is to encrypt the file with a password, and for this we type :X.

Vim will prompt you for...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image