frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Why Bcrypt Can Be Unsafe for Password Hashing?

https://blog.enamya.me/posts/bcrypt-limitation
13•enamya•1w ago

Comments

byhemechi•2h ago
Does this really need yet another blog post? 72 characters is more than enough to be resistant to brute-force attacks, as demonstrated by thousands of data breaches containing bcrypt hashes that remain uncracked (excluding the obvious top 1k passwords/ credential stuffing). In my personal opinion calling it "unsafe" is just fear mongering, especially in conjunction with a recommendation of using Argon2 which is comparatively very new and is probably safe - but once again, does not have the proven record that bcrypt does.
mikehall314•2h ago
I agree 72 characters is plenty for most circumstances. However, as the blog points out, this is a byte limit not a character limit.

Some of the family emoji can be > 20 bytes. Some of the profession emoji can be > 17 bytes. If people are using emoji in their passwords, we could quite quickly run out of bytes.

I think it’s a limitation worth being aware of, even if “unsafe” is perhaps overstating it.

testdelacc1•2h ago
Does anyone actually use emoji as a password.
flysand7•2h ago
yea, me (pls dont crack)
3eb7988a1663•1h ago
You could ask for your password to be removed from the list: https://github.com/danielmiessler/SecLists/pull/155
embedding-shape•1h ago
I never actually considered it until I read parent, and now I'm gonna try to start using it wherever it's supported, it's genius to use it for passwords as long as it's supported by the platform. Edit: Just to clarify, together with a password manager of course, otherwise I'd never have the patience for it.
byhemechi•2h ago
I still don't see how that's an issue, yes a password using a series of ridiculously complicated family emoji will be truncated but the actual bytes still provide entropy, just because the data doesn't use pixels when rendered doesn't mean it doesn't increase the search space
anonym29•49m ago
If your password is comprised of three emojis that each take up 24 bytes, then yes, a 72 byte truncation dramatically reduces the search space for a brute force against these hypothetical 24-byte-emoji-only passwords.

There are far fewer possible combinations of any three emojis than there are any 72 ASCII characters.

This is x^3 vs y^72, where X is the total number of distinct emojs and Y is the total number of distinct ASCII characters.

24 bytes of data is not 24 bytes of entropy if there are only a couple thousand different possible inputs to produce all of the possible 24 byte sequences produced by those inputs.

For simplicity: picture having only two possible input buttons. Each one produces 1000 bytes of random-looking data, but each one always produces the exact same 1000-byte sequence, respectively. You have a maximum password of 1 button press. The "password" may contain 1000 bytes, but you only have one bit of entropy, because the attacker doesn't need to correctly guess all 1000 bytes, they only need to correctly guess which of the two buttons you pressed.

cwbriscoe•2h ago
You could always pre-hash the password with sha256 or something similar to guarantee you won't go over the 72 byte limit.
stavros•2h ago
I don't understand why this isn't a mandatory first step in the bcrypt algorithm itself. Who thought that a 72 byte limit was a good idea?
zetanor•1h ago
The hash is 24 bytes. Even without an input character limit, you're likely to find tons of valid aliases for your 1000-character password within the 72-byte password space.
enamya•1h ago
Well, if you limit the discussion to passwords, you're right, maybe no need to worry especially if using randomly generated ones (like ones from password managers), but if the algorithm is used to check some "composed" credentials (like what happened with Okta last year) then maybe it's worth worrying about, no ?
K0IN•1h ago
I don't find this too concerning but libraries should document this and maybe even raise exceptions on data longer than 72 bytes, failing silently is the worst behaviour.
basilikum•1h ago
bcrypt is from 1999.

It's really sad that the state of the art from 25 years ago is still ahead of common practice today and you can be lucky to find it in systems today. Most systems still use general purpose cryptography hash functions for password storage. Those are explicitly designed with designed goals that go exactly contrary to the goals of password storage. For general purpose cryptographic hash functions being fast and very low in resource consumption and requirements is a feature. That is the exact opposite of what you want for password hashing. You want something that is much slower to have a higher work factor for an attacker and requires a significant amount of memory with pseudo random access for computation so you cannot easily implement it cheaply in hardware and cannot trivially parallelize many operations on the same piece of hardware.

PBKDF2 wich simply runs the same general purpose hash function for multiple rounds on the salted password only helps with the work factor but fails in everything else. Yet it's considered an acceptable password hashing function and probably even above average security.

We should be well beyond the usage of password for authentication and only using public key based systems for remote authentication. Instead we're using an extremely poor authentication mechanism for humans – one which is a security anti feature and the root of a huge portion of all successful attacks – and we're not even at the point of securing its secrets with long outdated security from the last millennium.

Please just use argon2 or yescrypt or scrypt. They are actually made for password hashing and use modern cryptography not from the year when Matrix was released.

TZubiri•1h ago
Alternate title:

"Why Python's bcrypt implementation is unsafe for Password Hashing"

