Skip to main content
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Description: hotpie
======

|Build Status| |PyPI|

`read more <http://blog.gingerlime.com/2010/once-upon-a-time/>`__

OATH HOTP/TOTP implementation in python

based on http://tools.ietf.org/html/rfc4226
http://tools.ietf.org/html/rfc6238

parameter and function names kept inline with the rfc (e.g. hotp,
truncate, k, c etc)

also including a simple unit test based on test vectors in the RFC

usage
=====

.. code:: bash

pip install hotpie

.. code:: python

from hotpie import HOTP, TOTP

key = 'secret'
HOTP(key, 0) # '814628'
HOTP(key, 0, digits=8) # '31814628'
HOTP(key, 13, digits=8) # '81315566'
TOTP(key, digits=6) # <time-based-value>

# you can also use different hash implementations by passing `digestmod`
# (RFC4226 only specifies SHA-1,
# but RFC6238 explicitly mentions SHA-256 and SHA-512)
from hashlib import sha512, sha256

HOTP(key, 0, digits=8, digestmod=sha512)
TOTP(key, digits=8, digestmod=sha256)

tests
=====

To run the tests, simply run ``python ./hotpie.py``

.. |Build Status| image:: https://secure.travis-ci.org/gingerlime/hotpie.png?branch=master
:target: http://travis-ci.org/gingerlime/hotpie
.. |PyPI| image:: https://img.shields.io/pypi/v/hotpie.svg
:target: https://pypi.python.org/pypi/hotpie

Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5

Metadata

Release files for hotpie 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hotpie 1.0.5
File Size Uploaded Provenance
hotpie-1.0.5.tar.gz 3.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hotpie 1.0.5
File Interpreter ABI Platform
hotpie-1.0.5-py2-none-any.whl Python 2 none any Details

Total release size: 7.7 kB

Release files / hotpie-1.0.5.tar.gz

Download URL hotpie-1.0.5.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1e6f59bf98f32c5413c398d7e4225fc0c835fdd3b4b93178f3b6417c284fed76
BLAKE2b-256 checksum
How to use checksums
ba42e20a4ed79d1b3c2bbad28a47df321fb79152c82ff28ae46b9b10981e616c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/12.0.5 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.12

Release files / hotpie-1.0.5-py2-none-any.whl

Download URL hotpie-1.0.5-py2-none-any.whl
Size 3.8 kB
Tags Python 2
SHA-256 checksum
How to use checksums
1f2b9f528a8a21806a987687f90e344de5241862b1e0693b877625c2e8f39112
BLAKE2b-256 checksum
How to use checksums
1fdae6ae2144ab1214817c8fb77ab5150efe37174dc6af930e7799d78d6b1927
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/12.0.5 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.12

Security for hotpie 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page