TOTP period is 30 seconds

Google Authenticator uses a period of 30 seconds instead of 60.
This commit is contained in:
Dominique Boucher 2015-06-02 21:28:15 -04:00
parent 44137312bc
commit 3a041ad6d4

View File

@ -100,7 +100,7 @@ get_pixels0(<<>>, Acc) ->
%%
totp() ->
Key = crypto:sha(<<"password">>),
totp(Key, 60).
totp(Key, 30).
totp(Key, Period) ->
T = unow() div Period,
{hotp(Key, T - 1), hotp(Key, T), hotp(Key, T + 1)}.