Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Quick and easy random password generator

  1. #1
    Join Date
    Nov 2005
    Beans
    729
    Distro
    Ubuntu 6.06

    Quick and easy random password generator

    I wrote this script in response to a user needing to generate quick random passwords.

    Code:
    #!/bin/bash
    # This script creates a random password using sha1sum
    
    echo "Enter the master password"
    read -s MASTPASS
    
    echo "Enter the reason"
    read -s REASON
    
    echo "Enter desired number of characters"
    read -s DESNUM
    
    echo
    echo "Your random password is:"
    echo $MASTPASS $REASON | sha1sum | cut -c1-$DESNUM
    echo
    As long as the MASTPASS stays the same, you can have hundreds of REASON replacements (eg. website, newuser, email, tarballpassword, etc) and only have to memorise the master password.

    I hope someone finds it helpful

  2. #2
    Join Date
    Nov 2005
    Beans
    729
    Distro
    Ubuntu 6.06

    Re: Quick and easy random password generator

    Did a bit of improving on the original:

    Code:
    #!/bin/bash
    # This script creates a random password using sha1sum
    
    MASTONE=x
    MASTTWO=y
     
    while [ $MASTONE != $MASTTWO ] ; do
            echo "Enter the master password"
            read -s MASTONE
            echo "Retype the master password"
            read -s MASTTWO
            if [ $MASTONE != $MASTTWO ] ; then
                 echo "Password entries don't match, try again" 1>&2
            fi
    done
     
    echo "Enter the reason"
    read -s REASON
    echo "Enter desired number of characters"
    read -s DESNUM
    echo
    echo "Your random password is:"
    echo $MASTONE $REASON | sha1sum | cut -c1-$DESNUM
    echo

  3. #3
    Join Date
    Jun 2006
    Location
    Finland
    Beans
    60
    Distro
    Ubuntu 6.10 Edgy

    Re: Quick and easy random password generator

    Thanx, this is great

  4. #4
    Join Date
    Jun 2006
    Location
    Texas, USA
    Beans
    59
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: Quick and easy random password generator

    so i'm really new to this kind of stuff. mainly all i do is browse the web.
    so how do i run this. and if i make a file for it, what should the extension be? thank you.

  5. #5
    Join Date
    Jun 2006
    Beans
    1

    Re: Quick and easy random password generator

    Quote Originally Posted by gorilla_king
    so i'm really new to this kind of stuff. mainly all i do is browse the web.
    so how do i run this. and if i make a file for it, what should the extension be? thank you.
    Since it is a bash script, i would use .sh.

  6. #6
    Join Date
    Jun 2006
    Location
    Texas, USA
    Beans
    59
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: Quick and easy random password generator

    Quote Originally Posted by henrikem View Post
    Since it is a bash script, i would use .sh.
    lol, thanks you

  7. #7
    Join Date
    Aug 2005
    Location
    Belgium
    Beans
    45
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Quick and easy random password generator

    [EDIT] ow only read half the post, sorry this just makes random passwords

    pwgen takes care of all your password generating needs

    Code:
    roderik@alucius ~ $ sudo apt-get install pwgen
    roderik@alucius ~ $ pwgen
    Lepi1een hahF2ahv IuYohch4 avi8AiB7 Jeo4ogho Deidee9a chah5Jah pee1Aiji
    yohG4ai4 Shee4aic Owaa1bup Seixe3Ju Hi2okoph Cunee4Ee ooquuv7M ahH4yahn
    aZ4oophi aevooS8Y za9ahNga Ki8ieduo Hei7eip4 eehee3Ie pe6Ugh5I eeThieD9
    ook2Eeyu ahmaiD7G ii5ouHae Aethai7v Quei7uta shohS0oh Eghei3ui Uochee8a
    Peeshei3 Tiezee6Y cuki0taR gubeeF6a ToeF0ey7 joo2Iedi Aevee0pe aigh4Iel
    airoh0Bu AechieV6 xoo7aXai Yai9ohre yaed4ooS Som3Goh4 aexai5Ch meiree8E
    bee3eWie iesheiN1 xei4An8e dahb7Shu ohD8Aiy4 aiNu4aec elueC7oh aet2Sha0
    thei9Xir ooja4Yea lei3goCh Eiquah2a Fia8fius aiG5yee2 AhphieR4 ItheeL5i
    Caegahp9 wahCh4Vu vohxa8Ch aiButh6M ieX8eeBa eeYoo5sh jahGe0Qu suug0Cha
    ucuaCha6 Quu8iepa Mobae9qu sis0ahPh oe6Eepee na9Eithu shoogh0A chie6Nan
    chee8EeM ooxoo1Sa uNiuthe6 Ier6eeDe ahy7Oqu7 Quu3jaed Ies7Hei4 shae8auS
    oothuCi2 Shoh8eiK Oosh7Quo chei8Xoo photh4Ae iex8ea3I Oogie5ie ohP6yieh
    oofo2aNg Sish1aiW och1Obie beuNg7To cee4iPah Pie3ahma jeThoos9 noh8Ohx4
    Wohduip8 thu9ohLo Iwai5pou rei9ooGh Aiyeigh2 ahsh6aiB ovooj4Ix eaj5Eizu
    Yae8cho9 meijie1Z aiK4bool OoDiwo5m Aivoan0c Wui0ahp7 Ogu3Muiy Ucah7Auz
    Bii0Aich USh1dige UKo9Thab ohZ9Ahsu puY8youT roh5Ai4o Lair6rei dieB7AhK
    aeShei5u uCh9erei aiHait1g sienie1X geefai2I ahrae7Ah ohb2Fahj Pa3aeph0
    ucee5AeW maiX0di8 aeLoh1oj ahvohX6w Iek5ieno Oj0ahZee UGheeph0 Ciec5aev
    Diesha4o kaeGah9U AePhai3u fohZae9c oiK0aec1 Cei9xied Thah0hoh laaMah2S
    hom8Aepi aish6Euv Eenie0ae AeS4ooso AeFooX3I Ef6JohSh IeG4lool Aeng9cah
    Last edited by Roderik; July 7th, 2006 at 07:21 AM. Reason: i'm too lazy to read

  8. #8
    Join Date
    Jun 2006
    Location
    Texas, USA
    Beans
    59
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: Quick and easy random password generator

    i posted this on my site without even thinking. and i forgot to ask your permission. well, i'm using your script as a reference for others on how to make little scripts like that run. mainly because i was confused, so i thought others might be too. so i was wondering if i can have permission to use this small script on my very unpopular (and until, never mentioned to anyone) site. If you'd like to preview what it will look like and actually exaclty how it will be displayed. Go here http://whatigoogle.com/index.php?gt=pages&id=17

  9. #9
    Join Date
    Aug 2005
    Beans
    40
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Quick and easy random password generator

    In the last line :

    Code:
    echo $MASTONE $REASON | sha1sum | cut -c1-$DESNUM
    you could add
    Code:
    static=`date +%s`
    echo  $static $MASTONE $REASON | sha1sum | cut -c1-$DESNUM
    This helps make it a bit more random IMHO.
    Last edited by NoobieDoobieDo; March 4th, 2007 at 10:58 AM.

  10. #10
    Join Date
    Apr 2008
    Location
    Poland
    Beans
    8
    Distro
    Ubuntu 10.04 Lucid Lynx

    Exclamation Re: Quick and easy random password generator

    Quote Originally Posted by NoobieDoobieDo View Post
    This helps make it a bit more random IMHO.
    That breaks the idea of having the same password every time you enter same MASTPASS and REASON.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •