|
|
Posted by Vincent Pirez on 06/13/06 19:35
"David Haynes" <david.haynes2@sympatico.ca> wrote in message
news:gYDjg.26453$CX3.5813@fe46.usenetserver.com...
>>
> The short answer is that the salt of the encrypted password in the shadow
> file is used.
>
> A sample program:
> <?php
> $shadow_pw = '$1$Hlpmlp9i$5VnapGyOuIzJFkPcrvE7a.';
> $my_pw = array('foofoofoo', 'letmein');
>
> foreach( $my_pw as $pw ) {
> if( crypt($pw, $shadow_pw) == $shadow_pw ) {
> echo "The password $pw is good\n");
> } else {
> echo "The password $pw is bad\n");
> }
> }
> ?>
David,
Ahhh i get it now, by crypt()'ing the password against the shadow password
it somehow verifies.....I'm curious how this works, but don't need an
explanation unless anyone's willing to offer one?
Fact of the matter is it works, and is verifying nicely - many thanks for
your help David :)
Vince.
Navigation:
[Reply to this message]
|