Class | Authlogic::CryptoProviders::SCrypt |
In: |
lib/authlogic/crypto_providers/scrypt.rb
|
Parent: | Object |
If you want a stronger hashing algorithm, but would prefer not to use BCrypt, SCrypt is another option. SCrypt is newer and less popular (and so less-tested), but it‘s designed specifically to avoid a theoretical hardware attack against BCrypt. Just as with BCrypt, you are sacrificing performance relative to SHA2 algorithms, but the increased security may well be worth it. (That performance sacrifice is the exact reason it‘s much, much harder for an attacker to brute-force your paswords). Decided SCrypt is for you? Just install the bcrypt gem:
gem install scrypt
Tell acts_as_authentic to use it:
acts_as_authentic do |c| c.crypto_provider = Authlogic::CryptoProviders::SCrypt end
DEFAULTS | = | {:key_len => 32, :salt_size => 8, :max_time => 0.2, :max_mem => 1024 * 1024, :max_memfrac => 0.5} |
key_len | [W] | |
max_mem | [W] | |
max_memfrac | [W] | |
max_time | [W] | |
salt_size | [W] |
Does the hash match the tokens? Uses the same tokens that were used to encrypt.