Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Implements two-step verification of HOTP/TOTP

Project Description

cryptography has built-in two factor support now.

otpauth is One Time Password Authentication, which is usually called as two steps verification. You may have heard it from Google, Dropbox and etc.

Installation

Installing otpauth is simple with pip:

$ pip install otpauth

or, with easy_install:

$ easy_install otpauth

Usage

Generate and validate an otp code is very simple:

>>> from otpauth import OtpAuth
>>> auth = OtpAuth('secret')  # a secret string
>>> auth.hotp()  # generate a count based code, default count is 4
330810
>>> auth.valid_hotp(330810)
4
>>> auth.hotp(2)  # generate a count based code, count is 2
720111
>>> auth.valid_hotp(720111)
2
>>> auth.totp()  # generate a time based code
828657
>>> auth.valid_totp(828657)
True

Authenticator

You can create a QR code for Google Authenticator to scan:

>>> from otpauth import OtpAuth
>>> auth = OtpAuth('secret')  # a secret string
>>> s = auth.to_uri('totp', 'Example:foo@bar.baz', 'Foo')
>>> import qrcode
>>> img = qrcode.make(s)

Release History

This version
History Node

1.0.1

History Node

1.0

History Node

0.3.0

History Node

0.2.0

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
otpauth-1.0.1-py2.py3-none-any.whl
(5.8 kB) Copy SHA256 Hash SHA256
Wheel 2.7 May 26, 2015
otpauth-1.0.1.tar.gz
(5.0 kB) Copy SHA256 Hash SHA256
Source None May 26, 2015

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting