For many years, my friends and colleagues used to make fun of people’s digital security: “People are stupid. They use 12345678 as their main password.” I was smiling and nodding, but deep down, I knew that having a pawned mail address and the same weak password on dozens of websites would not make me a poster boy for personal data security. I felt guilty about it, but I never really had the motivation to dive into it. However, one day, a colleague gave me the push I needed. We were at the coffee machine, and he explained to me that the Dutch government might create a law that makes employees responsible for the safety of their passwords. Losing my personal data really sucked, but losing my job and potentially being sued was too much of a risk. I had to do something and find a decent password manager!

Wish list

Being specific about the programs and web services I use, I knew that I could not take the first password manager I found on Google and be done with it. I had to make sure that it could integrate nicely into my workflow and habits; otherwise, I would never use it. So I came up with a wish list.

As I try to integrate myself into my new country, the Netherlands, I am starting to become more and more frugal. So first, it should not cost me a single penny. Jokes aside, it is difficult from the customer’s point of view to see the difference between a good and a bad password manager as the whole encryption is usually done on the back-end, keeping the user in the dark. This leads me to my second wish: I want to have full control over the cryptography; two reasons for that: I want to learn how cryptography works, and I want to trust the encryption. My third wish is seamless terminal integration, to get rid of hard-coded passwords in my shell scripts. Finally, I want a password manager that works offline and syncs on all my devices.

After searching on the internet, I settled on pass, the UNIX standard password manager that fulfilled all my requirements. Now, I just had to make it happen. So I gathered my courage, a cup of tea, and a bar of chocolate and started configuring.

Overview of the solution

Pass follows the UNIX philosophy, and as a consequence, it is designed to interact with other free software to offer as much flexibility as possible. My pipeline requires the following features:

How I set it up on my Linux machine

gpg --full-generate-key
pass init EMAIL-ADDRESS-GPG-KEY
pass git init; pass git remote add origin REPO-URL
pass edit -c PASSWORD-NAME # create password
pass generate -c PASSWORD-NAME # generate password
pass git push -u origin main # or master if you did not make the switch

Setting up on your Android device

My setup might not be the easiest as it involves using the terminal on your phone; an android application is also available: Android-Password-Store

This part of the installation assumes that you have already set up a Linux PC reachable via ssh that is on the same network as the Android device you want to set up.

gpg --export-secret-keys --armor EMAIL-ADDRESS-GPG-KEY > ~/key.asc
pkg install gnupg pass fzf git openssh
git clone REPO-URL ~/.password-store
scp USERNAME@COMPUTER-IP:~/key.asc ./; gpg --import ~/key.asc; rm ~/key.asc
echo "alias tpass=\"pass -c \\\$(find ~/.password-store/ -name '*.gpg' | sed -e 's:^.*password-store/\\\\(.*\\\\).gpg\\\$:\\\\1:g' | fzf)\"" >> ~/.bash_aliases; source ~/.bash_aliases
rm ~/key.asc

Additional notes