tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: Generating Passwords
@ 2001-01-22 16:37 Myszkowski.Mark
  0 siblings, 0 replies; only message in thread
From: Myszkowski.Mark @ 2001-01-22 16:37 UTC (permalink / raw)
  To: tru64-unix-managers

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: multipart/mixed; boundary="------_=_NextPart_001_01C08491.9749E2A0", Size: 8752 bytes --]

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C08491.9749E2A0
Content-Type: text/plain;
	charset="iso-8859-1"

My original question was:
Does anyone know of a utility that could generate password strings for me
automatically? These should be dictionary words.

I received several URL's:
http://www.elfqrin.com/pwgen.html
http://www.users.dircon.co.uk/~crypto/download/c50-faq.html
http://www.openwall.com/john/

http://freshmeat.net/redir/homepage/967691938/


A sample PERL script from Elizabeth Harvey-Forsythe:
You can write a little perl script to do this quicky, call it
makepassword.pl: 
#!/usr/bin/perl 
while (<STDIN>) 
{ 
chop; 
$plaintext = $_; 
$salt = "xx"; 
$encrypted = crypt($plaintext,$salt); 
print "$plaintext is $encrypted\n"; 
} 
Assuming your dictionary has 1 word per line, just cat your dictionary to it
like so: 
bash-2.04$ cat dictionary.txt | ./makepasword.pl 
and watch the output scroll, or redirect to a file, whatever your heart
desires. You may want to play with values for $salt, maybe derive them off
the dictionary word or a random number generator. 


Also a sample PERL script and a sample KORN script from J.A. Gutierrez:


---------------------------------------------------------------------------
#!/usr/local/bin/perl


sub setupass
{
        my $WORDS="/usr/share/dict/words";
        my $LINES=25486+1;
        # 25486 is `wc -l < /usr/share/dict/words`
        my $LINE=int(rand($LINES));
        chop($upass=`tail +$LINE $WORDS | head -1`);
}


setupass;
print "$upass\n";
---------------------------------------------------------------------------
or
---------------------------------------------------------------------------
#!/bin/ksh


RANDOM=`date | /usr/local/bin/md5 | tr -d '[a-z]'`

setupass()
{
        WORDS=/usr/share/dict/words
        LINE=`expr $RANDOM \* $RANDOM`
        LINE=`expr $LINE % 25486`
        # 25486 is `wc -l < /usr/share/dict/words`
        upass="`tail +$LINE $WORDS | head -1`"
}

setupass
echo "$upass"


Plus a C program from Christophe DIARRA and a warning not to use dictionary
words as passwords from Ann Majeske.  Thank you to everyone who responded -
this will make adding those several hundred users much easier.
Mark

------_=_NextPart_001_01C08491.9749E2A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>SUMMARY: Generating Passwords</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2 FACE=3D"Arial">My original question was:</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Does anyone know of a utility that =
could generate password strings for me automatically? These should be =
dictionary words.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I received several URL's:</FONT>
<BR><U><FONT COLOR=3D"#0000FF" FACE=3D"Times New Roman"><A =
HREF=3D"http://www.elfqrin.com/pwgen.html" =
TARGET=3D"_blank">http://www.elfqrin.com/pwgen.html</A></FONT></U>
<BR><FONT SIZE=3D2 FACE=3D"Courier New"><A =
HREF=3D"http://www.users.dircon.co.uk/~crypto/download/c50-faq.html" =
TARGET=3D"_blank">http://www.users.dircon.co.uk/~crypto/download/c50-faq=
.html</A></FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New"><A =
HREF=3D"http://www.openwall.com/john/" =
TARGET=3D"_blank">http://www.openwall.com/john/</A></FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Courier New"><A =
HREF=3D"http://freshmeat.net/redir/homepage/967691938/" =
TARGET=3D"_blank">http://freshmeat.net/redir/homepage/967691938/</A></FO=
NT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Courier New">A sample PERL script from</FONT> =
<FONT SIZE=3D2 FACE=3D"Arial">Elizabeth Harvey-Forsythe</FONT><FONT =
SIZE=3D2 FACE=3D"Courier New">:</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">You can write a little perl script to =
do this quicky, call it makepassword.pl:</FONT><FONT FACE=3D"Times New =
Roman"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">#!/usr/bin/perl</FONT><FONT =
FACE=3D"Times New Roman"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">while (&lt;STDIN&gt;)</FONT><FONT =
FACE=3D"Times New Roman"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">{</FONT><FONT FACE=3D"Times New =
Roman"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">chop;</FONT><FONT FACE=3D"Times New =
Roman"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">$plaintext =3D $_;</FONT><FONT =
FACE=3D"Times New Roman"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">$salt =3D &quot;xx&quot;;</FONT><FONT =
FACE=3D"Times New Roman"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">$encrypted =3D =
crypt($plaintext,$salt);</FONT><FONT FACE=3D"Times New Roman"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">print &quot;$plaintext is =
$encrypted\n&quot;;</FONT><FONT FACE=3D"Times New Roman"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">}</FONT><FONT FACE=3D"Times New =
Roman"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Assuming your dictionary has 1 word =
per line, just cat your dictionary to it like so:</FONT><FONT =
FACE=3D"Times New Roman"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">bash-2.04$ cat dictionary.txt | =
./makepasword.pl</FONT><FONT FACE=3D"Times New Roman"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">and watch the output scroll, or =
redirect to a file, whatever your heart desires. You may want to play =
with values for $salt, maybe derive them off the dictionary word or a =
random number generator.</FONT><FONT FACE=3D"Times New Roman"> =
</FONT></P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Courier New">Also a sample PERL script and a =
sample KORN script from J.A. Gutierrez:</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Courier =
New">-------------------------------------------------------------------=
--------</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">#!/usr/local/bin/perl</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Courier New">sub setupass</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">{</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my =
$WORDS=3D&quot;/usr/share/dict/words&quot;;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my =
$LINES=3D25486+1;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 25486 is `wc -l &lt; =
/usr/share/dict/words`</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my =
$LINE=3Dint(rand($LINES));</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chop($upass=3D`tail =
+$LINE $WORDS | head -1`);</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">}</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Courier New">setupass;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">print =
&quot;$upass\n&quot;;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier =
New">-------------------------------------------------------------------=
--------</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">or</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier =
New">-------------------------------------------------------------------=
--------</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">#!/bin/ksh</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Courier New">RANDOM=3D`date | =
/usr/local/bin/md5 | tr -d '[a-z]'`</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Courier New">setupass()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">{</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
WORDS=3D/usr/share/dict/words</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINE=3D`expr $RANDOM \* =
$RANDOM`</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINE=3D`expr $LINE % =
25486`</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 25486 is `wc -l &lt; =
/usr/share/dict/words`</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; upass=3D&quot;`tail =
+$LINE $WORDS | head -1`&quot;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">}</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Courier New">setupass</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Courier New">echo &quot;$upass&quot;</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Courier New">Plus a C program from Christophe =
DIARRA and a warning not to use dictionary words as passwords from Ann =
Majeske.&nbsp; Thank you to everyone who responded - this will make =
adding those several hundred users much easier.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Courier New">Mark</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C08491.9749E2A0--

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-01-22 16:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-22 16:37 SUMMARY: Generating Passwords Myszkowski.Mark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox