Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7857319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:00:29+00:00 2026-06-02T21:00:29+00:00

I am using BCrypt in my RoR and I am getting numbers instead of

  • 0

I am using BCrypt in my RoR and I am getting numbers instead of the hexadecimal representation I am used to. Here is the criminal code.

username = params[:username]
password = params[:password]

encrypted_password = BCrypt::Password.create(password)
encrypted_password = encrypted_password.hash

the encrypted_password variable comes out as numbers like 4245597694343378249. I’ve used BCrypt for Java and I am was expecting something like $2asfa$asdfasfsafsad. I was wondering if anyone knew what I am doing wrong.

Any help is greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T21:00:30+00:00Added an answer on June 2, 2026 at 9:00 pm

    The password variable coming out as a sequence of numbers is because of the .hash you are applying to the encrypted password. So you are calling the String#hash method which just gives you a hash based on the length and contents.

    If you want to see the bcrypt output that you are expecting just do the following:

    username = params[:username]
    password = params[:password]
    
    encrypted_password = BCrypt::Password.create(password)
    puts encrypted_password
    

    Cheers,
    Sean

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using .Net implementation of BCrypt for storing passwords in the database. The password
I've installed RoR in my MacOS X using this guide http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/ Here my versions:
I have read that when hashing a password, many programmers recommend using the BCrypt
I'm using phpass 's bcrypt functionality to hash a password on my site. Now,
I followed RailsCasts authentication from scratch (http://railscasts.com/episodes/250-authentication-from-scratch-revised) using the bcrypt-ruby gem and have the
Using LINQ on collections, what is the difference between the following lines of code?
I have been reading about bcrypt (application perspective). Thinking of using it to store
Using Ruby 1.9.3 and bcrypt-ruby 3.0.1 I'm working on the Depot app from the
I am implementing a validation scheme and am using the bcrypt-ruby gem. require 'bcrypt'
Using one of the C# implementations of BCrypt to hash passwords and store them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.