Created
October 18, 2010 07:38
-
-
Save modsognir/631880 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.encryptor = :modsognir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new.encrypted_password = old.crypted_password | |
new.password_salt = old.salt | |
new.save(false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Devise | |
module Encryptors | |
class Modsognir < Base | |
def self.digest(password, stretches, salt, pepper) | |
Digest::SHA1.hexdigest("#{salt}-#{password}-#{pepper}") | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment