Created
October 24, 2013 11:51
-
-
Save tkuchiki/7135871 to your computer and use it in GitHub Desktop.
bcrypt password hashing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# gem install bcrypt-ruby | |
require "bcrypt" | |
# 1.9.3 or later | |
require "io/console" | |
print "Enter password: " | |
password = STDIN.noecho(&:gets) | |
# versions eariler later than 1.9.3 | |
# gem install highline | |
#require "highline/import" | |
#password = ask("Enter password: ") { |q| q.echo = false } | |
print "\n" | |
print BCrypt::Password.create(password) + "\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment