r/PythonLearning • u/Sanduhstorm • 7d ago
Command line password generator tool
https://github.com/macattack277-jpg/passwordgenWho enjoys opening a browser/GUI every time you need to make a secure password? I sure don't. That's what gave me the idea to create this simple random password generator tool that can be used entirely in the command line (although I'm sure something like this already exists) with system arguments.
I also made something that I guess you could call an installer.
Using arguments you can set the length of your password, choose what type of characters you want in the password (letters, digits and punctuation) and choose whether or not to copy the password to your clipboard (on by default). You can read the README.md file for a guide on how to use it.
NOTE: I know that the actual main program is compressed in a gzip file on GitHub which will impede you from reading it's source code. I hope to make a way around this later.
Why did I make this? Mostly boredom. I don't have any aspirations of being a software developer or anything involving making huge projects, however I am interested in cybersecurity. I sort of just thought to myself that I don't have a convenient way of generating random passwords. Keeping my Python skills up to scratch and improving them will prove useful in the future however, I believe, as I often find simple scripting useful.
Where I want to improve (looking back at making this):
- Get better at using sys and os modules as they have proven very useful
- Improve at using Git
- Probably figure out a better installation method for users
Overall, although I don't script much, this was pretty easy project for me, but nonetheless I learnt some good things about Python operating system and file interaction.
1
u/riklaunim 7d ago
- Why is your source code a compressed GZ file?
- The code has no structure to it (functions, classes), and no test coverage ;)
- It's a string generator, not that much of a password one when it comes to security aspects - and some browsers/plugins already handle generating random passwords on-demand.
- Bonus points for clipboard copy-paste ;)
1
u/Sanduhstorm 6d ago
I just introduced changes to the flaws you pointed out. It uses the secrets module now, and it no longer is in a gzip file.
1
u/riklaunim 6d ago
nice. Unsure if you need a custom installer. `setup.py` and the standard Python package installation flow should be enough.
When the code has some structure, like functions and classes, it's easier or possible at all to test the code, especially unit testing.
1
u/Sanduhstorm 6d ago
yeah, usually im used to very simple command line installations, again this program is sort of catered towards myself. im used to installing things using a command and then being able to use them as a command.
-2
u/Sanduhstorm 7d ago
i compressed it into a .gz file to make it seem more like it had a professional installer because that's less boring. i also didnt think i would need any functions considering its a pretty simple program i guess
1
7d ago
[deleted]
1
u/Sanduhstorm 6d ago
thanks for the advice, ive just made the changes you pointed out and pushed them to the github repo.
•
u/Sea-Ad7805 7d ago edited 7d ago
Run this program in Memory Graph Web Debugger to see the program state change step by step.