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.

General Questions

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

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

Manually create sha1 password/salt


Reply

3 Posts   2671 Views

Avatar
DeklinKelly

15 May 2009 at 6:33am Community Member, 197 Posts

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

21 May 2009 at 5:06am Community Member, 197 Posts

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

13 January 2010 at 6:23pm Community Member, 105 Posts

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.