Blob


1 .\" Copyright (c) 2022 Omar Polo <op@omarpolo.com>
2 .\"
3 .\" Permission to use, copy, modify, and distribute this software for any
4 .\" purpose with or without fee is hereby granted, provided that the above
5 .\" copyright notice and this permission notice appear in all copies.
6 .\"
7 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 .Dd October 20, 2022
15 .Dt TOTP 1
16 .Os
17 .Sh NAME
18 .Nm totp
19 .Nd time-based one time password generator
20 .Sh SYNOPSIS
21 .Nm
22 .No < Ns Ar secret
23 .Sh DESCRIPTION
24 .Nm
25 is a time-based one time password generator
26 .Pq TOTP .
27 It reads a secret from standard input and prints the generated password,
28 a numeric code, to standard output.
29 The secret is usually provided by the authenticator
30 .Pq for e.g.\& a website .
31 Blanks in the secret string are ignored, but only one line is read.
32 .Pp
33 .Nm
34 uses a period of 30 seconds and generates six digits long codes.
35 .Sh EXIT STATUS
36 .Ex -std
37 .Sh EXAMPLES
38 .Nm
39 is meant to be used with
40 .Xr plass 1
41 or similar application: the secret is stored safely in the password
42 store and then given to
43 .Nm
44 using a pipe:
45 .Bd -literal -offset indent
46 $ plass cat 2fa/codeberg/op | totp
47 722524
48 .Ed
49 .Sh SEE ALSO
50 .Xr plass 1
51 .Sh STANDARDS
52 .Nm
53 follows the algorithm outlined in RFC 6238
54 .Dq TOTP: Time-Based One-Time Password Algorithm
55 and uses the base32 encoding as defined in RFC 3548
56 .Dq The Base16, Base32, and Base64 Data Encodings .
57 .Sh AUTHORS
58 .An -nosplit
59 The
60 .Nm
61 utility was written by
62 .An Omar Polo Aq Mt op@omarpolo.com .