Darren,<br> <br> Thank you very much for the reply.&nbsp; Unfortunately, for me I am running linux which appears to use MD5 and a complicated salt that has me stumped.<br> <br> So far I've tried:<br> <br> #MD5 salt<br> my @chars = ('a'..'z','A'..'Z','0..9','.');<br> <br> for (1..8) {<br> &nbsp;&nbsp;&nbsp; $MD5salt .= $chars[int(rand(scalar(@chars)))];<br> }<br><br> my $tpass = crypt($plainfromuser, '$1$' . $MD5salt);<br> <br> unix_MD5_crypt($plainfromuser, '$1$' . $MD5salt) also gives me the same result (string)<br> <br> while $tpass does match $passwd in length (number of characters) the string is vastly different and as a result does not match.<br> <br> Any additional help would be greatly appreciated.<br> <br> Thanks, again for the help thus far.<br> <br><b><i>"Young, Darren" &lt;Darren.Young@ChicagoGSB.edu&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> <br>Use the getpw* (getpwnam) functions to
 return the user's password entry,<br>if your name service switch is configured correctly it'll return the<br>entry regardless of location.<br><br>You MUST have the encrypted first to perform the comparision. This is<br>also assuming you're password is in crypt format and not something else<br>(MD5, etc). If it is crypt, take the first 2 characters to get the salt<br>then re-crypt() the plain from the user with that salt. Once that's done<br>just string compare the 2, if they match, the password was correct,<br>else, it was wrong.<br><br>&gt;&gt;&gt;<br><br>my $username = 'foo';<br>my $plainfromuser = 'hispass';<br>my $currentsalt;<br><br>my ($name, $passwd, $uid, $gid, $quota, $comment, <br> $gcos, $dir, $shell) = getpwnam($username);<br><br>$currentsalt = substr($passwd,0,2);<br><br>my $tpass = crypt($plainfromuser, $currentsalt);<br><br>if ( $tpass eq $passwd ) {<br>    print "good\n";<br>} else {<br>    print "bad\n";<br>}<br><br>Just tried that on my NIS enabled Solaris 8 system
 and it worked.<br><br><br><br> <br> I am trying to write a script that prompts a user ( that is<br>already logged in ) for his password when he runs certain perl<br>applications.  I am able to write the part that prompts the user for the<br>password with "no echo" however I have no idea how to compare the entry<br>to his password especially since we use NIS and thus the passwords are<br>not on the local machine but on the server ( on the same LAN).  Can<br>anyone provide any help on how I would compare the entry against the NIS<br>password?<br> <br> Thanks in advance,<br> <br> Richard<br> <br> <br> A people that values its privileges above its principles soon<br>loses both.<br> -Dwight D. Eisenhower.<br><br>_______________________________________________<br>Chicago-talk mailing list<br>Chicago-talk@pm.org<br>http://mail.pm.org/mailman/listinfo/chicago-talk<br></blockquote><br><BR><BR>A people that values its privileges above its principles soon loses both.<br> -Dwight D. Eisenhower.