class Devise::Encryptors::Aes256
AES¶ ↑
Uses the AES algorithm to encrypt passwords.
Public Class Methods
decrypt(encrypted_password, pepper)
click to toggle source
Returns the plaintext password where pepper is used for the key, and the initialization_vector is read from the Base64 encoded ciphertext
# File lib/encryptors/aes256.rb, line 22 def decrypt(encrypted_password, pepper) ::AES.decrypt(encrypted_password, pepper) end
digest(password, stretches, salt, pepper)
click to toggle source
Returns a Base64 encrypted password where pepper is used for the key, and the initialization_vector is randomly generated and prepended onto encoded ciphertext
# File lib/encryptors/aes256.rb, line 12 def digest(password, stretches, salt, pepper) ::AES.encrypt(password, pepper, {:iv => salt}) end
Also aliased as: encrypt
salt(stretches)
click to toggle source
Returns a base64 encoded salt
# File lib/encryptors/aes256.rb, line 17 def salt(stretches) ::AES.iv(:base_64) end