You can't.

You have to have the non-crypted password which you then run the crypt()
function on.  Say the password is banana.  You then run:

  crypt('banana','ba')   =>  baGGlRhhSFzk2
  crypt('banana','ys')   =>  ysu0jnfX9fp2.

You make sure these two match the two crypted strings stored in the DB.
There is no way to compare baGGlRhhSFzk2 directly to ysu0jnfX9fp2.

-Rasmus

On Wed, 15 May 2002, Matthew Ward wrote:

> I'm currently integrating my site with YaBB so that when you log into my
> YaBB forums it also logs you into the whole site. I'm also developing a
> script that I'm integrating into my main page that checks the password in
> the cookie with the one in the database as a security check.
>
> The problem is, the crypted password stored in the database is seeded with
> the password itself, however the crypted password that the YaBB login script
> stores in the cookie is seeded with "ys", producing two completely different
> passwords. So how am I (and how does YaBB) compare these two passwords to
> make sure their the same, if their completely different?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to