CV wrote:
> Well, I didn't realize that there was a lower-level part to the
> library too! But unfortunately we're not there yet:
> 
> ruby-1.9.2-p0 > BCrypt::Engine.hash_secret("test",
> "Hki1ozSQrkmvGzddNJq")
> BCrypt::Errors::InvalidSalt: invalid salt

I wonder if Authlogic overrode any of the default settings for BCrypt?

What do you get using irb for @version, @cost, @salt, @hash after:

@version, @cost, @salt, @hash = BCrypt::Password.new(u.crypted_password)

on your test user?  Source docs indicate Password.new returns a 
quadruple:

     # File lib/bcrypt.rb, line 161
161:     def initialize(raw_hash)
162:       if valid_hash?(raw_hash)
163:         self.replace(raw_hash)
164:         @version, @cost, @salt, @hash = split_hash(self)
165:       else
166:         raise Errors::InvalidHash.new("invalid hash")
167:       end
168:     end
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to