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

1981 questions
1292
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-
  • 97,629
  • 82
  • 259
  • 398
682
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
  • 113,812
  • 91
  • 316
  • 418
343
votes
4 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
  • 51,037
  • 60
  • 165
  • 263
194
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
  • 12,312
  • 12
  • 49
  • 56
190
votes
16 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
  • 12,176
  • 33
  • 111
  • 172
131
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
  • 138,188
  • 158
  • 423
  • 589
116
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,031
  • 2
  • 16
  • 22
104
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,479
  • 2
  • 12
  • 12
97
votes
17 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,280
  • 5
  • 22
  • 34
91
votes
9 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
  • 911
  • 1
  • 6
  • 5
85
votes
3 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,643
  • 2
  • 12
  • 16
69
votes
3 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
  • 41,315
  • 56
  • 147
  • 225
68
votes
3 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
  • 795
  • 1
  • 6
  • 6
57
votes
1 answer

What's the advantage of scrypt over bcrypt?

I'm looking at ways to securely store passwords. Some people claim that scrypt is "better" than bcrypt, and so far I've seen nobody who claims vice versa or that scrypt is insecure, though some call bcrypt "more reputable". What's the advantage of…
Hongli
  • 17,912
  • 14
  • 73
  • 103
56
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
  • 4,073
  • 4
  • 30
  • 65
1
2 3
99 100