Skip to main content

A cli based TOTP app.

Project description

version on pypi licence

totp-cli is a simple command line application to generate OTP tokens for two factor authentication using RFC6238.

These are compatible with many popular services such as Facebook, GitHub, Google, eve-online, battle.net, etc.

totp-cli fetches your shared key (aka: code) from pass, generates the token, outputs it to stdout and copies it to your CLIPBOARD X selection. Default X selection can be overridden with the PASSWORD_STORE_X_SELECTION environment variable.

Shared keys should be stored in your pass storage under 2fa/SERVICE/code, for example 2fa/github/code. The -a flag (or alternatively the add subcommand) can be used to add this less painfully.

Usage

Usage:

totp SERVICE

For example:

$ totp github
621787

You don’t need to run totp from the command line if you just want to paste the code; you can run it from dmenu, or whatever your application launcher is.

To offset the clock by a number of seconds:

totp -s SECONDS SERVICE

For example:

$ totp -s +60 github
735092
$ totp -s -90 github
909651

To add a service:

totp -a SERVICE
# OR
totp add SERVICE

For example:

$ totp -a github
Token length [6]: 6
Shared key: KEY

Note that if the service already exists, it will be overwritten without warning.

About pass entries

Pass entries are expected to have the TOTP secret in their first line (as provided by the third party). The amount of digits token must have (for example, battle.net uses 8), must be provided in a separate line, with a format like:

Digits: 8

For the moment, only customizing the token length is possible.

Requirements

There are also some platform-specific requirements for copying code into the clipboard:

  • xclip for Xorg (Linux/BSD).

Installation

Installation is quite simple:

$ pip install totp

There is also an AUR package available for ArchLinux users.

You can also configure shell completion for totp-cli:

License

totp-cli is distrbuted under the terms of the ISC licence. See LICENCE for details.

Copyright (c) 2014-2017 Hugo Osvaldo Barrera <hugo@barrera.io>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

totp-1.2.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

totp-1.2.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file totp-1.2.0.tar.gz.

File metadata

  • Download URL: totp-1.2.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.3

File hashes

Hashes for totp-1.2.0.tar.gz
Algorithm Hash digest
SHA256 cf4c2316473adb0545ddee4450156a6d3fc81b3dd556093056faa7f2f23f2d13
MD5 ec2ae39d309a9997016d0ce011ab91e2
BLAKE2b-256 239be47e34cd11fc4131ab5359da72e160620cb81dd2e658245d693f4d96fc1c

See more details on using hashes here.

Provenance

File details

Details for the file totp-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: totp-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.3

File hashes

Hashes for totp-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40b7b744406d8ce48532f5690ca4b86c934b082c462bcaf76e282c69ad727722
MD5 ccac38cd135ca7bd55f916d333a71559
BLAKE2b-256 a68129891e01637e6bd5a607e9344a75bdc7a5aa98bae3e6a0652e914093375b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page