Module: Digestive::Credentials

Included in:
User
Defined in:
lib/digestive/credentials.rb

Instance Method Summary collapse

Instance Method Details

#encrypt_password(username, realm, password) ⇒ String

Encrypt a given password for comparison with a password given during the authentication process, per RFC2069.

Parameters:

  • username (String)

    User’s username

  • realm (String)

    Realm to which the user is authenticating

  • password (String)

    User’s password

Returns:

  • (String)

    A string encrypted per RFC2069



18
19
20
21
# File 'lib/digestive/credentials.rb', line 18

def encrypt_password(username, realm, password)
  a1 = [username, realm, password].join(':')
  ::Digest::MD5.hexdigest(a1).to_s
end