Module: Entrance::Ciphers::BCrypt

Defined in:
lib/entrance/ciphers.rb

Class Method Summary collapse

Class Method Details

.encrypt(password, salt = nil) ⇒ Object



38
39
40
# File 'lib/entrance/ciphers.rb', line 38

def self.encrypt(password, salt = nil)
  ::BCrypt::Password.create(password)
end

.match?(stored, given, salt = nil) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
36
# File 'lib/entrance/ciphers.rb', line 33

def self.match?(stored, given, salt = nil)
  ::BCrypt::Password.new(stored) == given
  # ::BCrypt::Password.new(stored) == encrypt(given)
end