Okta Bcrypt incident lessons for designing better APIs
1–10 of 169 posts
Re: Okta Bcrypt incident lessons for designing better APIs
#2Re: Okta Bcrypt incident lessons for designing better APIs
#3I've in the past been annoying about saying I think we should just call all password hashes "KDFs", but here's a really good illustration of why I was definitely wrong about that. A KDF is a generally-useful bit of cryptography joinery; a password hash has exactly one job.
Re: Okta Bcrypt incident lessons for designing better APIs
#4The bcrypt implementation in the Zig standard library has both the bcrypt() function (where truncation is explicitly documented) and the bcryptWithoutTruncation() function (which is recommended and automatically pre-hashes long passwords).
It's great to hear that Zig covered both cases. However, I'd still prefer the opposite behavior: a safe (without truncation) default `bcrypt()` and the unsafe function with the explicit name `bcryptWithTruncation()`.
My opinion is based on the assumption that the majority of the users will go with the `bcrypt()` option. Having AI "helpers" might make this statistic even worse.
Do you happen to know Zig team's reasoning behind this design choice? I'm really curious.
Re: Okta Bcrypt incident lessons for designing better APIs
#5Is there a reason I might be missing?
Re: Okta Bcrypt incident lessons for designing better APIs
#6Don't conceive your own cryptographic hacks. Use existing KDF designed by professionals.
Re: Okta Bcrypt incident lessons for designing better APIs
#7Re: Okta Bcrypt incident lessons for designing better APIs
#8I am curious why bcrypt was used for hashing in the first place and not something like sha-512 Is there a reason I might be missing?
Re: Okta Bcrypt incident lessons for designing better APIs
#9I am curious why bcrypt was used for hashing in the first place and not something like sha-512 Is there a reason I might be missing?
> SHA-2 family of hashes was designed to be fast. BCrypt was designed to be slow.
Slow == harder to brute-force == more secure.
Re: Okta Bcrypt incident lessons for designing better APIs
#10The bcrypt implementation in the Zig standard library has both the bcrypt() function (where truncation is explicitly documented) and the bcryptWithoutTruncation() function (which is recommended and automatically pre-hashes long passwords).
Also neither seems to warn about the NUL issue.
[0] I assume for compatibility purpose, but it still seems very dubious.