Blame


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