| 1 |
Metadata-Version: 1.1 |
| 2 |
Name: onetimepass |
| 3 |
Version: 1.0.1 |
| 4 |
Summary: Module for generating and validating HOTP and TOTP tokens |
| 5 |
Home-page: https://github.com/tadeck/onetimepass/ |
| 6 |
Author: Tomasz Jaskowski |
| 7 |
Author-email: [email protected] |
| 8 |
License: MIT |
| 9 |
Download-URL: https://github.com/tadeck/onetimepass/archive/v1.0.0.tar.gz |
| 10 |
Description: Versions |
| 11 |
======== |
| 12 |
|
| 13 |
Current development release: `onetimepass-master.tar.gz`_ |otp-status-dev|_ |
| 14 |
|
| 15 |
.. |otp-status-dev| image:: |
| 16 |
https://api.travis-ci.org/tadeck/onetimepass.png?branch=master |
| 17 |
.. _otp-status-dev: https://travis-ci.org/tadeck/onetimepass |
| 18 |
.. _onetimepass-master.tar.gz: |
| 19 |
https://github.com/tadeck/onetimepass/archive/master.tar.gz |
| 20 |
|
| 21 |
Changelog |
| 22 |
--------- |
| 23 |
|
| 24 |
+---------+------------+------------------------------------------------------+ |
| 25 |
| Version | Date | Changes | |
| 26 |
+=========+============+======================================================+ |
| 27 |
| 1.0.1 | 2015-07-31 | - fixed tests and build system, | |
| 28 |
| | | - extended test coverage with Py3.5, PyPy and PyPy3, | |
| 29 |
+---------+------------+------------------------------------------------------+ |
| 30 |
| 1.0.0 | 2015-07-31 | - skipping spaces if they are given in secret, | |
| 31 |
| | | - test suite made more reliable, | |
| 32 |
+---------+------------+------------------------------------------------------+ |
| 33 |
| 0.3.0 | 2014-08-16 | - configurable digest method, | |
| 34 |
| | | - configurable token length, | |
| 35 |
| | | - configurable TOTP interval length, | |
| 36 |
+---------+------------+------------------------------------------------------+ |
| 37 |
| 0.2.2 | 2013-07-12 | - license clarification, | |
| 38 |
| | | - removal of compiled documentation from the sources,| |
| 39 |
+---------+------------+------------------------------------------------------+ |
| 40 |
| 0.2.1 | 2013-07-12 | - support for unicode secrets, | |
| 41 |
| | | - preliminary support for Travis CI, | |
| 42 |
+---------+------------+------------------------------------------------------+ |
| 43 |
| 0.2.0 | 2013-04-11 | - added compatibility with Python 3.x, | |
| 44 |
| | | - removed compatibility with Python 2.5 and earlier, | |
| 45 |
+---------+------------+------------------------------------------------------+ |
| 46 |
| 0.1.2 | 2013-01-23 | - added automated case fold to secret, | |
| 47 |
+---------+------------+------------------------------------------------------+ |
| 48 |
| 0.1.1 | 2013-12-20 | - internal code improvements, | |
| 49 |
| | | - documentation, | |
| 50 |
+---------+------------+------------------------------------------------------+ |
| 51 |
| 0.1.0 | 2011-12-19 | (initial public release) | |
| 52 |
+---------+------------+------------------------------------------------------+ |
| 53 |
|
| 54 |
What is OneTimePass |
| 55 |
=================== |
| 56 |
|
| 57 |
OneTimePass (actually ``onetimepass``) is a module for generating one-time |
| 58 |
passwords, namely HOTPs (HMAC-based one-time passwords) and TOTPs (time-based |
| 59 |
one-time passwords). They are used eg. within Google Authenticator application |
| 60 |
for Android or iPhone. |
| 61 |
|
| 62 |
How to install |
| 63 |
============== |
| 64 |
|
| 65 |
To install the library, you can either use ``pip``, or just download it |
| 66 |
separately. Installing in ``pip`` is the simplest. Assuming you are installing |
| 67 |
it system-wide:: |
| 68 |
|
| 69 |
$ sudo pip install onetimepass |
| 70 |
|
| 71 |
(if you are installing it in virtualenv, you do not need "``sudo``" part). |
| 72 |
|
| 73 |
Alternatively, you can follow the download link above and unpack in some |
| 74 |
directory on your ``sys.path``, or clone it as Git submodule to your own |
| 75 |
directory. |
| 76 |
|
| 77 |
How to use OneTimePass |
| 78 |
====================== |
| 79 |
|
| 80 |
You can use this module in the following way: |
| 81 |
|
| 82 |
1. Install module (download it into your application's directory or into modules |
| 83 |
directory) |
| 84 |
2. To get time-based token you invoke it like that:: |
| 85 |
|
| 86 |
import onetimepass as otp |
| 87 |
my_secret = 'MFRGGZDFMZTWQ2LK' |
| 88 |
my_token = otp.get_totp(my_secret) |
| 89 |
|
| 90 |
.. note:: |
| 91 |
``my_secret`` is case-insensitive, also spaces are ignored. This means you |
| 92 |
can provide your users with more readable representations of the secrets |
| 93 |
(eg. ``mfrg gzdf mztw q2lk`` instead of ``MFRGGZDFMZTWQ2LK``) and pass them |
| 94 |
unchanged to library. Same applies to other functions accepting secrets in |
| 95 |
this library. |
| 96 |
|
| 97 |
3. To get HMAC-based token you invoke it like that:: |
| 98 |
|
| 99 |
import onetimepass as otp |
| 100 |
my_secret = 'MFRGGZDFMZTWQ2LK' |
| 101 |
my_token = otp.get_hotp(my_secret, intervals_no=3) |
| 102 |
|
| 103 |
where ``intervals_no`` is the number of the current trial (if checking on |
| 104 |
the server, you have to check several values, higher than the last |
| 105 |
successful one, determined for previous successful authentications). |
| 106 |
|
| 107 |
4. To check time-based token you invoke it like that:: |
| 108 |
|
| 109 |
import onetimepass as otp |
| 110 |
my_secret = 'MFRGGZDFMZTWQ2LK' |
| 111 |
my_token = 123456 # should be probably from some user's input |
| 112 |
is_valid = otp.valid_totp(token=my_token, secret=my_secret) |
| 113 |
|
| 114 |
5. To check HMAC-based token you invoke it like that:: |
| 115 |
|
| 116 |
import onetimepass as otp |
| 117 |
my_secret = 'MFRGGZDFMZTWQ2LK' |
| 118 |
my_token = 123456 # should be probably from some user's input |
| 119 |
last_used = 5 # store last valid interval somewhere else |
| 120 |
is_valid = otp.valid_hotp(token=my_token, secret=my_secret, last=last_used) |
| 121 |
|
| 122 |
where: |
| 123 |
|
| 124 |
- ``last`` argument (in this case being assigned ``last_used``) is the |
| 125 |
number of the last successfully checked interval number (as |
| 126 |
``valid_totp()`` will skip it and start checking from the next interval |
| 127 |
number) |
| 128 |
- ``is_valid`` is being assigned value of ``False`` if ``my_token`` has not |
| 129 |
been identified as valid OTP for given secret (``my_secret``) and checked |
| 130 |
interval range. If it has been successful, ``is_valid`` is assigned a |
| 131 |
number of the working interval number (it should be saved into the |
| 132 |
database and supplied to the function as ``last`` argument next time the |
| 133 |
password is being checked, so you cannot use the same token again). |
| 134 |
|
| 135 |
License |
| 136 |
======= |
| 137 |
|
| 138 |
License for this library is available in ``LICENSE.rst`` file, in the same |
| 139 |
directory. Online version is available here_. |
| 140 |
|
| 141 |
.. _here: https://github.com/tadeck/onetimepass/blob/master/README.rst |
| 142 |
|
| 143 |
Platform: UNKNOWN |
| 144 |
Classifier: Development Status :: 6 - Mature |
| 145 |
Classifier: Intended Audience :: Developers |
| 146 |
Classifier: Intended Audience :: Education |
| 147 |
Classifier: Intended Audience :: Financial and Insurance Industry |
| 148 |
Classifier: Intended Audience :: Healthcare Industry |
| 149 |
Classifier: Intended Audience :: Information Technology |
| 150 |
Classifier: Intended Audience :: Legal Industry |
| 151 |
Classifier: Intended Audience :: Science/Research |
| 152 |
Classifier: Intended Audience :: System Administrators |
| 153 |
Classifier: Intended Audience :: Telecommunications Industry |
| 154 |
Classifier: License :: OSI Approved :: MIT License |
| 155 |
Classifier: Operating System :: OS Independent |
| 156 |
Classifier: Programming Language :: Python :: 2.6 |
| 157 |
Classifier: Programming Language :: Python :: 2.7 |
| 158 |
Classifier: Programming Language :: Python :: 3.2 |
| 159 |
Classifier: Programming Language :: Python :: 3.3 |
| 160 |
Classifier: Programming Language :: Python :: 3.4 |
| 161 |
Classifier: Topic :: Internet :: WWW/HTTP :: Session |
| 162 |
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management |
| 163 |
Classifier: Topic :: Security |
| 164 |
Classifier: Topic :: Software Development :: Libraries |
| 165 |
Classifier: Topic :: Software Development :: Libraries :: Python Modules |