Questions tagged [bcrypt-ruby]

The bcrypt Ruby gem provides a simple wrapper for safely handling passwords.

Bcrypt-ruby gem is a sophisticated and secure hash algorithm designed by The OpenBSD project for hashing passwords. The bcrypt Ruby gem provides a simple wrapper for safely handling passwords.

If you store user passwords in the clear, then an attacker who steals a copy of your database has a giant list of emails and passwords. Some of your users will only have one password -- for their email account, for their banking account, for your application. A simple hack could escalate into massive identity theft.

It's your responsibility as a web developer to make your web application secure -- blaming your users for not being security experts is not a professional response to risk.

Source: https://rubygems.org/gems/bcrypt-ruby

109 questions
0
votes
1 answer

Cannot install bcrypt 3.1.16 gem on Windows: ld.exe: cannot find -lgmp

I'm trying to update my bundle, it needs bcrypt, but it fails with an error. >bundle Fetching bcrypt 3.1.16 Installing bcrypt 3.1.16 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory:…
Chloe
  • 25,162
  • 40
  • 190
  • 357
0
votes
1 answer

Rails 6 Bcrypt vs Passenger error on Production

After changing my ssl settings and restarting my Nginx, I started to receive the following error in the Passenger startup: Before process_action callback :ensure_user_signed_in has not been defined (ArgumentError) I am running Rails 6,…
Argent
  • 303
  • 1
  • 12
0
votes
1 answer

Rails: password can't be blank, BCrypt

I have a user model class User < ApplicationRecord include ApplicationConstants enum role: { admin: 0, waiter: 1, chef:2 } has_secure_password validates :name, :role, presence: true, on: :create validates :email, uniqueness: true,…
Hariraj
  • 65
  • 8
0
votes
2 answers

Can't verify CSRF token authenticity with Custom Password Requirements

I have a Rails 5 API and I'm setting up authentication. I have added some custom password requirements, and everything works for account creation and logging an account out, but I get a Completed 422 Unprocessable Entity error that goes along with…
Daniel
  • 155
  • 2
  • 12
0
votes
3 answers

How to fix the problem, When I try authentication on local system its working perfectly, but when uploaded to heroku it comes back with error 500?

I am new to rails and react, this might be a simple one but i cant seem to figure it out. I am trying to implement a simple jwt authentication using ruby on rails with react as client. I followed the steps that was suggested in :…
0
votes
2 answers

Brcrypt authenticate method not working with already brcypt value

I have a User Model with encryption using brcypt gem. However, when I am using the following code it is returning false as result. User.find(117).try(:authenticate ,User.find(117).password_digest) But below mentioned command works fine:…
Rohan
  • 2,681
  • 1
  • 12
  • 18
0
votes
3 answers

gem install bcrypt (gcc: error:) on Ubuntu 16.04

What went wrong? Tried gem install bcrypt, gem install bcrypt-ruby, and getting the same result. Couldn't do bundle install in ruby on rails because of this error. sylviachoong@sylviachoong:~/Desktop/postco$ gem install bcrypt-ruby Building native…
0
votes
0 answers

Ruby on Rails Devise Gem -> LoadError in Devise::RegistrationsController#create

Could someone help me. Using the Devise Gem and just follow the instructions @ https://github.com/plataformatec/devise See image. When I sign up, I get this error. LoadError in Devise::RegistrationsController#create enter image description here
0
votes
1 answer

bcrypt LoadError with Rails

I am having trouble finding a solution to this issue, and have tried many fixes others have ran into with no success. I am working on the Ruby on Rails 5 Tutorial by Michael Hartl which requires using bcrypt to implement the has_secure_password…
BaracudaBill
  • 125
  • 2
  • 8
0
votes
1 answer

has_secure_password - only hashes or encrypts as well?

I'm not entirely sure if, when you add has_secure_password in a Rails model, there's any encryption involved. I know there's definitely hashing with a salt, but is there encrypting? bcrypt can use blowfish, but is it being used in bcrypt-ruby (the…
anemaria20
  • 1,646
  • 2
  • 17
  • 36
0
votes
2 answers

Bcrypt - Ruby on Rails with Devise - Windows issue

I'm having problems with bcrypt when either trying to start my rails server or attempting to login on the localhost. I have played around by re-downloading/updating my Gem file with different versions of bcrypt and moving files around as per some of…
daveGeo
  • 323
  • 1
  • 3
  • 9
0
votes
0 answers

Can't create User, getting "ActiveRecord::RecordInvalid: Validation failed: Password can't be blank" Error

I have some serious problem with understanding what is wrong in my code after implemented "has_secure_password" . My issue to use "has_secure_password" and create new User. I am using rails 4 Gemfile source 'https://rubygems.org' # Bundle edge…
Aruy Aruy
  • 494
  • 5
  • 7
0
votes
1 answer

Enabling Bcrypt on Rails 5

I'm starting a new app on Rails 5.0.0 and trying to use bcrypt. I've followed the directions on the bcrypt repo but something is missing as I'm getting ActiveModel::ForbiddenAttributesError Here is the user.rb: require 'bcrypt' class User <…
Yaron
  • 610
  • 6
  • 13
0
votes
1 answer

Migrate SHA1 Salted Hashes To Be Encrypted by Bcrypt

I have an old application (built on .Net C#) includes Users table with hashed passwords sha1(password . salt), and I need to migrate this data safely to my new Rails application (which already encrypting passwords using bcrypt-ruby gem) and looking…
Moamen Naanou
  • 1,683
  • 1
  • 21
  • 45
0
votes
1 answer

Correct practice for using Bcrypt

This guide shows how to use Bcrypt with Rails, but it differs significantly in implementation from this Rails documentation on Bcrypt. Guide version Set password def password=(password) self.password_digest =…
Matt C
  • 4,470
  • 5
  • 26
  • 44