a simple console password manager in perl

I've previously toyed with writing a password manager, but out of expediency have instead relied on gpg to secure my data, with periodic decryptions to text to obtain the data.

So far I have been using a simple format: each line is a triple of (domain,userid,password). I simply grep on the domain name for the password I want, the script will parses the output.

But I don't want the decrypted file lying around, and I hate using the mouse to cut and paste, particularly on mac laptops that have worthless pointing devices. I wanted something that didn't need the mouse at all.

Below is a script that will decrypt a gpg-encrypted file (AES256 symmetric encryption to be precise) to STDOUT, pull out the required data, and copy it to the xclipboard. From there, you can Ctrl+V in firefox or another browser to paste the selection into a password field. after thirty seconds the clipboard is cleared.

There's nothing here that actually "manages" the encrypted file...if you want to add a new line or change a password in the file, you just decrypt it to a file and edit the cleartext.

I'm sure there are some security holes with this, I wouldn't recommend it on a client box that has multiple users on it, I don't think the X clipboard is considered private.

Tested only on freebsd-9 and arch linux so far.

One bug I notice: it doesn't seem to like passwords that contain "$", as the shell tries to expand those to shell vars as it is being piped to xclip.

gist

there is now a public github repo for this:

https://github.com/xylabs/getpw.pl

last update 2011-07-10