How can bcrypt have built-in salts?

This is bcrypt: Generate a random salt. A “cost” factor has been pre-configured. Collect a password. Derive an encryption key from the password using the salt and cost factor. Use it to encrypt a well-known string. Store the cost, salt, and cipher text. Because these three elements have a known length, it’s easy to concatenate them and store them … Read more

Cannot load such file — bcrypt_ext

I had a similar problem today with ruby 2.3.3 and rails 4.2.4. The problem was that bundle install of devise installed as a dependency another version of bcrypt (bcrypt (3.1.11 x86-mingw32) instead of bcrypt (3.1.11)) which was causing trouble with ruby 2.3 (it should work with all previous versions of ruby) The solution I used is to install bcrypt … Read more

How to decrypt hash stored by bcrypt

You’re HASHING, not ENCRYPTING! What’s the difference? The difference is that hashing is a one way function, where encryption is a two-way function. So, how do you ascertain that the password is right? Therefore, when a user submits a password, you don’t decrypt your stored hash, instead you perform the same bcrypt operation on the user input and compare … Read more

Unable to install gem – Failed to build gem native extension – cannot load such file — mkmf (LoadError)

There are similar questions: `require’: no such file to load — mkmf (LoadError) Failed to build gem native extension (mkmf (LoadError)) – Ubuntu 12.04 Usually, the solution is: sudo apt-get install ruby-dev Or, if that doesn’t work, depending on your ruby version, run something like: sudo apt-get install ruby1.9.1-dev Should fix your problem. Still not … Read more