Page 1 of 1

SHA1 Password encryption

Posted: Fri Oct 28, 2011 5:03 am
by ZeeBOB

The application I am trying to package comes with its own installer. I am trying to remove this and do everything within the Installatron installer. I have pretty much every nailed down except for one part.

The normal script installer asks the user to provide an admin username, password etc however it stores the password as an sha1 value. The exact function is:

Code: Select all

sha1(sha1(SALT . $password))
So really this is the hash of the hash created from the SALTPASSWORD combination

Can I achieve this in the install file for Installatron?

Re: SHA1 Password encryption

Posted: Fri Oct 28, 2011 7:17 am
by Phil

Sure, Installatron installer files are regular PHP files. You can simply do this:

$encodedPassword = sha1(sha1($salt.$this->input["field_passwd"]))

If there are any questions let us know.


Re: SHA1 Password encryption

Posted: Sun Oct 30, 2011 2:00 am
by ZeeBOB
Excellent! Thanks