Skip to main content

Questions tagged [bcrypt]

bcrypt is an intentionally slow hash algorithm specially designed for passwords.

Filter by
Sorted by
Tagged with
10 votes
5 answers
2k views

Best cryptographic algo with asymmetric cost: expensive to sign, cheap to validate

I'm looking to prevent a DDoS attack on a web service, by making the cost of performing an attack prohibitive. Typical users will only need to call out it once a day, and can afford to spend a few CPU ...
scosman's user avatar
  • 203
0 votes
0 answers
48 views

Required Block Size for XTS Using MSFT CNG

I am struggling with using Microsoft's BCrypt library in AES-XTS mode. I've confirmed that the Cipher Block Size is 16 bytes (by getting the BCRYPT_BLOCK_LENGTH property). I'm setting the Data Unit ...
PeterGV's user avatar
1 vote
1 answer
317 views

Safe to use a BCrypt hash directly as a key to HMAC-SHA256?

Is it safe (or optimal) to use a BCrypt hash directly as the key to an HMAC-SHA256? I ask because all the BCrypt hashes I will use contain the same salt, version, and cost, so the first 29 characters ...
Starscream512's user avatar
5 votes
4 answers
688 views

Sending password to server vs. sending SHA

This is an existing website with approx. 100K accounts, and passwords are hashed using bcrypt with a high number of rounds. The current design that I'm questioning is that we're sending the username ...
Per's user avatar
  • 185
1 vote
2 answers
211 views

Debug bcrypt iterations with a static salt [closed]

I want to debug bcrypt rounds with a static salt using this python lib ...
pacman's user avatar
  • 459
0 votes
1 answer
3k views

Using bcrypt to always produce the same hash like SHA, MD

I want to take advantage of the slow property of bcrypt to hash an input but also want to get the same hash value for the same input every time just like SHA, MD, etc. So in order to do that, instead ...
user1589188's user avatar
0 votes
1 answer
361 views

Use peppers with Bcrypt (HMAC + Bcrypt)

Is it useful to combine HMAC with Bcrypt ? If it so, should I do the HMAC on the password before "Bcrypt"ing it ? or should I do the HMAC on the Bcrypt output ?
Mohammed Rady's user avatar
7 votes
3 answers
3k views

Password hash contained '\x00' in middle, resulting in ValueError from bcrypt.hashpw

I have some code that accepts a password in string format, and hash it with SHA3-512 before passing it to bcrypt for hashing. However, by some coincidence, I found a test case that produces a hash ...
Benji Tan's user avatar
  • 173
3 votes
2 answers
413 views

Use slow hashing to reduce digest size?

I have seen this question on MD5 replacement for 128 bit digests. It is said numerous times that having a 128 bit digest is impossible today because finding a collision would only require $2^{64}$ ...
JacopoStanchi's user avatar
0 votes
2 answers
2k views

Match bcrypt hash with plaintext

I have a bcrypt hash: $2b$10$kn7yEh2nYiDqDYNY.hjiZOtASBKT9uO4KozbFWDW2XLYnW58nkpq and a list with given plaintext passwords. How can I get the password from the ...
tanngo's user avatar
  • 17
2 votes
1 answer
323 views

How long would it take to calculate the hash of a password by hand?

Suppose one had no computer (or rainbow tables), but had access a pen and paper as well as all the necessary documentation for modern (best practice, not outdated) hashing algorithms and mathematical ...
stevec's user avatar
  • 123
1 vote
1 answer
176 views

Combining algorithms for password storage?

Is it more secure to combine algorithms for password hashing, for example, Scrypt, Bcrypt, SHA-3, etc.? If an attacker wants to use dedicated hardware, he would need one for each algorithm. However, I ...
moutonlapin28's user avatar
11 votes
1 answer
4k views

Why do I need to store the salt for generated hashes?

I am new to crypto and authentication so have been doing reading around this and thought that I had a pretty good understanding of how this works. However when implementing my hashing using ...
Roaders's user avatar
  • 213
0 votes
1 answer
1k views

migrate bcrypt -> argon2

We want to migrate our userbase from bcrypt to argon2. I was planning on an approach that migrates all hashes immediately to argon2; "old" users would have an argon2'd hash of their bcrypt hash of ...
Joe's user avatar
  • 103
1 vote
1 answer
794 views

enhanced hash password in bcrypt for nuGet library

Why do we use EnhancedHashPassword in nuGet library and chose a SHA algorithm like this? ...
Juliet's user avatar
  • 29
0 votes
1 answer
312 views

Add a pepper to a hash: as a string or a buffer, and should I calculate a hash of a peppered plain text?

I'm using a bcryptjs to generate a computationally slow hash function for storing passwords: ...
Mike's user avatar
  • 145
1 vote
2 answers
463 views

Why authors of bcrypt have chosen blowfish and not some hash function like SHA-1?

