You are here: Re: Linux System Users Login/Password? « PHP Programming Language « IT news, forums, messages
Re: Linux System Users Login/Password?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация