Skip to content

Use crypto:strong_rand_bytes/1 instead of crypto:rand_bytes/1#19

Open
benjamin-bergia wants to merge 1 commit intosmarkets:masterfrom
benjamin-bergia:master
Open

Use crypto:strong_rand_bytes/1 instead of crypto:rand_bytes/1#19
benjamin-bergia wants to merge 1 commit intosmarkets:masterfrom
benjamin-bergia:master

Conversation

@benjamin-bergia
Copy link
Copy Markdown

crypto:rand_bytes/1 has been deprecated in newer versions of erlang. This PR replace the calls to crypto:rand_bytes/1 with crypto:strong_rand_bytes/1.

This will probably break the compatibility with older versions of Erlang. If needed I can update this PR to favor crypto:strong_rand_bytes/1 and, if not available, fallback on crypto:rand_bytes/1.

Also from the doc, crypto:strong_rand_bytes/1 can throw a low_entropy exception. I have far from an expert in this field, so if you have any comment or recommendation, please let me know.

@lafka
Copy link
Copy Markdown

lafka commented Apr 27, 2017

I have a patch which checks for erlang version at https://github.com/lafka/erlang-bcrypt/tree/lafka-erlang19-rand-bytes if interesting

@ddeboer
Copy link
Copy Markdown

ddeboer commented Jun 28, 2017

Merged into https://github.com/erlangpack/bcrypt and published to Hex.pm as bcrypt 1.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants