News for hackers. Stuff that matters.
Re:Okta Bcrypt incident lessons for designing better APIs by masklinn on Wednesday February 05, 2025 @04:58PM (#42955852)
Note that the "safe" version makes very bespoke choices: it prehashes only overlong password, and does so with hmac-sha512 (which it b64-encodes). So it would very much be incompatible with other bcrypt implementations when outside of the "correct space".

These choices are documented in the function's docstring, but not obvious, nor do they seem encoded in a custom version.

Re:Okta Bcrypt incident lessons for designing better APIs by jszymborski on Wednesday February 05, 2025 @06:12PM (#42956706)
Sounds like it would then make sense to hide crypto primitives and their footguns under a "hazmat" or "danger" namespace, sorta like webcrypto or libsodium.

So something like crypto.danger.bcrypt and crypto.bcryptWithTruncation