JM Robles - Tech Consultant & Entrepreneur

Create your own DIY Password Manager with Vim and Syncthing

Password management is a hassle, but worse is using the same password or a very similar one across all accounts. Eventually, regrets come when we fall victim to hacking. Unfortunately, my trust in password managers like LastPass or 1Password is zero. Just remember the LastPass hack, where a multitude of passwords were decrypted.

The LastPass Hack

In the attack on LastPass, hackers used phishing techniques and compromised users’ personal and administrative data. Despite using a “zero knowledge” security model, attackers were able to access the encrypted password vaults and, through brute force, managed to decrypt many of these, affecting the trust in centralized services. This motivated me to look for a homemade solution that does not depend on third-party services.

My Solution: Vim and Syncthing

An idea occurred to me to create a homemade but effective solution: use Vim and its encryption function to encrypt random passwords. Then, using Syncthing (an open source alternative to Dropbox), I can have a directory of encrypted passwords on all my devices.

How Does It Work?

Step 1: Generation and Encryption of Passwords with Vim

  1. Open Vim and enter the password you want to save: vim password.txt

  2. Enter command mode and write:

    :X
    

    Vim will ask for an encryption password. Use the blowfish2 algorithm which is more secure:

    :setlocal cm=blowfish2
    
  3. Save and close the file:

    :wq
    

Step 2: Synchronization of Encrypted Files with Syncthing

  1. Download and install Syncthing on all your devices from its official site.

  2. Set up a shared directory in Syncthing. This will be the place where you’ll store your encrypted password files.

  3. Add the directory on all your devices so they sync automatically.

What Is Syncthing?

Syncthing is an open source alternative to file synchronization services like Dropbox or Google Drive, but with the control and privacy that comes with being a decentralized solution. All files are securely transferred between your devices, encrypted in transit, and not stored on any intermediate servers, which reduces the risk of being hacked.

What Do You Think?

Does this solution fit your needs? It may not be the most elegant, but it provides an additional layer of security over traditional password managers. Moreover, Syncthing offers the ease of synchronization across multiple devices without the risk of exposing your passwords in the cloud.

Synchronization image

See also