h1. twofa

p. A terrible, should-not-be-used, wrote-it-for-fun-and-learning 2fa authenticator.

h2. Requirements

p. twofa requires the _base32_ and _optimist_ gems.

h3. Clipboard

p. For clipboard tasks, twofa requires the _clipboard_ gem, and either the _xclip_ or _xsel_ application.

h2. Usage

bc.. $ twofa -h
twofa is a command line OTP code generator.

Usage:
  twofa [opts] ISSUER

where [opts] are:
  -n, --no-clip           Do not copy code to the clipboard
  -t, --twofa-file=<s>    Location of the twofa secrets file (default: /home/nl987/.twofa)
  -v, --version           Print version and exit
  -h, --help              Show this message

h3. twofa secrets file

p. The twofa secrets file is normally found at @~./twofa@, and each record has the following fields. If any of the optional fields are given, all preceeding optional fields must also be given.

p. If a HOTP code is requested, the file will be canoncalised.

h4. Required fields

- Method := The OTP type, currently @totp@ or @hotp@
- Issuer := Human name for this issuer
- Secret := The BASE32 shared secret

h4. Optional fields

- Time interval or Counter := Either the time interval (for TOTP) or counter (for HOTP). The former defaults to 30 if not given, the latter to 0.
- Length := The output code length. Defaults to 6 digits.
- Hashing algorithm := The algorithm used to generate the HMAS hash. Defaults to @sha1@.
