2007-05-19

Curses is not fun

Like anyone tech-savvy person who is online, I have a ton of accounts. Obviously I should use a unique, secure password per account. But like most people that just doesn't happen as I can't remember that much. I could use a password management application, but it has not worked for me in the past as it requires me to have access to my computer in order to retrieve the passwords.

And then I came across an idea for site passwords by Alan Karp. Ka-Ping Yee used this idea for his Passpet add-on for Firefox. I really like the idea of using a single, very secure password and an account name hashed together (and passed through URL-safe base64) to generate a unique password as they look random.

Plus the portability problem is solved thanks to my cell phone. Since I can install Python on my phone I can write an app that implements the hashing algorithm. That way I have a way to get any of my passwords as long as I have my cell phone on me (which is pretty much all the time).

I had been planning on writing such an app to use on my laptop for several months now. While I was planning I realized that a GUI version would be nice. I also realized that because the application is extremely simple (two input fields, a way to specify to generate the password, and then displaying the password) I could implement it in various GUI libraries without having to learn all of the intricacies of the library.

And that is what I have done. I currently have a terminal, curses, and Tkinter version of the app. The terminal version was obviously simple; getpass and raw_input make it a no-brainer. Tkinter was surprising easy to use once I found Effbot's "An Introduction to Tkinter"; not pretty but the thing works.

But the curses version is just nasty! I had to piece stuff together from example apps, the docs, and random other places. I definitely consider my curiosity about curses satisfied. I understand the need it filled, but that doesn't make its use any less painful.