bcrypt-ruby

Using bcrypt-ruby to validate hashed passwords using version $2y

北城余情 提交于 2021-02-07 20:55:20
问题 We're in a bit of a bind where we need to use Ruby to auth users against an existing db of users. The user's passwords were all generated using password_compat PHP library. All the hashed passwords start with $2y. I've been using bcrypt-ruby to try and authenticate the users and I haven't found any success. #This user's password is "password" irb(main):041:0> g = BCrypt::Password.new("$2y$10$jD.PlMQwFSYSdu4imy8oCOdqKFq/FDlW./x9cMxoUmcLgdvKCDNd6") => "$2y$10$jD.PlMQwFSYSdu4imy8oCOdqKFq/FDlW.

Using bcrypt-ruby to validate hashed passwords using version $2y

半世苍凉 提交于 2021-02-07 20:47:24
问题 We're in a bit of a bind where we need to use Ruby to auth users against an existing db of users. The user's passwords were all generated using password_compat PHP library. All the hashed passwords start with $2y. I've been using bcrypt-ruby to try and authenticate the users and I haven't found any success. #This user's password is "password" irb(main):041:0> g = BCrypt::Password.new("$2y$10$jD.PlMQwFSYSdu4imy8oCOdqKFq/FDlW./x9cMxoUmcLgdvKCDNd6") => "$2y$10$jD.PlMQwFSYSdu4imy8oCOdqKFq/FDlW.

block in replace_gem can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1

房东的猫 提交于 2020-01-15 12:33:11
问题 I've looked at several answers regarding this problem and none seem to do the trick. This is on windows and I am lost for ideas. Thanks for the help! C:/Ruby200/lib/ruby/gems/2.0.0/gems/bcrypt-ruby-3.0.1-x86-mingw32/lib/bcrypt_ext.rb:2:in require': cannot load such fil e -- 2.0/bcrypt_ext (LoadError) from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bcrypt-ruby-3.0.1-x86-mingw32/lib/bcrypt_ext.rb:2:in ' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bcrypt-ruby-3.0.1-x86-mingw32/lib/bcrypt.rb:12:in `require

Why does Ruby's bcrypt lib include the salt in plaintext in the hash? [duplicate]

社会主义新天地 提交于 2020-01-03 16:59:53
问题 This question already has answers here : How can bcrypt have built-in salts? (3 answers) Do I need to store the salt with bcrypt? (1 answer) Closed 5 years ago . I am using Coda Hale's Ruby bcrypt library. I noticed recently that it wasn't working like I thought it worked. I had thought that the proper procedure is: Generate a salt Obtain a password Concatenate the salt and the password strings Hash them through your hashing function But when I look at the results of the bcrypt function it

Are Rails passwords generated with bcrypt portable?

99封情书 提交于 2020-01-03 14:09:26
问题 I have an existing web application with a few thousand users which I'm porting over to Rails. As I rewrite and refactor this app I may need to run it on any number of different servers for development, testing, and production purposes. I'm using Rails' built-in has_secure_password method in my user model but I'm concerned about the portability of password data. I will need to move the contents of my database from machine to machine to test in different environments and its very important that

bcrypt-ruby - You don't have bcrypt-ruby installed in your application

十年热恋 提交于 2019-12-31 03:45:12
问题 I'm beginner in Ruby on Rails and trying to learn from http://ruby.railstutorial.org/ I'm creating sample_app and got stuck at chapter 6. My Ruby version: ruby 2.0.0p195 (2013-05-14) [i386-mingw32] My Rails version: Rails 4.0.0 I have following line in my GemFile: gem 'bcrypt-ruby', '~> 3.0.0' If I type gem list bcrypt-ruby , it shows bcrypt-ruby (3.0.1) . But if I try to create user, I get error saying You don't have bcrypt-ruby installed in your application. Please add it to your Gemfile

Using has secure password on a rails 4 app

微笑、不失礼 提交于 2019-12-25 04:26:36
问题 I'm trying to use has_secure_password for user login, I've defined the User mode as below require 'digest/md5' class User < ActiveRecord::Base has_secure_password before_validation :prep_emailId before_save :create_avatar_url validates :emailId, presence: true, uniqueness: true, format: { with: /\A(|(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6})\z/i } validates :first_name, presence: true has_many :projects

bcrypt_ext. so (LoadError)

假装没事ソ 提交于 2019-12-23 03:14:27
问题 I get the following Error when i try to start the rails server. Any ideas? Im using a 32bit Windows 7 machine with Ruby on Rails 4 and ruby 2.0.0p247 . I included the gem "bcrypt-ruby", "~> 3.1.1" in my gemfile. Heres my stack trace. rails s ansi: 'gem install win32console' to use color on Windows => Booting WEBrick => Rails 4.0.0 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server Exiting C:/Ruby200/lib

Rails 4 - Allow password change only if current password is correct

末鹿安然 提交于 2019-12-12 10:58:58
问题 In my app, users can edit their profile information. On the edit profile form, the user can make changes to all fields (name, title, and more). On this same form are three fields: current_password , password , and password_confirmation . I am using bcrypt 's has_secure_password feature for password authentication. I am NOT using Devise at all. I want users to only be able to change their password if they have supplied a correct current password. I've got this working before with the following

Error installing bcyrpt-ruby gem bundle

最后都变了- 提交于 2019-12-12 10:07:40
问题 I'm trying to install the Devises gem, running bundle install and then getting this error with bcrypt-ruby which I haven't had before. What can I do? Installing bcrypt-ruby (3.0.1) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb creating Makefile make xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0