Universal Password Generator

Moderator: Forum moderators

Post Reply
User avatar
mikeslr
Posts: 3015
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 174 times
Been thanked: 952 times

Universal Password Generator

Post by mikeslr »

Attached is a Universal Password Generator. 'Universal' as it should work under any Puppy. It is the result of some research by me and a lot of good suggestions by several Puppy devs who actually know how to program. At best, I muddle. Special thanks to MochiMoppel and williams both of whose solutions worked. For a complete history see this thread, viewtopic.php?p=141014#p141014.

Basically, I wanted an application (with a menu entry) to generate random/secure passwords without having to go online or run a program under Wine. The above thread will provide links to a couple good applications that will generate 'Pass Phrases'. Pass Phrases are a string of words chosen randomly. They may be more secure than passwords because of their length. And may be easier for someone to remember than random symbols. Someone, but not me. And AFAICT, passphrase generators run under python. So I opted for the 'simpler' solution.

The operative code uses urandom and is

Code: Select all

for i in $(seq 1 10); do echo $(tr -dc 'A-Za-z0-9!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~' < /dev/urandom | head -c 16); done > /tmp/passwords.txt
defaulttexteditor /tmp/passwords.txt

If you want to change it (/root/my-applications/bin/passgen):

"seq 1 to 10" defines how many passwords will be generated; as is 10
"$(tr -dc 'A-Za-z0-9!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~'" specifies what symbols to randomly use; and
"head -c 16" specifies the length of each password, as is 16: The longer, the longer it will take for a hacker to find the password by trial and error, especially if your limit the number of trials before freezing him/her out.

After generating passwords they are exported to a text file in /tmp which is automatically opened in your default text-editor. Files in /tmp are not preserved accross reboots nor the execution of a Save.

If the following pet is installed this Application will show up as Menu>Personal Category>Password Generator.

UniversalPasswordGenerator.pet
(134.45 KiB) Downloaded 15 times
Post Reply

Return to “Security/Privacy”