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 January 23, 2023
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 and is either a base32-encoded string or a
32 .Sq otpauth://
33 URL.
34 Blanks in the secret string are ignored, but only one line is read.
35 .Pp
36 .Nm
37 uses a period of 30 seconds and generates six digits long codes.
38 .Sh EXIT STATUS
39 .Ex -std
40 .Sh EXAMPLES
41 .Nm
42 is meant to be used with
43 .Xr plass 1
44 or similar application: the secret is stored safely in the password
45 store and then given to
46 .Nm
47 using a pipe:
48 .Bd -literal -offset indent
49 $ plass cat 2fa/codeberg/op | totp
50 722524
51 .Ed
52 .Sh SEE ALSO
53 .Xr plass 1
54 .Sh STANDARDS
55 .Nm
56 follows the algorithm outlined in RFC 6238
57 .Dq TOTP: Time-Based One-Time Password Algorithm
58 and uses the base32 encoding as defined in RFC 3548
59 .Dq The Base16, Base32, and Base64 Data Encodings .
60 .Sh AUTHORS
61 .An -nosplit
62 The
63 .Nm
64 utility was written by
65 .An Omar Polo Aq Mt op@omarpolo.com .