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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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

How to change password encryption/decryption algorithm

Go to End

2 Posts   2554 Views


Community Member, 2 Posts

7 September 2010 at 8:57am

Edited: 08/09/2010 12:36am


I'm migrating a lot of users (2200+) to SS from another system. The passwords for all the users are encrypted using the Blowfish algorithm (using java and BCrypt )

My question is: How can I tell SS to use this algorithm ??
I've been looking at the _config.php in sapphire and my gues is that I need to register at new password encryptor with "PasswordEncryptor::register" ??

Any help ?

Best Regards,


Community Member, 253 Posts

7 September 2010 at 9:33am

Edited: 08/09/2010 12:36am

Great question!

This page can help with regards to the basic concept, but to understand how to use your own custom encryption requires digging a bit deeper into how SilverStripe works.

First, you need to start by creating your "encryptor" class in mysite/code/. See the in-built password encryptor for SS to give you a base to work from. You want to create a class like so:

class MyEncryptor extends PasswordEncryptor {

You should be able to define your encryption algorithm in there.

You then need to register your encryptor and then assign it to be used. Something like this in your mysite/_config.php:


Then you should be good to go!

Hope that helps you out.