I wonder what are the advantages of using bcrypt over an iterated and salted KDF based on some cryptographic hash function like SHA-1 (or SHA-3)? I guess the authors of bcrypt chose Blowfish (a block ...
matlink's user avatar
  • 39
0 votes
0 answers
143 views

Identifying the exact encryption procedure by database hash

I was asked to develop an external user administration for a legacy system so that it could be integrated into company processes. This system is mostly written in Python, but also uses unmanaged DLLs. ...
SiG's user avatar
  • 1
2 votes
3 answers
692 views

"Work factor" and "iteration count" nomenclature in adaptive functions

In adaptive functions like PBKDF2 / bcrypt I often read people refer to "iteration count" and others refer to "work factor", and they seem to be used interchangeably (even though they're not - the ...
lonix's user avatar
  • 147
1 vote
1 answer
1k views

Which is more secure for hashing: SHA512 or BCrypt with the same salt reused over and over?

Setting aside questions of if BCrypt should even be used in this way, I was just wondering which one would be more secure hypothetically. If you want to know why I don't just use random salts as per ...
Adam's user avatar
  • 111
0 votes
1 answer
409 views

Storing passwords in a publicly available database

I have a public database where users need to store configuration files. The file can contain passwords. Everyone can read config files but only the server can read passwords in them. In the browser, ...
user3803241's user avatar
1 vote
0 answers
42 views

reusing blowfish algorithm to implement bcrypt

I'm trying to implement bcrypt and have a really fast Blowfish implementation available to me. It seems to me that the existant Blowfish implementation is not going to be able to be leveraged to ...
neubert's user avatar
  • 2,939
6 votes
1 answer
1k views

Is It Safe to Reuse the Same Salt in Bcrypt Password Hash (Specifically for Chaining Hashes)

As explained in my previous question, I want to develop a scheme which would be able to increase the password hash strength without the user password. According to Thomas Pornin it should be safe to ...
Patrick's user avatar
  • 251
2 votes
1 answer
242 views

Are there any known security issues when doing the following chaining of BCrypt Hashes: 'bcryt(bcrypt(user-pw, work-factor1), work-factor2)'

I am currently developing a protocol which would be able to "upgrade" the strength of a bcrypt password hashes without the knowledge of the user-password so a system may upgrade it without user ...
Patrick's user avatar
  • 251
0 votes
1 answer
354 views

Hashing user password without database to store salt

I am building an Android app that will run purely locally on the user's device, no servers. It has a database that I want to encrypt with the user's password, which requires a 64 byte key. I've ...
jfr3000's user avatar
0 votes
1 answer
585 views

Why does PHP crypt give this unexpected result [closed]

So I have this PHP code,it is meant to encrypt a users password... Three problems/questions: My 'salt' CHANGES ITS NAME I get the same result Is this actually how the result is meant to be? PHP CODE ...
DarkMatter's user avatar
0 votes
1 answer
609 views

Set/change password functionality on password: should I apply bcrypt server- or client-side?

I am writing a webpage on which a user can set (when registering) and change his/her password. This page is only served over HTTPS. When the user is altering his/her password, he/she is already ...
Jessica's user avatar
3 votes
1 answer
627 views

If and why is it bad to scrypt a bcrypted password?

This has been already brought up on security SE, but very sadly, this particular interesting issue got watered down in a far broader question. If and why is it bad to use the following hashing ...
gaazkam's user avatar
  • 159
1 vote
1 answer
1k views

What is best practise for salting and multiple-hashing of passwords?

I have been presented with some custom PHP code for salting passwords and applying multiple rounds of hashing. It looks reasonable, but I fear home-grown crypto. Is there an existing password ...
fadedbee's user avatar
  • 938
1 vote
1 answer
266 views

Practical BCrypt plus XOR encryption for small messages

This is a practical solution available and potentially useful to everyone, so please give some leeway not banning this question. Details are at the end, but here is the question: How secure is the ...
MessageSafe's user avatar
2 votes
1 answer
459 views

Unable to implement Client and Server Side Hashing (Validation problem)

I'm trying to implement hashing on both client and server Sides for my web/mobile Application. On the client side, I implemented the slow hashing algorithm (bcrypt) On the server side, I tried to use ...
Jayendran's user avatar
  • 123
16 votes
4 answers
20k views

Looking at hash output – is Base64 encoding in any way better than HEX encoding?

I was wondering why most "normal/unsafe" crypto hashes like SHA-256, SHA-512, Whirlpool, RipeMD-160, MD5, etc. are HEX encoded. But most "secure" crypto hashes (KDF' ) like ...
Richard R. Matthews's user avatar
4 votes
2 answers
2k views

Can pbkdf2 be used with a fixed salt to give a deterministic slow hash?

I need a password hashing function that is deterministic. Correlation attacks are not a concern. The same password must produce the same hash. I just want to protect the password against dictionary ...
Daffy's user avatar
  • 2,409
1 vote
2 answers
264 views

Can multiple hashing weaken the password?

Problem. I want a longer key out of password than my hashing function provide. Idea. I want to hash password multiple times rotating chars one position each time and use composite key. Question. ...
Evgeny's user avatar
  • 67
4 votes
3 answers
815 views

XOR Encryption with bcrypt password de-biasing

Objective: To have a very simple to verify, but very secure small message encryption. Idea: Message ⊕ bcrypt( Password). We remove password biases with bcrypt ...
Evgeny's user avatar
  • 67
0 votes
1 answer
234 views

Are there any known values for common hashes known to have no preimage

In a system which requires a user to have a password, as a quick workaround I wrote random junk as the bcrypt hash so that no one will be able to login to that user. However theoretically there ...
Meir Maor's user avatar
  • 11.8k
6 votes
1 answer
22k views

Benchmark differences between SHA-512 and bcrypt

So I recently made a benchmark SHA-512 vs bcrypt with hashcat CUDA. Here are the results : ...
Richard R. Matthews's user avatar
1 vote
1 answer
885 views

Question about hashing passwords with PBKDF2

I am new here and new to encrypting and securing passwords, so please forgive me if this question is not posted to the right location or if my question is bad. I have been working on a web app in ...
Perdue's user avatar
  • 111
1 vote
1 answer
307 views

Relation between encryption algorithms and (password) hash functions

This is a really basic question. Blowfish is not seen as a secure cipher. but bcrypt is one of the most secure hash functions. So first: How can a hash function be based on an encryption algorithm, ...
Richard R. Matthews's user avatar
12 votes
1 answer
1k views

Encrypting bcrypt hashes

I've been asked by a client to give some advice on hashing and as it isn't my area I'm looking for someone who knows what they are talking about. The client is hashing 4-6 digit PINs (mostly 4 digit) ...
Robin's user avatar
  • 123
8 votes
2 answers
1k views

What impact could general quantum computing have on BCrypt?

While discussing the 72 character limit of BCrypt, the question of resilience to quantum cryptanalysis came up. A search online didn't give me much of a lead as to what research has been done in this ...
J.A.K.'s user avatar
  • 433
30 votes
3 answers
5k views

Dropbox Password security

Dropbox have recently published How Dropbox securely stores your passwords Is this really more secure than using bcrypt with a complexity of 11 or 12 ? The password "chain" is secure as its weakest ...
exussum's user avatar
  • 403
13 votes
4 answers
11k views

Why bcrypt is one-way while Blowfish is reversible?

While bcrypt is often regarded as an irreversible hashing function, it's based on the reversible Blowfish cipher. I'm just curious about how does this work. Here's ...
sunquan's user avatar
  • 233
2 votes
1 answer
831 views

anything obviously wrong with my custom password hash scheme?

i sha2-256 hash the password, then i base64 encode the hash (per RFC 2045) , resulting in a 44 bytes string looking like LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ=...
hanshenrik's user avatar
-1 votes
1 answer
1k views

20 bytes random string hashed with unsalted bcrypt or scrypt?

I have users for which I use a SHA-1 hash as an API key. These are urandom feed into SHA-1 so you can assume they're fully random. There is no username sent along with the API key. I don't want to ...
David's user avatar
  • 1
2 votes
2 answers
1k views

Using bcrypt for MAC - is it correct and secure?

Suppose there is a hashing function: $$ph = bcrypt(sha256(m + k), salt)$$ Here $ph$ is a password hash obtaining by applying $bcrypt$ on $sha256$ result of concatenating a message $m$ with a secret ...
Alex Sidorov's user avatar
11 votes
1 answer
1k views

Does a big salt have the same memory effects as Bcrypt?

Citing Thomas Pornin on the question Why can't one implement bcrypt in Cuda?: bcrypt is a variant of the Blowfish key scheduling, which is defined over a table (a few kilobytes) which is constantly ...
Luc's user avatar
  • 1,528
2 votes
0 answers
32 views

Some questions about the internals of bcrypt [duplicate]

I'm attempting to get a better understanding of cryptography and have run into some questions about bcrypt. Bcrypt relies on the blowfish cipher, which is a reversible method of encryption. But ...
temporary_user_name's user avatar
11 votes
3 answers
1k views

The internals of bcrypt

I'm attempting to get a better understanding of cryptography and have run into some questions about bcrypt. Bcrypt relies on the blowfish cipher, which is a reversible method of encryption. But ...
temporary_user_name's user avatar
4 votes
1 answer
1k views

Why does 0x00 make bcrypt weaker?

On the following site: https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence when talking about the dangers of using bcrypt it states: There is a nontrivial ...
kojow7's user avatar
  • 143