I am trying to implement the Argon2 algorithm in an authentication library. I want to provide users with some useful tips for setting options.
While I understand the parameters memory_costand threadsinfluence the algorithm, I can not turn around a parameter time_cost.
time_cost (integer) - the maximum amount of time that may be required to calculate the Argon2 hash. By default, PASSWORD_ARGON2_DEFAULT_TIME_COST.
Poll 1 - the default value is 2. It seems to represent time, unfortunately, the unit seems to be missing. Is it in seconds? Milliseconds?
This SO answer says the default is 2 seconds.
In chapter 3.1 “Input data” there is no mention of time, only the number of iterations.
The number of iterations t(used to set the runtime regardless of memory size) can be any integer from 1 to 2 ^ 32−1;
The temporary value is defined in chapter 9 “Recommended parameters”:
Calculate the maximum amount of xtime (in seconds) that each call can allow.
[...]
y, m h , t. t , x. x t = 1, m .
m, h t.
2 - , PHP x t?
,
[...]
, .
3 - , . . ? time_cost = 2, , 2 ?
, . (1 ):
m_cost (MB) | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256
=====================================================
t_cost=1 | 1 | 2 | 5 | 10 | 24 | 46 | 90 | 188 | 348
t_cost=2 | 2 | 4 | 8 | 18 | 39 | 75 | 145 | 295 | 636
t_cost=3 | 3 | 6 | 12 | 26 | 53 | 102 | 209 | 473 | 926
t_cost=4 | 5 | 9 | 30 | 56 | 78 | 147 | 309 | 567 |1233
t_cost=5 | 4 | 9 | 19 | 40 | 79 | 165 | 359 | 690 |1372
t_cost=6 | 5 | 12 | 23 | 49 | 93 | 198 | 399 | 781 |1777
t_cost=7 | 6 | 14 | 29 | 53 | 118 | 259 | 508 |1036 |2206
t_cost=8 | 8 | 16 | 33 | 82 | 179 | 294 | 528 |1185 |2344
, time_cost .
( , ), . , t_cost=8 m_cost=16MB , 200 . , 8 ? !
, , , .
. , .
!