Skip to main content

Tool to generate One-Time Passwords

Project description

Tool to generate One-Time Passwords

PyPI package: ppotp

If you spot any problems or have any improvement ideas then feel free to open an issue and I will be glad to look into it for you.

Installation

A recommended way of installing the tool is pip install.

Once installed, a command line tool otp should be available in your system’s PATH.

pip install

The tool is available in PyPI and can be installed using pip:

$ pip install --user ppotp
$ otp --help

Usage

$ otp --help
usage: otp [--version] [--help] [--debug] key

Tool to generate One-Time Passwords

positional arguments:
  key        key or service name from ~/.otpkeys

optional arguments:
  --version  show program's version number and exit
  --help     show this help message and exit
  --debug    debugging mode

Examples

$ otp BEXUS3AVCUU7HYU4OZQ44WFXMULPNQB2TKQ4YCNUASPXMPEH6YAZ3IACFM5VEGUQ
770400

Key file ~/.otpkeys

You can save your keys to ~/.otpkeys file using service=key format, for example:

$ cat ~/.otpkeys
aws=N5VEJBTUA553BYJTTTUGS3GANKVDECG62RHVIOV2FLYR5THC726ZOIOF4SQZZ5NV
google=QYDL7HS7LHPVKX7GGYKYIP3UEYOML2IENWYQD5NHYGETBZIRWWODKQWC3PRNQ3FO
facebook=ZBSLA3KGE4PEXCEGIJ57AKJLOHW2S3ABQNOOWZVV3HOO4Q3455BOG6BRNU5M2QK4

Then you can generate OTP, by running:

$ otp {service}

Example:

$ otp aws
443782

$ otp google
760698

$ otp facebook
009176

Auto copy OTP to clipboard (Mac OS X)

Add the following code at the end of your ~/.bashrc file (change path to otp if needed):

otp_func() {
  if code=$(/usr/local/bin/otp "$1" 2>&1); then
    printf "%s\\n" "$code" | tee /dev/tty | pbcopy
    return 0
  else
    printf "%s\\n" "$code" >&2
    return 1
  fi
}
alias otp='otp_func'

Example:

$ vim ~/.bashrc
$ source ~/.bashrc
$ otp cloud
324982

At this point the above OTP should be in the clipboard.

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

ppotp-2.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ppotp-2.0.1-py2.py3-none-any.whl (15.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ppotp-2.0.1.tar.gz.

File metadata

  • Download URL: ppotp-2.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for ppotp-2.0.1.tar.gz
Algorithm Hash digest
SHA256 3dc7903971a52baf25d11d5ad1c46fd9fbb406f6d0f9bc8894d74b97b0fa2a67
MD5 8de0b4f4a645f97e71b0ca94f18e86e4
BLAKE2b-256 a67a66bd7512939c2d4322dde01798280613ede3a51c040ca61f5462c6809aeb

See more details on using hashes here.

File details

Details for the file ppotp-2.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: ppotp-2.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for ppotp-2.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1fd0f8fe484e985abda33ce54d1589baa79bad02654aee3191aa9e45550dc0a3
MD5 a7efb66a2f90ce50962fd1b905b4dd2f
BLAKE2b-256 679199ae34fe2dfecd2c186b39c39e6e027e19b6d63339c1b9da571a19b25489

See more details on using hashes here.

Supported by

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