How to use phpBB password hashing on a different website?

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Get Involved
Post Reply
GeoffL
Registered User
Posts: 4
Joined: Wed Nov 09, 2011 2:26 pm

How to use phpBB password hashing on a different website?

Post by GeoffL »

I'm a phpBB newbie, so please excuse what might be a banal question!

phpBB 3.0.9 running on a GoDaddy Linux shared hosting account.

I'd like my phpBB users to give their contact information, sign up for our newsletters, etc. on our main website. Since AFAICT phpBB uses custom hashing, it's probably easier for me to create a second user table in the same database that phpBB uses for my custom info and have this 1:1 with phpbb_users. (The database is accessible by both the board and our main website) This should let me use the phpBB_users table to authenticate users on our main website. However, to do that I need to embed the phpBB hashing algorithm into the code for our main website, so I'd be grateful for any pointers in the right direction!

TIA,

Geoff
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: How to use phpBB password hashing on a different website

Post by igorw »

Hi there,

phpBB 3.x uses phpass for hashing. However, we (unfortunately) use a custom hash identifier, which means that once you find the download link on that page (yeah, it's hard to find), you'll have to modify PasswordHash.php as follows:

In the `gensalt_private` method, change this line:

Code: Select all

$output = '$P$';
To:

Code: Select all

$output = '$H$';
After that you should be able to use that `PasswordHash` to generate phpBB-compatible hashes!
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
GeoffL
Registered User
Posts: 4
Joined: Wed Nov 09, 2011 2:26 pm

Re: How to use phpBB password hashing on a different website

Post by GeoffL »

Wow! That was quick!

Many thanks,

Geoff
Post Reply

Return to “phpBB Discussion”