Skip to content

Commit

Permalink
Modules update
Browse files Browse the repository at this point in the history
  • Loading branch information
pepa65 committed Nov 6, 2024
1 parent 4ebaf8c commit 2d29fd8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="https://raw.githubusercontent.com/pepa65/twofat/master/twofat.png" width="96" alt="twofat icon" align="right">

## Manage TOTPs from CLI
* **v2.0.5**
* **v2.0.6**
* Repo: [github.com/pepa65/twofat](https://github.com/pepa65/twofat)
* After: [github.com/slandx/tfat](https://github.com/slandx/tfat)
* Contact: github.com/pepa65
Expand Down Expand Up @@ -55,7 +55,7 @@ CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o twofat.exe

## Usage
```
twofat v2.0.5 - Manage TOTPs from CLI
twofat v2.0.6 - Manage TOTPs from CLI
The CLI is interactive & colorful, output to Stderr. Password can be piped in.
When output is redirected, only pertinent plain text is sent to Stdout.
* Repo: github.com/pepa65/twofat <pepa65@passchier.net>
Expand Down Expand Up @@ -90,17 +90,20 @@ help | --help | -h Show this help text.
```

### Import/Export data
`twofat` abides by the backup standard from: https://authenticator.cc/docs/en/otp-backup-developer
Each exported line has a OTPAUTH_URI of the form:
`otpauth://totp/NAME?secret=SECRET&algorithm=HASH&digits=LENGTH&period=30&issuer=NAME`
(the capitalized parts are variable parameters: `NAME`, `SECRET`, `LENGTH`, `HASH`).
`twofat` abides by the backup standard from:
https://www.ietf.org/archive/id/draft-linuxgemini-otpauth-uri-01.html

Each exported line has a otpauth URI of the form:
`otpauth://totp/NAME?secret=SECRET&algorithm=HASH&digits=LENGTH&period=PERIOD&issuer=NAME`
(the capitalized parts are variable parameters: `NAME`, `SECRET`, `HASH`, `LENGTH`, `PERIOD`).

* The `NAME` should not have a colon `:` or `%` (messes with URI conversion).
(`NAME` could be `ISSUER:ACCOUNTNAME`, but `twofat` uses the full `NAME` for the `issuer` parameter.)
* The `SECRET` is the base32 RFC3548 seed (without the `=` padding!) for the OTPs.
* The parameter `period` is fixed to `30` (the default) in (almost?) all apps.
* The `LENGTH` for `digits` is most often `6`, but can be set to `5` (for Steam), `7` (Twitch) or `8` (Microsoft).
* `NAME` and `SECRET` are mandatory.
* The `HASH` for `algorithm` is `SHA1` (the default), `SHA256` or `SHA512`.
* The `issuer` is set to `NAME` on export in `twofat`, ignored on import.
* The `LENGTH` for `digits` is most often `6`, but can be set to `5` (for Steam), `7` (Twitch) or `8` (Microsoft).
* The `PERIOD` for `period` is fixed to `30` (the default) in (almost?) all apps.
* On import, `digits`, `period` and `algorithm` will be set to the defaults when not specified.
* The `issuer` is set to `NAME` on export from `twofat`, and is ignored on import.

8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/pepa65/twofat

go 1.22.1
go 1.23.0

require (
github.com/atotto/clipboard v0.1.4
golang.org/x/crypto v0.22.0
golang.org/x/term v0.20.0
golang.org/x/crypto v0.28.0
golang.org/x/term v0.25.0
)

require golang.org/x/sys v0.20.0 // indirect
require golang.org/x/sys v0.26.0 // indirect
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
)

const (
version = "2.0.5"
version = "2.0.6"
maxNameLen = 20
period = 30
)
Expand Down

0 comments on commit 2d29fd8

Please sign in to comment.