Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-introduce support for bcrypt #1455

Closed
wohali opened this issue Jul 18, 2018 · 2 comments
Closed

Re-introduce support for bcrypt #1455

wohali opened this issue Jul 18, 2018 · 2 comments
Labels

Comments

@wohali
Copy link
Member

wohali commented Jul 18, 2018

In preparing the 2.2.0 release, it was found that the bcrypt add-on will not compile under Windows. There are at least 2 reasons for this:

  1. Windows does not include the BSD libc extensions, meaning there is no sys/queue.h.
  2. Our Windows build environment, which does not use msys/mingw/etc, does not have a useful pthread library.

In addition, it seems wrong to me that a NIF to just run an encryption routine is launching its own threads. Threading and scheduling of those threads should be left up to the Erlang scheduler. This approach, which was borrowed from esnappy, was appropriate when it was written (R14 era), but with improved (dirty) schedulers in Erlang 17+, it's no longer the best way. Perhaps in removing this code for Windows, we can improve the implementation for other platforms at the same time.

Because of the level of integration of bcrypt, it is not feasible to remove the library on one platform, or at configure time. An attempt to do that by @iilyak was aborted, see #1228.

As such, the bcrypt application is being removed from master.

Expected Behavior

bcrypt functionality should be restored to CouchDB post-2.2.0. That reworked implementation should work under Windows, and should not rely on pthreads.

Current Behavior

Windows build is broken, full stop.

@wohali
Copy link
Member Author

wohali commented Jul 18, 2018

The bcrypt branch has been restored, and has cherry-picked commits on it for all of the merged PRs that improved its test suite.

Feel free to use this for work going forward, or if a rewrite is needed, reimplement from scratch.

@nickva
Copy link
Contributor

nickva commented Nov 13, 2023

PBKDF2 implementation was just improved in #4814

https://csrc.nist.gov/csrc/media/Projects/crypto-publication-review-project/documents/initial-comments/sp800-132-initial-public-comments-2023.pdf indicates Argon2 looks like a favorite of industry reviewers so far instead of brcypt. Since we haven't brought bcrypt back in 5 years, it's probably worth closing the issue.

@nickva nickva closed this as completed Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants