• Stars
    star
    2
  • Language
    Go
  • License
    GNU General Publi...
  • Created about 3 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[mirror] Command line interface for Time-based One Time Password (TOTP)

gotp

A command line interface to manage and generate Time-based One Time Password (TOTP).

SYNOPSIS

gotp <command> <parameters...>

COMMANDS

This section describe available command and its usage.

add <LABEL> <HASH>:<BASE32-SECRET>[:DIGITS][:TIME-STEP][:ISSUER]

Add a TOTP secret identified by unique LABEL. HASH is one of the valid hash function: SHA1, SHA256, or SHA512. BASE32-SECRET is the secret to generate one-time password encoded in base32. The DIGITS field is optional, define the number digits generated for password, default to 6. The TIME-STEP field is optional, its define the interval in seconds, default to 30 seconds. The ISSUER field is also optional, its define the name of provider that generate the secret.

gen <LABEL> [N]

Generate N number passwords using the secret identified by LABEL.

get <LABEL>

Get and print the issuer by its LABEL. This will print the issuer secret, unencrypted.

import <PROVIDER> <FILE>

Import the TOTP configuration from other provider. Currently, the only supported PROVIDER is Aegis and the supported file is .txt.

list

List all labels stored in the configuration.

remove <LABEL>

Remove LABEL from configuration.

remove-private-key

Decrypt the issuer's value (hash:secret...) using current private key and store it back to file as plain text. The current private key will be removed from gotp directory.

rename <LABEL> <NEW-LABEL>

Rename a LABEL into NEW-LABEL.

set-private-key <PRIVATE-KEY-FILE>

Encrypt the issuer's value (hash:secret...) in the file using private key. The supported private key is RSA. Once completed, the PRIVATE-KEY-FILE will be copied to default user's gotp directory, "$XDG_CONFIG_DIR/gotp/gotp.key".

ENCRYPTION

On the first run, the gotp command check for private key in the user's configuration direction (see the private key location in FILES section).

The private key must be RSA based.

If the private key exist, all the OTP values (excluding the label) will be stored as encrypted.

If the private key is not exist, the OTP configuration will be stored as plain text.

FILES

$XDG_CONFIG_DIR/gotp:: Path to user's gotp directory.

$XDG_CONFIG_DIR/gotp/gotp.conf:: File where the configuration and secret are stored.

$XDG_CONFIG_DIR/gotp/gotp.key:: Private key file to encrypt and decrypt the issuer.

For Darwin/macOS the "$XDG_CONFIG_DIR" is equal to "$HOME/Library", for Windows its equal to "%AppData%".

EXAMPLES

This section show examples on how to use gotp cli.

Add "my-totp" to configuration using SHA1 as hash function, "GEZDGNBVGY3TQOJQ" as the secret, with 6 digits passwords, and 30 seconds as time step.

$ gotp add my-totp SHA1:GEZDGNBVGY3TQOJQ:6:30

Generate 3 recent passwords from "my-totp",

$ gotp gen my-totp 3
gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf
847945
326823
767317

Import the exported Aegis TOTP from file,

$ gotp import aegis aegis-export-uri.txt
gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf
OK

List all labels stored in the configuration,

$ gotp list
gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf
my-totp

Remove a label "my-totp",

$ gotp remove my-totp
gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf
OK

Rename a label "my-totp" to "my-otp",

$ gotp rename my-totp my-otp
gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf
OK

More Repositories

1

go-bindata

A small utility which generates Go code from any file. Useful for embedding binary data in a Go program.
Go
186
star
2

pakakeh.go

[mirror] A collection of libraries and tools written in Go.
Go
49
star
3

rescached-go

Resolver (DNS) cache daemon.
Go
32
star
4

hunspell-id

Indonesia hunspell dictionary. Kamus Bahasa Indonesia untuk program hunspell.
Makefile
32
star
5

dsv

The Go library for working with delimited separated value (DSV).
Go
28
star
6

haminer

[mirror] Library and program to parse and forward HAProxy HTTP logs
Go
22
star
7

j2p

A tool to help migrating from JIRA to Phabricator
Go
13
star
8

tabula

A Go library for working with rows, columns, or matrix (deprecated, see https://github.com/shuLhan/share/tree/master/lib/tabula).
Go
11
star
9

go-mining

Data mining with Go.
Go
10
star
10

ciigo

[mirror] Go static website generator with asciidoc markup language
Go
10
star
11

asciidoctor-go

[mirror] Native Go module for parsing and converting asciidoc markup language.
Go
9
star
12

rescached

Resolver cache daemon (deprecated). See https://github.com/shuLhan/rescached-go for new implementation.
C++
8
star
13

beku

Go simple package manager with GOPATH or vendor
Go
8
star
14

mattermost-integration

Libraries and tools for integrating with Mattermost
Go
7
star
15

sima

Sistem Informasi Manajemen Aset
PHP
7
star
16

arch-docker

Script to create docker images based on Arch Linux on x86_64.
Shell
4
star
17

vos

Vos is a program to process formatted data, i.e. CSV data. Vos is designed to process a large input file, a file where their size is larger than the size of memory, and can be tuned to adapt with your machine environment.
C
4
star
18

wvcgen

Wikipedia vandalism dataset generator
Go
3
star
19

gorankusu

[mirror] The Go module for programmatically run and load testing HTTP services
Go
3
star
20

thesis

Master Thesis: Detecting Vandalism on English Wikipedia Using LNSMOTE Resampling and Cascaded Random Forest Classifier
TeX
1
star
21

awwan

[mirror] Configuration management software, infrastructure as file and directory layout
Go
1
star
22

mdgo

[mirror] Go static website generator with markdown markup language
Go
1
star
23

gonduit

The Go library for working with Phabricator Conduit API
Go
1
star
24

karajo

[mirror] HTTP workers and manager with web user interface
Go
1
star
25

kait

Go
1
star
26

librextjs

Open source javascript framework.
JavaScript
1
star
27

tekstus

A Go library for working with text (deprecated, see: github.com/shuLhan/lib/text).
Go
1
star
28

libvos

A C-with-class library primarily for manipulating DSV data (reading and writing DSV data in any format), turns out it had more capabilities: DNS protocol, FTP protocol, a simple FTP server, OCI protocol, and reading/writing INI configuration file
C++
1
star
29

share

[Deprecated] A collection of libraries and tools written in Go. This module has been moved to https://git.sr.ht/~shulhan/pakakeh.go
Go
1
star