Hashing Out with BCrypt

One Way Hashing

Photo by Jason Tuinstra on Unsplash

BCrypt

BCrypt in Rails app

class User < ActiveRecord::Base
has_secure_password
end
class User < ActiveRecord::Base
def password
@password
end
def password=(plaintext_pass)
self.password_digest = BCrypt::Password.create(plaintext_pass)
end
def authenticate(plaintext_pass)
if BCrypt::Password.new(self.password_digest) == plaintext_pass
true
end
end
end

Software Engineer Student at Flatiron School