AdonaiEchad wrote:
> I have done what you have asked and I still cannot
login. I placed the same
> type of code on the login page and it will not allow me
to go any further.
> Also, if I want to edit a user the old way I am able to
see the password field,
> with the encryption I can see a bunch of letters and
numbers which is the
> encryption, is there a way where it decrypt it so I can
see the password since
> I am an administrator?
As explained before, sha1() and md5() perform one-way
encryption only.
The encrypted password cannot be decrypted. The reason you
cannot login
is probably because the encrypted password is being truncated
when it's
stored. sha1() encrypts everything as a 40-character string,
so the
column needs to be VARCHAR(40).
If you want to be able to decrypt passwords, study the MySQL
manual's
page on encryption functions:
http://dev.mysql.com/doc/refman/5.0/en/encryption-functions.html
Depending on the version of MySQL you're runnning, use either
ENCODE()/DECODE() or AES_ENCRYPT()/AES_DECRYPT().
--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/