View previous topic :: View next topic |
Author |
Message |
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Thu Jul 21, 2005 1:24 pm Post subject: Want a password generator? Try genpass v0.3-r2 :) |
|
|
Latest version 0.3-r2
--------------------
Greetings,
My friend Matthew (mollie) and I have worked on a GPL password generator script that creates decent random passwords for Linux users (genpass - the random password generator).
If you would like to check it out, we have an ebuild here.
Simply extract to your portage overlay (default is /usr/local/portage, but I use /usr/portage/local).
Code: | tar -zxvf genpass-0.3-r2-ebuild.tar.gz -C /usr/local/portage | and unmask it Code: | echo "sys-apps/genpass ~x86" >> /etc/portage/package.keywords | (substitute ~x86 for your arch, ie ~amd64)
Then emerge it
Or you can download the tarball here, and extract where you like (prob /usr/local/bin).
We now have a FreeBSD port here, thanks to predatorfreak.
Once you have it, run and you should get
Code: | chris@josiah ~ $ genpass --help
Usage: genpass [-L <number>] [-n <number>] [-a <number>] [-u <number>] [-l <number] [-s <number>]
Generates a random password
-L, --length Specifies the length of the password.
Default = 8
-n, --number Specifies the number of number characters in the password.
Default = 0 *
-a, --ascii Specifies the number of ascii characters in the password.
Default = 0 *
-u, --upper Specifies the number of uppercase characters in the password.
Default = 0 *
-l, --lower Specifies the number of lowercase characters in the password.
Default = 0 *
-s, --space Specifies the number of space characters in the password.
Default = -1 *
-v, --version Displays the scripts version
-h, --help Displays this help information
*: (-1 = none, 0 = any, >0 = at least the specified number)
Report bugs to <matthew.oliver@gensys.org>
|
There are probably other easier ways to do this, but it was fun and we hope else someone finds it useful!
Let us know your thoughts.
Cheers,
Chris & Matt _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!
Last edited by taskara on Sat Aug 06, 2005 3:16 am; edited 13 times in total |
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Thu Jul 21, 2005 1:34 pm Post subject: |
|
|
naturally this depends on your hardware and options you set, but with defaults it generates passwords pretty quickly
Code: | chris@josiah ~ $ time gen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zeAh
~V8llWdI[G2MYo;`\P$[ytS.e+tY'hTB#+Gn3cf9*WKt(|fmRQ-2N0-EZ|$q#cx2)>UD8cr:J+:U2|/E
xQtqrLq;S_XH.8i|Cg/lQNcfT^x^@HMnX4hjQ:eK<\QpHpb*4knzHKotlHe_:--z;UaOD-=(x}<_/f2x
xt_uHvap_Nb,qEZ:V^xxbc]hbn_>-:7aP>Rb(9fT
real 0m1.482s
user 0m1.278s
sys 0m0.157s
|
_________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
babykart Guru
Joined: 08 Oct 2004 Posts: 415
|
Posted: Thu Jul 21, 2005 7:14 pm Post subject: |
|
|
thx taskara for this job...
is in my overlay... _________________ >> Gentoo-FR <<
----- |
|
Back to top |
|
|
jamapii l33t
Joined: 16 Sep 2004 Posts: 637
|
Posted: Fri Jul 22, 2005 10:28 am Post subject: |
|
|
dd if=/dev/urandom count=5 bs=1024 | mimencode | head
|
|
Back to top |
|
|
ilikelinux n00b
Joined: 19 Dec 2003 Posts: 50
|
Posted: Fri Jul 22, 2005 10:04 pm Post subject: |
|
|
One problem
Code: | echo "sys-apps/genpass ~x86 >> /etc/portage/package.keywords" |
needs to be:
Code: | echo "sys-apps/genpass ~x86" >> /etc/portage/package.keywords |
|
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Sat Jul 23, 2005 12:12 am Post subject: |
|
|
oh yeah, thanks ilikelinux. fixed.
jamapii, that looks like a nice easy way to get a passord
can you specify the number of ASCII characters you want, minimum number of lowercase letters, or even spaces?
has anyone actually used it yet? or is it a useless tool?
cheers _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
Fat Bastard n00b
Joined: 06 May 2005 Posts: 53
|
Posted: Sat Jul 23, 2005 2:00 am Post subject: |
|
|
I'd like to see the logic for setting the character counts tidied up.
Code: | genpass -L 10 -l 10 |
should imply:
Code: | genpass -L 10 -n -1 -a -1 -u -1 -l 10 -s -1 |
Your algorithm would benefit from testing each character as they are generated. Even more beneficial would be generating only characters in the required ranges and then permuting the result. _________________ Computer Science is no more about computers than astronomy is about telescopes. - Dijkstra |
|
Back to top |
|
|
mollie n00b
Joined: 02 Jan 2003 Posts: 16 Location: Australia
|
Posted: Sat Jul 23, 2005 2:44 am Post subject: |
|
|
Just wrote a repose to Fat Bastards post, then relised exactly what he was saying
I have talked about the comments that have been submitted so far with Chris and i think we have come up with a solution, i'll start working on it and will post up another copy of the script when its done.
There is nothing wrong with the current script, we just want to tweak the algorithim so it'll handle the character generations better.
i.e.
Code: | genpass -L 10 -l 10 |
will be handled better.
hopefully we can release a new version later 2day Oz time
thanks,
Matt _________________ There are 10 types of people in this world, those who can read binary and those who cant. |
|
Back to top |
|
|
mollie n00b
Joined: 02 Jan 2003 Posts: 16 Location: Australia
|
Posted: Sat Jul 23, 2005 8:55 am Post subject: |
|
|
Thanks Fat Bastard for your comments, i have rewritten the algorithim in response to your suggestions.
We are now generating the ranges that are greater the zero first and randomly placing the chars into an array. This means there is now no need to keep checking the password to make sure it is valid, which decreases the time immensly.
This also means that running:
Code: | genpass -L 10 -l 10 |
doesn't need to be translated into:
Code: | genpass -L 10 -n -1 -a -1 -l 10 -u -1 -s -1 |
in order to speed it up.
Chris (Taskara) will be posting a a new copy of the ebuild and archive for download. Yay up to version 0.2
Please have a play, and leave some comments so we can continue to improve the script!
Thanks again,
Matt _________________ There are 10 types of people in this world, those who can read binary and those who cant. |
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Sat Jul 23, 2005 9:05 am Post subject: |
|
|
Uploaded version 0.2 and updated original post.
-c _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
jbesiee n00b
Joined: 26 Mar 2004 Posts: 14 Location: France
|
Posted: Sun Jul 24, 2005 10:46 am Post subject: |
|
|
This programm is great ! thanks.
But I think i found a little bug :
With Quote: | genpass -a -1 -u -1 -L 5 |
I get 1/3 of the time a 4 caractere lenght passord.
Quote: | hf7nq
rduyg
72zx
q2yu |
Nothing verry big, but better fixed |
|
Back to top |
|
|
Raniz l33t
Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Sun Jul 24, 2005 3:41 pm Post subject: |
|
|
jbesiee wrote: | This programm is great ! thanks.
But I think i found a little bug :
With Quote: | genpass -a -1 -u -1 -L 5 |
I get 1/3 of the time a 4 caractere lenght passord.
Quote: | hf7nq
rduyg
72zx
q2yu |
Nothing verry big, but better fixed |
Try running with option "-s -1" |
|
Back to top |
|
|
jbesiee n00b
Joined: 26 Mar 2004 Posts: 14 Location: France
|
Posted: Sun Jul 24, 2005 8:23 pm Post subject: |
|
|
Quote: | -s, --space Specifies the number of space characters in the password.
Default = -1 *
|
I don't think that this parameter has an influence.
I tried to verify a couple of times, and the bug remains. |
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Mon Jul 25, 2005 3:49 am Post subject: |
|
|
Updated to version v0.3
* fixed password length bug
* added version information
_________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
mollie n00b
Joined: 02 Jan 2003 Posts: 16 Location: Australia
|
Posted: Mon Jul 25, 2005 4:01 am Post subject: |
|
|
thanks jbesiee for the letting us know about the length bug.
The bug had been squished
Thanks for the feedback!
Chris (Taskara) has posted the new version (0.3) up, so give it a go
Let us know if you or anyone else finds anything else!
Regards,
Matt _________________ There are 10 types of people in this world, those who can read binary and those who cant. |
|
Back to top |
|
|
Fat Bastard n00b
Joined: 06 May 2005 Posts: 53
|
Posted: Mon Jul 25, 2005 6:18 am Post subject: |
|
|
Don't forget users can be quite spastic at times:
Code: | ./genpass -a -1 -u -1 -l -1 -n -1 |
This should cause the program to exit gracefully. _________________ Computer Science is no more about computers than astronomy is about telescopes. - Dijkstra |
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Mon Jul 25, 2005 8:25 am Post subject: |
|
|
Fat Bastard wrote: | Don't forget users can be quite spastic at times:
Code: | ./genpass -a -1 -u -1 -l -1 -n -1 |
This should cause the program to exit gracefully. |
Ahh we did actually fix this, but I lost it with a hard drive "crash"!.. thanks for the reminder.
Will upload new version again.. anything else while we're at it?
Cheers
edit: uploaded version 0.3-r1 and ebuild
thanks for pointing that out. Let us know if you have any other suggestions.
cheers _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Fri Jul 29, 2005 7:57 am Post subject: |
|
|
anyone got any other comments? either good or bad?
cheers _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
predatorfreak l33t
Joined: 13 Jan 2005 Posts: 708 Location: USA, Michigan.
|
Posted: Sat Jul 30, 2005 2:32 am Post subject: |
|
|
I'm going to be writing a port for FreeBSD of this, I'll post back after I'm done.
Edit: Update, testing the port right now, if all goes well It should be done, tested and all that within 5 minutes.
Edit: SHIT, hairbrain mistake <_<. _________________ System: predatorbox
Distro: Arch Linux x86_64
Current projects: blackhole, convmedia and anything else I cook up. |
|
Back to top |
|
|
predatorfreak l33t
Joined: 13 Jan 2005 Posts: 708 Location: USA, Michigan.
|
Posted: Sat Jul 30, 2005 3:44 am Post subject: |
|
|
Mmk, after stupidly deleting my work the first time around, I'm done. I've done some basic tests to make sure it works, but there is apparently a syntax error in the script it's self, due to expr. I'll bet this is a difference between the GNU userland and FreeBSD, but suprisingly, the script works perfectly.
URL: http://predatorfreak.ath.cx/genpass-port.tar
Note to developers: If I get time, I'll investigate the syntax errors myself and attempt to fix them. _________________ System: predatorbox
Distro: Arch Linux x86_64
Current projects: blackhole, convmedia and anything else I cook up. |
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Sat Jul 30, 2005 4:15 am Post subject: |
|
|
hey predatorfreak, that looks interesting. I don't know anything about how BSD works, but I assume that is a build script or such? like an ebuild?
did you have to actually hack genpass to get it to work under bash on BSD? I notice your little patch in the tar.
Thanks for your effort, I take it you like the script
With your permission we would be happy to upload your BSD version to our site.
Also, if you have any suggestions, would love to hear them.
Cheers!
Chris _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
idx n00b
Joined: 29 Jul 2005 Posts: 4
|
Posted: Sat Jul 30, 2005 4:32 pm Post subject: |
|
|
I haven't tried genpass, but APG has always worked well for me.
Although if you need more people to test on FreeBSD, let me know. I have several 4.10 and 5.3 installations.
-r |
|
Back to top |
|
|
predatorfreak l33t
Joined: 13 Jan 2005 Posts: 708 Location: USA, Michigan.
|
Posted: Sat Jul 30, 2005 10:55 pm Post subject: |
|
|
taskara wrote: | hey predatorfreak, that looks interesting. I don't know anything about how BSD works, but I assume that is a build script or such? like an ebuild?
did you have to actually hack genpass to get it to work under bash on BSD? I notice your little patch in the tar.
Thanks for your effort, I take it you like the script
With your permission we would be happy to upload your BSD version to our site.
Also, if you have any suggestions, would love to hear them.
Cheers!
Chris |
The patch fixes the directory difference for bash in FreeBSD, no major changes happened, I simply changed the #!/bin/bash to /usr/local/bin/bash, the FreeBSD installation place. Also, your more then welcome to upload it too your site. I don't have any suggestions right now, but I'll attempt to fix the syntax errors.
Edit: I've identified the problem, FreeBSD's expr doesn't have the substr argument, which means I'd need to find a replacement, I believe I could do this in php using substr within PHP, but that would not be right for a shell script.
Edit 2: Uhh, it appears as though this is working perfectly WITHOUT the use of expr within the isdidgit function, but I'm just doing quick fixing, I'm probably screwing something up under the hood. If possible, I'd like your input on what would be an acceptable solution so I don't trample on your work. _________________ System: predatorbox
Distro: Arch Linux x86_64
Current projects: blackhole, convmedia and anything else I cook up. |
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Sun Jul 31, 2005 1:27 am Post subject: |
|
|
wow, apg is pretty cool some great features in that little app, although it doesn't look as though you can specify minimum number of specific characters like genpass. thanks idx.
we'll have a look shortly predatorfreak and get back to you!
thanks heaps! _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
predatorfreak l33t
Joined: 13 Jan 2005 Posts: 708 Location: USA, Michigan.
|
Posted: Sun Jul 31, 2005 3:01 am Post subject: |
|
|
taskara wrote: | wow, apg is pretty cool some great features in that little app, although it doesn't look as though you can specify minimum number of specific characters like genpass. thanks idx.
we'll have a look shortly predatorfreak and get back to you!
thanks heaps! |
For reference on FreeBSD commands, I'd suggest there online man pages, it helps to reference multiple man pages in development to find options which are specific to one system. _________________ System: predatorbox
Distro: Arch Linux x86_64
Current projects: blackhole, convmedia and anything else I cook up. |
|
Back to top |
|
|
|