enamya•1h ago
*used to be unsafe just to note, other implementations have the same design (silent and truncate), I've recently found out that htpasswd from Apache HTTP server has the same silent behavior

Open-source Zig book

https://www.zigbook.net
318•rudedogg•5h ago•105 comments

Britney Spears' Guide to Semiconductor Physics

https://britneyspears.ac/lasers.htm
74•lachlan_gray•1h ago•26 comments

Browser fingerprinting via favicon

https://github.com/jonasstrehle/supercookie
185•vxvrs•5h ago•42 comments

Heretic: Automatic censorship removal for language models

https://github.com/p-e-w/heretic
384•melded•9h ago•151 comments

What if you don't need MCP at all?

https://mariozechner.at/posts/2025-11-02-what-if-you-dont-need-mcp/
118•jdkee•6h ago•67 comments

Dark Pattern Games

https://www.darkpattern.games
94•robotnikman•5h ago•48 comments

PicoIDE – An open IDE/ATAPI drive emulator

https://picoide.com/
10•st_goliath•1h ago•0 comments

The Pragmatic Programmer: 20th Anniversary Edition (2023)

https://www.ahalbert.com/technology/2023/12/19/the_pragmatic_programmer.html
62•ahalbert2•4h ago•8 comments

How Your Brain Creates 'Aha' Moments and Why They Stick

https://www.quantamagazine.org/how-your-brain-creates-aha-moments-and-why-they-stick-20251105/
21•wjb3•3h ago•0 comments

Z3 API in Python: From Sudoku to N-Queens in Under 20 Lines

https://ericpony.github.io/z3py-tutorial/guide-examples.htm
79•amit-bansil•6h ago•3 comments

Goldman Sachs asks in biotech Report: Is curing patients a sustainable business?

https://www.cnbc.com/2018/04/11/goldman-asks-is-curing-patients-a-sustainable-business-model.html
93•randycupertino•1h ago•47 comments

I finally understand Cloudflare Zero Trust tunnels

https://david.coffee/cloudflare-zero-trust-tunnels
103•eustoria•7h ago•35 comments

Why your mock breaks later

https://nedbatchelder.com/blog/202511/why_your_mock_breaks_later.html
16•ingve•2h ago•6 comments

The fate of "small" open source

https://nolanlawson.com/2025/11/16/the-fate-of-small-open-source/
135•todsacerdoti•5h ago•92 comments

FPGA Based IBM-PC-XT

https://bit-hack.net/2025/11/10/fpga-based-ibm-pc-xt/
133•andsoitis•9h ago•27 comments

I have recordings proving Coinbase knew about breach months before disclosure

https://jonathanclark.com/posts/coinbase-breach-timeline.html
300•jclarkcom•4h ago•104 comments

A File Format Uncracked for 20 Years

https://landaire.net/a-file-format-uncracked-for-20-years/
13•todsacerdoti•1w ago•2 comments

Shell Grotto, Margate

https://en.wikipedia.org/wiki/Shell_Grotto,_Margate
33•Michelangelo11•1w ago•4 comments

Fourier Transforms

https://www.continuummechanics.org/fourierxforms.html
95•o4c•1w ago•13 comments

Linux mode setting, from the comfort of OCaml

https://roscidus.com/blog/blog/2025/11/16/libdrm-ocaml/
39•ibobev•5h ago•4 comments

Brimstone: ES2025 JavaScript engine written in Rust

https://github.com/Hans-Halverson/brimstone
184•ivankra•13h ago•92 comments

Decoding Leibniz Notation (2024)

https://www.spakhm.com/leibniz
31•coffeemug•6h ago•5 comments

Show HN: Spam classifier in Go using Naive Bayes

https://github.com/igomez10/nspammer
13•igomeza•1w ago•1 comments

Lithium vs. Lettuce

https://ambrook.com/offrange/photo-essay/lithium-v-lettuce
25•mfburnett•1d ago•3 comments

Anthropic’s paper smells like bullshit

https://djnn.sh/posts/anthropic-s-paper-smells-like-bullshit/
833•vxvxvx•13h ago•259 comments

Garbage collection is useful

https://dubroy.com/blog/garbage-collection-is-useful/
111•surprisetalk•11h ago•36 comments

Waiting for SQL:202y: Group by All

http://peter.eisentraut.org/blog/2025/11/11/waiting-for-sql-202y-group-by-all
41•ingve•5d ago•17 comments

De Bruijn Numerals

https://text.marvinborner.de/2023-08-22-22.html
63•marvinborner•9h ago•7 comments

Measuring the doppler shift of WWVB during a flight

https://greatscottgadgets.com/2025/10-31-receiving-wwvb-with-hackrf-pro/
118•Jyaif•1w ago•2 comments

The Man Who Keeps Predicting the Web's Death

https://tedium.co/2025/10/25/web-dead-predictions-george-colony/
40•thm•7h ago•25 comments