Title: Encoding password from an external script
Last modified: August 20, 2016

---

# Encoding password from an external script

 *  Resolved [youradds](https://wordpress.org/support/users/youradds/)
 * (@youradds)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/encoding-password-from-an-external-script/)
 * Hi,
 * I’m trying to write a little perl script that will create a wordpress user , 
   and also a user account in another system (in perl). I’ve almost got it working,
   apart from the password doesn’t seem to wanna work.
 * I wrote a little PHP script to generate the password, and then I grab the password
   in Perl from this script:
 *     ```
       <?php
       include_once("../wp-config.php");
   
       	include_once("../wp-includes/class-phpass.php");
   
       	$wp_hasher = new PasswordHash(8, TRUE);
   
       	echo $wp_hasher->HashPassword($password) ;
   
       ?>
       ```
   
 * ;
 * As far as I can see that should work – it creates passwords like:
 * $P$B9JuIfhNbvYk3zDfTeD7oU/ATfuZrj.
 * ..and working passwords on my site look like:
 * $P$BcZ1IHg.SjwqTAt0vrHI97/0K9KaGS0
 * Anyone got any suggestions as to what else I can try? I’m a bit stumped!
 * TIA
 * Andy

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [youradds](https://wordpress.org/support/users/youradds/)
 * (@youradds)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/encoding-password-from-an-external-script/#post-2321401)
 * Just to update, I tested changing the password in wp-admin, and it works then
 * The encoded password before was “$P$BFSMEgYCDFx1kKcyH9lHa1mXCHxpTk0” for the 
   password “test”, but when updated in the admin panel, it was “$P$BIBLfCEsEoNPLQF3YqgAA1P1SM6wS9/”
   for the same password.
 * Any suggestions are much appreciated!
 * Cheers
 * Andy
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/encoding-password-from-an-external-script/#post-2321405)
 * You need to MD5 encrypt passwords.
 *  Thread Starter [youradds](https://wordpress.org/support/users/youradds/)
 * (@youradds)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/encoding-password-from-an-external-script/#post-2321686)
 * Ah you beauty! I tried that before, but it didn’t work – not sure why
 * Thanks!
 * Andy

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Encoding password from an external script’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [youradds](https://wordpress.org/support/users/youradds/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/encoding-password-from-an-external-script/#post-2321686)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
