TOTP period is 30 seconds
Google Authenticator uses a period of 30 seconds instead of 60.
This commit is contained in:
parent
44137312bc
commit
3a041ad6d4
@ -100,7 +100,7 @@ get_pixels0(<<>>, Acc) ->
|
|||||||
%%
|
%%
|
||||||
totp() ->
|
totp() ->
|
||||||
Key = crypto:sha(<<"password">>),
|
Key = crypto:sha(<<"password">>),
|
||||||
totp(Key, 60).
|
totp(Key, 30).
|
||||||
totp(Key, Period) ->
|
totp(Key, Period) ->
|
||||||
T = unow() div Period,
|
T = unow() div Period,
|
||||||
{hotp(Key, T - 1), hotp(Key, T), hotp(Key, T + 1)}.
|
{hotp(Key, T - 1), hotp(Key, T), hotp(Key, T + 1)}.
|
||||||
|
Loading…
Reference in New Issue
Block a user