Skip to main content

OTP command line tool

Project description

===========
Keyring OTP
===========

Keyring OTP is a CLI to generate One Time Password from secrets stored in
`Gnome Keyring <https://wiki.gnome.org/action/show/Projects/GnomeKeyring>`_
(the `seahorse's <https://wiki.gnome.org/Apps/Seahorse>`_ backend).


.. contents:: **Table of Contents**

------------
Installation
------------

This application is properly running on debian stretch in python3 virtual
environement::

$ python3 -m venv koptvenv
$ source ./kotpvenv/bin/activate

This requiere ``xclip`` on your computer to temporary put the secret in
your clipboard at the end of the program the initial value is back in your
clipboard::

$ apt install xclip

.. note::

If you are using ``-o`` option (console output) the app won't complaints
if xclip is not there.

Install using your favorite installer. For example::

$ pip install keyring-otp

-----
Usage
-----

use ``-h`` to get recent help::

$ kotp -h
usage: kotp [-h] [-s SECRET] [-o] [-d DURATION] keyring key

CLI to generate One Time Password from secrets stored in Keyring (using
seahorse password manager)

positional arguments:
keyring
key

optional arguments:
-h, --help show this help message and exit
-s SECRET, --secret SECRET
Force using secret from command line instead getting
it from the password manager. (as keyring and key are
mandatory set any values they will be ignored).
-o, --output Display output in console and in the clipboard (useful
if you can't install xclip).
-d DURATION, --duration DURATION
How many seconds you wants the One Time Password in
your clipboard. Note that as time is changing, the
TOTP password will be updated and your clipboard will
be updated too!

Let's assume I've a keyring called ``otp`` which contains a key called github
wich contains my github otp password.

.. figure:: seahorse.png
:alt: Seahorse Gnome password manager

To get the Time based OTP password in my clipboad I do::

$ kotp otp github

.. note::

At the time writting the ``otp`` keyring must be unlock before running
the application.

Here an other example by giving the OTP password value in command line::

$ kotp -s SECRETS -o -d 35 nothing real
Current TOTP 887562 at Wed Nov 8 07:48:18 2017
Current TOTP 291833 at Wed Nov 8 07:48:30 2017


.. warning::

This option is discouraged as long your OTP secret will be in your bash
history, we may remove this option to replace it with a prompt in the
future


-------
Roadmap
-------

* Setup CI
* First release
* make it usable as an API, API consumer may add multiple callback they should
be called once OTP as benn changed (callback may be declared in entry point
to let user define new callback easly), this apps should declare some
default behaviours likes:
- print in console
- filling clipboard (require an init method and final method to set back
current clipboad value)
* Prompt to unlock keyring
* Thinking replace ``-s`` option to let user use
* use python keyring to make this app portable with more password manager:
GnomeKeyring (for Gnome environments) or KDEWallet (for KDE environments)
or Win32CryptoRegistry (for Windows)
* manage passman backends
* save new secrets

------
Author
------

* Pierre Verkest <pverkest@anybox.fr>

Changelog
=========

0.1 (2017-11-11)
----------------
- Initial implementation


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

keyring-otp-0.1.tar.gz (40.2 kB view details)

Uploaded Source

Built Distributions

keyring_otp-0.1-py3.5.egg (8.4 kB view details)

Uploaded Source

keyring_otp-0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file keyring-otp-0.1.tar.gz.

File metadata

  • Download URL: keyring-otp-0.1.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for keyring-otp-0.1.tar.gz
Algorithm Hash digest
SHA256 710618b620c7a57088f7208aff3d35a640e3b4fbe7d01c99f4da760a5b243df9
MD5 98c6d64c417386c339d5316a0c507895
BLAKE2b-256 e7b968f9ae5e6b3218421a7ab4d61631851c1f1e115576e5e097590d4eea500c

See more details on using hashes here.

File details

Details for the file keyring_otp-0.1-py3.5.egg.

File metadata

File hashes

Hashes for keyring_otp-0.1-py3.5.egg
Algorithm Hash digest
SHA256 009988a7d454e73e6e2db8da65d2a8fef7511eb293f9afe9246610cf0066a1ae
MD5 ded98674f0881c905ce88809037622c9
BLAKE2b-256 80111ba96aa2497f21be748c9632f8623d6428d4f8c48ee4a08e0940bb8ecde7

See more details on using hashes here.

File details

Details for the file keyring_otp-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for keyring_otp-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f09217899326bf607071eb2c5b983b9fac910fc7f95b69aa811e81ef8d531163
MD5 312227fbb3a75638f64ade225bb59aa8
BLAKE2b-256 be3069677cbb94c7e30331e25aee0fb1f2b2cf33ecaa2316d795d75c87634af0

See more details on using hashes here.

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