views:

25

answers:

2

My website used to work on wordpress engine but now I'm writing my own script. The problem is that users passwords in wp_users table are encoded in a strange way... Can anyone please tell how should I encode it so that it worked on my new script?

+5  A: 

The "encoded" password is called a hash. Look through the wordpress code where it does the user insert and find how it hashes the password. Use that same type of scheme. It will probably use a salt, I am not familiar with how wordpress does this, but you will need that salt value as well to make an exact match.

EDIT:

Doing some research, you will want to take a look into the wp-includes/pluggable.php file around line 1200. It should have the salt and password generator techniques stored in there (or at least I think, I did not dig too deep into it).

Brad F Jacobs
+1  A: 

As premiso said its a hash and you can find the class wordpress use here: Wordpress PasswordHash. If you review this class you can easily build it into your own script.

objneodude
Thanks for posting the system WP uses. +1
Brad F Jacobs