Skip to main content

A CLI tool to generate TOTP values from a password protected YubiKey by storing the password in the system-protected keyring.

Project description

yk-totp

PyPI Version PyPI License PyPI Status

yk-totp is a little CLI util for YubiKeys, that will generate TOTP codes upon request.

The added benefit compared to the official ykman is that it offers to store the password for unlocking your YubiKey in your system's keyring, whereas ykman stores your password in it's config file. (While the password is stored as PBKDF2HMAC-hash and not in plain-text, this hash is all that is required to get to your 2FA, yet this hash is not protected in any way.)

This allows yk-totp to be used in other tools (like in an Alfred Worflow) which don't offer facilities to store or enter a password, or where it's inconvenient to repeatedly enter the password.

Requirements

This tool requires Python 3 and an operating system that is supported by both, the keyring Python module and by the ykman tool from YubiCo.

Installation

For now, the way to install yk-totp is via PIP:

pip3 install -U yk-totp

Use the same command to update to a new version.

Error while installation

If you get errors while installing yk-totp, try this:

# Update the Python modules responsible for installing other modules
pip3 install -U pip wheel setuptools

Check if you have swig installed, which is apparently required to install pyscard, which is a dependency of ykman:

# macOS with Homebrew
brew install swig

# Linux (apt)
sudo apt update && sudo apt install swig

# Linux (yum)
sudo yum install swig

# Windows with Chocolately
choco install swig

Development

python3 -m venv .venv
source .venv/bin/active
pip3 install -U pip setuptools wheel
pip3 install -r requirements.txt
pip3 install -e .

Release

pip3 install -U build twine
python3 -m build

Licensing and Copyright

This code is copyrighted. But it can be used under the terms of the MIT license for your own purposes. It builds upon the following third party modules:

  • keyring for the interaction with the operating system's keyring, which is MIT licensed.
  • yubikey-manager for communicating with the YubiKey, which is licensed under a BSD-2-Clause License.
  • click for the CLI interface, which is licensed under a BSD-3-Clause License.

Open source software rocks 🎸!

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

yk-totp-0.2.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

yk_totp-0.2.2-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file yk-totp-0.2.2.tar.gz.

File metadata

  • Download URL: yk-totp-0.2.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for yk-totp-0.2.2.tar.gz
Algorithm Hash digest
SHA256 4a01c67b1652c29cb5e88bc09c483481b2aabac4bc594bf175aa1225d09fb253
MD5 fd4a02416c72dc1a02d3be22cad7e4f1
BLAKE2b-256 c6301997538c9f4945e59566685f7ea15edac1ffa7babc93d1c9f400abfa495d

See more details on using hashes here.

File details

Details for the file yk_totp-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: yk_totp-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for yk_totp-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 786aba489616648c588badc5097ab1caa0e57d8096d51d09c64c63af2d3a9cc8
MD5 fec87d8f4d565454867f40f96650db77
BLAKE2b-256 a62d8ace2f1dfacb5d2c9363702f174a54cd0eebe518101ff579142e4c74d76d

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