Inspired by password entry discussions, I did this simple entry. You must of course find safe way to store the passwords, for example hashlib (http://stackoverflow.com/questions/4820043/basics-of-python-encryption-w-hashlib-sha1) or PyCrypto and replace the simplistic example match for real life usage.
The print at line 23 is just to check the attempts and to see the text really was received correctly by the program.