Methods

Files

Padrino::Admin::Utils::Crypt

This util it’s used for encrypt/decrypt password. We want password decryptable because generally for our sites we have: password_lost. We prefer send original password instead reset them.

Public Instance Methods

decrypt(password) click to toggle source

Decrypts the current string using the current key specified

# File lib/padrino-admin/utils/crypt.rb, line 18
def decrypt(password)
  cipher = build_cipher(:decrypt, password)
  cipher.update(self.unpack('m')[0]) + cipher.final
end
encrypt(password) click to toggle source

Encrypts the current string using the current key and algorithm specified

# File lib/padrino-admin/utils/crypt.rb, line 26
def encrypt(password)
  cipher = build_cipher(:encrypt, password)
  [cipher.update(self) + cipher.final].pack('m').chomp
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.