README
¶
lfa
lfa generates a 2fa code from a secret key.
Install
go install github.com/nishanths/lfa@latest
Differences from github.com/rsc/2fa
You must manually provide the secret key each time to generate a 2fa code with
the lfa program. Unlike the github.com/rsc/2fa
program, the lfa program does
not save your secret key.
The lfa program only supports time-based (TOTP) authentication codes.
Usage
usage: lfa [-7] [-8] [-c]
Example:
% lfa
enter 2fa key: nzxxiidbebvwk6jb
852415
%
In this example, the input text nzxxiidbebvwk6jb
is a 2fa secret key.
On many apps, during 2fa setup, the secret key can be viewed by selecting an option like "Can't scan QR code?" or "Enter this text code instead." Save the secret key securely in your own password manager. Provide the secret key to lfa when you need a code.
By default lfa generates a 6-digit 2fa code. Use the -7
flag or the -8
flag
to generate a 7-digit or 8-digit 2fa code, respectively. Specify the -c
flag
to copy the code to the clipboard in addition to printing it.
The time-based authentication codes are derived from a hash of the key and the current time, so it is important that the system clock have at least one-minute accuracy.
License
See LICENSE
file.
Some code is adapted from github.com/rsc/2fa; see license information in the Go source files.