3877 Posts in 1011 Topics by 1176 members
Installing SilverStripe
SilverStripe Forums » Installing SilverStripe » Admin password encryption
Getting SilverStripe up and running on your computer and on your web server.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 1907 Views |
-
Admin password encryption

14 September 2009 at 8:36am
How exactly is the admin password encrypted?
I've created a registration form that encrypts the password with sha1. When I create a password 'password' in the table, it comes out as 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8, and as the admin password is also 'password' I'd expect it to be the same, but it's not - it's fy17qyc55m0o8kc0oks00os8w0gk44w, but the PasswordEncryption field for admin says sha1 anyway.
Can someone tell me how to get the encryption in my form working the same way as the admin record?
-
Re: Admin password encryption

14 September 2009 at 9:02am
Passwords are hashed and salted so they are unique. If you just hashed passwords you could pretty easily start guessing passwords.
The only way to get them the same is if they use the same salt and like I said, thats a security flaw. You can however override the default behaviour by setting Security::set_password_encryption_algorithm('sha1', false); in your config - false turning off salting
-
Re: Admin password encryption

15 September 2009 at 9:26am Last edited: 15 September 2009 9:27am
How would I go about generating a new salt and applying it to a new password in order to make it unique?
Is that even what I have to do?
-
Re: Admin password encryption

15 September 2009 at 9:39am
You can hash and salt a given string by running it through Security::encrypt_password("password"); and that will return you an array - the password, the salt and the hash. I think however, if you are making a registration form and you are saving the data into the Password field of the Member object it will do the salting and hashing for you.
-
Re: Admin password encryption

3 October 2009 at 7:48pm
Is there a way I can change the way the Login form checks what is typed in the password field with the database? Like, a .php file in Security or something? So that it only changes the password to sha1 with no salt and just checks it that way?
Sure, there'll be a security issue there, but this is just for experimental purposes anyway
-
Re: Admin password encryption

6 November 2009 at 3:35pm
We've done some work on pluggable password hashing in trunk, see http://open.silverstripe.org/ticket/3004 and http://open.silverstripe.org/ticket/3004 and http://open.silverstripe.org/ticket/3665
| 1907 Views | ||
|
Page:
1
|
Go to Top |



