Having completed the Python bootcamp I had been studying, I have been keen to put what I have learned into practice and to code something from scratch, just starting from an idea. I wanted to make something practical, something that someone else could use and find benefit from, but also something that I could evolve at a later date


Although I appreciate that passwords are an evolving science, I decided to make a password generator. Passwords are still in use and people are encouraged to use long secure passwords.


I started with a list of things I wanted the tool to do:


  1. Be accessible from a desktop shortcut – this would writing a small Bash script that could be triggered from a shortcut.
  2. Generate a password of 10 characters, using a random mix of lower case letters, upper case letters, numbers, and punctuation marks.
  3. Display that to the user so that they can use it and make a record of it – users may wish to copy it into a website to set up an account.
  4. After a period of time, erase that record – I deliberately decided to not ask the user given a purpose for the password, but having made a note of it, I wanted to make sure that any record the tool makes is temporary.


I started with the Python code, creating a pool of characters and a function that would generate a list of 10 random characters and pass it to a text file. This file would then open, displaying explanatory text, the password, and confirming the file would be erased. Text files are simple and lightweight, have no complicated UI, and allow the user to copy the text with ease. I then wrote a second function in a separate .py file that would erase the text file after 30 minutes.


Next up was a Bash script that would fire the first function, wait for that to run, and then fire the second function. Although I tested the functions separately, pulling them together was key. Of greater concern was the delay between the two. I needed to make sure it was slow enough to work correctly, but fast enough for a good user experience. With that working, I created a simple .desktop file with a creative commons icon (altered slightly).


It works really well and I am really pleased with it. I do still want to refine it further and learn for myself how to package it as a .deb file for easier installation.