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= 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. p. Each issuer should appear on it's own line with the following format: bc. [*]Method Issuer Secret [TDC [Length [Hash]]] h4. Required fields - Method := The OTP type, currently @totp@ or @hotp@. Optionally, prefixing the method with an asterisk specifies this is the default issuer to be used if one is not specified on the command line. - Issuer := Human name to identify this issuer. - Secret := The BASE32 shared secret. h4. Optional fields - TDC := Either the time delta (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. - Hash := The algorithm used to generate the HMAC hash. Defaults to @sha1@.