Questions tagged [bcrypt]

bcrypt is an implementation of the Blowfish cipher and a computationally-expensive hash function mostly used for password hashing.

bcrypt is an implementation of the Blowfish cipher and a computationally-expensive hash function mostly used for password hashing.

Resources

2290 questions
1333
votes
11 answers

How do you use bcrypt for hashing passwords in PHP?

Every now and then I hear the advice "Use bcrypt for storing passwords in PHP, bcrypt rules". But what is bcrypt? PHP doesn't offer any such functions, Wikipedia babbles about a file-encryption utility and Web searches just reveal a few…
Vilx-
  • 104,512
  • 87
  • 279
  • 422
752
votes
5 answers

How can bcrypt have built-in salts?

Coda Hale's article "How To Safely Store a Password" claims that: bcrypt has salts built-in to prevent rainbow table attacks. He cites this paper, which says that in OpenBSD's implementation of bcrypt: OpenBSD generates the 128-bit bcrypt salt…
Nathan Long
  • 122,748
  • 97
  • 336
  • 451
370
votes
5 answers

What column type/length should I use for storing a Bcrypt hashed password in a Database?

I want to store a hashed password (using BCrypt) in a database. What would be a good type for this, and which would be the correct length? Are passwords hashed with BCrypt always of same length? EDIT Example…
helpermethod
  • 59,493
  • 71
  • 188
  • 276
207
votes
17 answers

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

Ruby 1.9.3 The part of Gemfile #............... gem "pony" gem "bcrypt-ruby", :require => "bcrypt" gem "nokogiri" #.................. When I'm trying to install gems, I get an error alex@ubuntu:~/$ bundle Fetching gem metadata from…
Alexandre
  • 13,030
  • 35
  • 114
  • 173
205
votes
1 answer

Do I need to store the salt with bcrypt?

bCrypt's javadoc has this code for how to encrypt a password: String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt()); To check whether a plaintext password matches one that has been hashed previously, use the checkpw method: if…
RodeoClown
  • 13,338
  • 13
  • 52
  • 56
139
votes
2 answers

Is BCrypt a good hashing algorithm to use in C#? Where can I find it?

I have read that when hashing a password, many programmers recommend using the BCrypt algorithm. I am programming in C# and is wondering if anyone knows of a good implementation for BCrypt? I found this page, but I don't really know if it is bogus…
Svish
  • 152,914
  • 173
  • 462
  • 620
127
votes
15 answers

bcrypt invalid elf header when running node app

I'm working on a nodejs project for school. I wasn't able to install bcrypt with npm so i installed bcrypt-nodejs and the project worked fine yesterday. But today, when I do a "node app" i have this error…
user2244469
  • 1,271
  • 2
  • 8
  • 5
121
votes
6 answers

How does node.bcrypt.js compare hashed and plaintext passwords without the salt?

From github: To hash a password: var bcrypt = require('bcrypt'); bcrypt.genSalt(10, function(err, salt) { bcrypt.hash("B4c0/\/", salt, function(err, hash) { // Store hash in your password DB. }); }); To check a password: // Load…
SChang
  • 1,669
  • 2
  • 13
  • 13
118
votes
6 answers

.net implementation of bcrypt

Does anyone know of a good implementation of bcrypt, I know this question has been asked before but it got very little response. I'm a bit unsure of just picking an implementation that turns up in google and am thinking that I may be better off…
Gareth
  • 2,061
  • 2
  • 17
  • 22
116
votes
18 answers

Error installing bcrypt with npm

I'm unable to install bcrypt using npm on my machine because I encounter the following errors. I have been troubleshooting the issue without much luck. Can you recommend any steps to diagnose or fix the problem so I can run npm install bcrypt…
hawkharris
  • 2,570
  • 6
  • 25
  • 36
90
votes
4 answers

Optimal bcrypt work factor

What would be an ideal bcrypt work factor for password hashing. If I use a factor of 10, it takes approx .1s to hash a password on my laptop. If we end up with a very busy site, that turns into a good deal of work just checking people's…
Chris
  • 1,713
  • 2
  • 12
  • 16
89
votes
5 answers

NodeJS: bcrypt vs native crypto

Can someone point out the differences between the two and example situations where use each? bcrypt looks great.
fancy
  • 48,619
  • 62
  • 153
  • 231
82
votes
4 answers

Bcrypt password hashing in Golang (compatible with Node.js)?

I set up a site with Node.js+passport for user authentication. Now I need to migrate to Golang, and need to do authentication with the user passwords saved in db. The Node.js encryption code is: var bcrypt = require('bcrypt'); …
Cid Huang
  • 935
  • 1
  • 7
  • 6
73
votes
2 answers

What are Salt Rounds and how are Salts stored in Bcrypt?

I'm trying to configure Bcrypt for a node app that I'm making and have several questions about salts that I hope someone here can help kindly answer. What is a salt 'round'? For example, in the github docs…
doctopus
  • 5,349
  • 8
  • 53
  • 105
69
votes
6 answers

How to decrypt hash stored by bcrypt

I have this script that encrypts a password but I don't know how to reverse it and decrypt it. This may be a very simple answer but I don't understand how to do it. #!/usr/bin/perl use Crypt::Eksblowfish::Bcrypt; use Crypt::Random; $password =…
BluGeni
  • 3,378
  • 8
  • 36
  • 64
1
2 3
99 100