<s>
Time-based	B-Algorithm
one-time	I-Algorithm
password	I-Algorithm
(	O
TOTP	B-Algorithm
)	O
is	O
a	O
computer	O
algorithm	O
that	O
generates	O
a	O
one-time	O
password	O
(	O
OTP	O
)	O
that	O
uses	O
the	O
current	O
time	O
as	O
a	O
source	O
of	O
uniqueness	O
.	O
</s>
<s>
As	O
an	O
extension	O
of	O
the	O
HMAC-based	B-Algorithm
one-time	I-Algorithm
password	I-Algorithm
algorithm	I-Algorithm
(	O
HOTP	B-Algorithm
)	O
,	O
it	O
has	O
been	O
adopted	O
as	O
Internet	O
Engineering	O
Task	O
Force	O
(	O
IETF	O
)	O
standard	O
.	O
</s>
<s>
TOTP	B-Algorithm
is	O
the	O
cornerstone	O
of	O
Initiative	B-General_Concept
for	I-General_Concept
Open	I-General_Concept
Authentication	I-General_Concept
(	O
OATH	O
)	O
,	O
and	O
is	O
used	O
in	O
a	O
number	O
of	O
two-factor	O
authentication	O
(	O
2FA	O
)	O
systems	O
.	O
</s>
<s>
Through	O
the	O
collaboration	O
of	O
several	O
OATH	O
members	O
,	O
a	O
TOTP	B-Algorithm
draft	O
was	O
developed	O
in	O
order	O
to	O
create	O
an	O
industry-backed	O
standard	O
.	O
</s>
<s>
It	O
complements	O
the	O
event-based	O
one-time	O
standard	O
HOTP	B-Algorithm
,	O
and	O
it	O
offers	O
end	O
user	O
organizations	O
and	O
enterprises	O
more	O
choice	O
in	O
selecting	O
technologies	O
that	O
best	O
fit	O
their	O
application	O
requirements	O
and	O
security	O
guidelines	O
.	O
</s>
<s>
In	O
May	O
2011	O
,	O
TOTP	B-Algorithm
officially	O
became	O
RFC	B-Algorithm
6238	I-Algorithm
.	O
</s>
<s>
To	O
establish	O
TOTP	B-Algorithm
authentication	O
,	O
the	O
authenticatee	O
and	O
authenticator	O
must	O
pre-establish	O
both	O
the	O
HOTP	B-Algorithm
parameters	O
and	O
the	O
following	O
TOTP	B-Algorithm
parameters	O
:	O
</s>
<s>
T	O
,	O
the	O
Unix	B-Operating_System
time	I-Operating_System
from	O
which	O
to	O
start	O
counting	O
time	O
steps	O
(	O
default	O
is	O
0	O
)	O
,	O
</s>
<s>
Both	O
the	O
authenticator	O
and	O
the	O
authenticatee	O
compute	O
the	O
TOTP	B-Algorithm
value	O
,	O
then	O
the	O
authenticator	O
checks	O
whether	O
the	O
TOTP	B-Algorithm
value	O
supplied	O
by	O
the	O
authenticatee	O
matches	O
the	O
locally	O
generated	O
TOTP	B-Algorithm
value	O
.	O
</s>
<s>
TOTP	B-Algorithm
uses	O
the	O
HOTP	B-Algorithm
algorithm	O
,	O
replacing	O
the	O
counter	O
with	O
a	O
non-decreasing	O
value	O
based	O
on	O
the	O
current	O
time	O
:	O
</s>
<s>
TOTP	B-Algorithm
value(K )	O
=	O
HOTP	B-Algorithm
value(K, C )	O
,	O
</s>
<s>
T	O
is	O
the	O
current	O
time	O
in	O
seconds	O
since	O
a	O
particular	O
epoch	B-Device
,	O
</s>
<s>
T	O
is	O
the	O
epoch	B-Device
as	O
specified	O
in	O
seconds	O
since	O
the	O
Unix	B-Operating_System
epoch	I-Operating_System
(	O
e.g.	O
</s>
<s>
if	O
using	O
Unix	B-Operating_System
time	I-Operating_System
,	O
then	O
T	O
is	O
0	O
)	O
,	O
</s>
<s>
Unix	B-Operating_System
time	I-Operating_System
is	O
not	O
strictly	O
increasing	O
.	O
</s>
<s>
When	O
a	O
leap	O
second	O
is	O
inserted	O
into	O
UTC	O
,	O
Unix	B-Operating_System
time	I-Operating_System
repeats	O
one	O
second	O
.	O
</s>
<s>
But	O
a	O
single	O
leap	O
second	O
does	O
not	O
cause	O
the	O
integer	O
part	O
of	O
Unix	B-Operating_System
time	I-Operating_System
to	O
decrease	O
,	O
and	O
C	O
is	O
non-decreasing	O
as	O
well	O
so	O
long	O
as	O
T	O
is	O
a	O
multiple	O
of	O
one	O
second	O
.	O
</s>
<s>
Unlike	O
passwords	O
,	O
TOTP	B-Algorithm
codes	O
are	O
single-use	O
,	O
so	O
a	O
compromised	O
credential	O
is	O
only	O
valid	O
for	O
a	O
limited	O
time	O
.	O
</s>
<s>
However	O
,	O
users	O
must	O
enter	O
TOTP	B-Algorithm
codes	O
into	O
an	O
authentication	O
page	O
,	O
which	O
creates	O
the	O
potential	O
for	O
phishing	O
attacks	O
.	O
</s>
<s>
Due	O
to	O
the	O
short	O
window	O
in	O
which	O
TOTP	B-Algorithm
codes	O
are	O
valid	O
,	O
attackers	O
must	O
proxy	O
the	O
credentials	O
in	O
real	O
time	O
.	O
</s>
<s>
TOTP	B-Algorithm
credentials	O
are	O
also	O
based	O
on	O
a	O
shared	O
secret	O
known	O
to	O
both	O
the	O
client	O
and	O
the	O
server	O
,	O
creating	O
multiple	O
locations	O
from	O
which	O
a	O
secret	O
can	O
be	O
stolen	O
.	O
</s>
<s>
An	O
attacker	O
with	O
access	O
to	O
this	O
shared	O
secret	O
could	O
generate	O
new	O
,	O
valid	O
TOTP	B-Algorithm
codes	O
at	O
will	O
.	O
</s>
