devise icon indicating copy to clipboard operation
devise copied to clipboard

Converting from authlogic bcrypt results in "invalid salt" error

Open jsierles opened this issue 16 years ago • 8 comments

I was using Authlogic with bcrypt. After changing the field names and installing devise, the 'invalid salt' message comes up.

jsierles avatar Sep 20 '10 18:09 jsierles

I guess you are using :authlogic encryptor right? Maybe Devise and Authlogic stores the salt in different ways? Since for bcrypt the salt ends up stored with the password?

josevalim avatar Sep 20 '10 18:09 josevalim

I was trying to use the bcrypt one. I'll look into how authlogic does it.

jsierles avatar Sep 20 '10 18:09 jsierles

It looks like authlogic stores the salt in a separate field and the crypted password is 128 chars long.

jsierles avatar Sep 20 '10 18:09 jsierles

Yeah, we have an authlogic encryptor. Have you tried using it? It should work.

josevalim avatar Sep 20 '10 19:09 josevalim

Yes, I have tried it (:authlogic_sha512) but I was using bcrypt with authlogic.

jsierles avatar Sep 20 '10 19:09 jsierles

I see it. So you will have to create your own encryptor. It is quite easy! :)

josevalim avatar Sep 20 '10 19:09 josevalim

Yep, thanks!

jsierles avatar Sep 20 '10 19:09 jsierles

Had the same problem when switching from Autlogic bcrypt to Devise bcrypt. But my mistake was just not reading. Setting config.stretches to 20 too, like stated, did the trick!

heijmerikx avatar Dec 29 '10 14:12 heijmerikx