How to migrate from md5 to bcrypt?

205 views
Skip to first unread message

regedarek

unread,
Jan 28, 2012, 6:32:09 AM1/28/12
to rubyonra...@googlegroups.com
I would like to migrate users from my old phpfusion site but I have there hash password md5(md5) how to convert this passwords to bcrypt?
I creating Sinatra app whre i use this passwords with Warden.

Linus Pettersson

unread,
Jan 28, 2012, 12:36:46 PM1/28/12
to rubyonra...@googlegroups.com
Is that even possible? I don't think so...

I'd say that the best way is to reset all the passwords, notify them and allow them to change it.

Linus

regedarek

unread,
Jan 28, 2012, 12:38:55 PM1/28/12
to rubyonra...@googlegroups.com

Michael Pavling

unread,
Jan 28, 2012, 12:41:15 PM1/28/12
to rubyonra...@googlegroups.com
On 28 January 2012 17:38, regedarek <dariusz...@gmail.com> wrote:
> I solved this -> https://gist.github.com/1694730

Rails-related how?
?:-/

Philip Hallstrom

unread,
Jan 28, 2012, 12:48:51 PM1/28/12
to rubyonra...@googlegroups.com
> I would like to migrate users from my old phpfusion site but I have there hash password md5(md5) how to convert this passwords to bcrypt?
> I creating Sinatra app whre i use this passwords with Warden.

If you can configure Warden to use the md5 passwords, then do that. Then, modify the login process so that upon successful login you save their password (which you have at the moment in plain text) as a bcrypt-ed string. On next login, verify against bcrypt.

For more info, take a look at authlogic's "migrate from restful authentication" to see how it handles it...

-philip

Reply all
Reply to author
Forward
0 new messages