Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Use crypto:strong_rand_bytes/1 instead of crypto:rand_bytes/1
  • Loading branch information
Benjamin Bergia authored and ddeboer committed Jun 28, 2017
1 parent 1b0ddea commit e9d041cbc7e9af2f18b40e8e0746cd0004b439e5
Showing 2 changed files with 3 additions and 3 deletions.
@@ -54,7 +54,7 @@ init() ->
%%--------------------------------------------------------------------
gen_salt(LogRounds)
when is_integer(LogRounds), LogRounds < 32, LogRounds > 3 ->
R = crypto:rand_bytes(16),
R = crypto:strong_rand_bytes(16),
encode_salt(R, LogRounds).

encode_salt(_R, _LogRounds) ->
@@ -39,11 +39,11 @@ start_link() ->
stop() -> gen_server:call(?MODULE, stop).

gen_salt(Pid) ->
R = crypto:rand_bytes(16),
R = crypto:strong_rand_bytes(16),
gen_server:call(Pid, {encode_salt, R}, infinity).

gen_salt(Pid, LogRounds) ->
R = crypto:rand_bytes(16),
R = crypto:strong_rand_bytes(16),
gen_server:call(Pid, {encode_salt, R, LogRounds}, infinity).

hashpw(Pid, Password, Salt) ->

0 comments on commit e9d041c

Please sign in to comment.