Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Manually create sha1 password/salt


Go to End


3 Posts   3196 Views

Avatar
DeklinKelly

Community Member, 197 Posts

15 May 2009 at 6:33am

The DB contains these fields:

Password
s2z1w96s2804og888w4w48o8koogsgg 	

Salt
45hjh3lh63cw8s84o8gso800c4skcsco0csoc08

PasswordEncryption 	
sha1

I want to manually change or add a password. But first I need to know how to create the sha1 password / salt

Presuming the password is "password" how can I (with PHP) create the encrypted password / salt data?

Avatar
DeklinKelly

Community Member, 197 Posts

21 May 2009 at 5:06am

How can I change the password using SQL?

UPDATE `MemberPassword` SET `Password` = 'svhznj3i668w448owkwo8s0k4oo4s0d', `PasswordEncryption` = 'sha1', `Salt` = '1dsfj8i4swo0cowocgk88oo8woo0w4g80swswwk' WHERE `ID` = 1 LIMIT 1 ;
UPDATE `Member` SET `Password` = 'svhznj3i668w448owkwo8s0k4oo4s0d', `PasswordEncryption` = 'sha1', `Salt` = '1dsfj8i4swo0cowocgk88oo8woo0w4g80swswwk' WHERE `ID` = 1 LIMIT 1 ;

Avatar
CodeGuerrilla

Community Member, 105 Posts

13 January 2010 at 6:23pm

I would also like to know how to manually generate the salt as I am importing a whole bunce of users from a legacy application and need to do this also.

Any help appreciated.