All Projects → jleclanche → Python Bna

jleclanche / Python Bna

Licence: mit
Python implementation of the mobile Blizzard Authenticator (TOTP)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Python Bna

Aegis
A free, secure and open source app for Android to manage your 2-step verification tokens.
Stars: ✭ 2,692 (+1531.52%)
Mutual labels:  2fa, totp, authenticator
Twofa
A TouchID-aware 2-factor authenticator for macOS
Stars: ✭ 105 (-36.36%)
Mutual labels:  2fa, totp, authenticator
Aspnetcoreid4external
external OpenID Connect Login to IdentityServer4 with AAD
Stars: ✭ 63 (-61.82%)
Mutual labels:  2fa, totp, authenticator
Go Guardian
Go-Guardian is a golang library that provides a simple, clean, and idiomatic way to create powerful modern API and web authentication.
Stars: ✭ 204 (+23.64%)
Mutual labels:  2fa, totp, authenticator
Freeotpplus
Enhanced fork of FreeOTP-Android providing a feature-rich 2FA authenticator
Stars: ✭ 223 (+35.15%)
Mutual labels:  2fa, totp, authenticator
totp
Time-Based One-Time Password Code Generator
Stars: ✭ 76 (-53.94%)
Mutual labels:  totp, authenticator, 2fa
Authenticatorpro
📱 Two-Factor Authentication (2FA) client for Android + Wear OS
Stars: ✭ 155 (-6.06%)
Mutual labels:  2fa, totp, authenticator
Authelia
The Single Sign-On Multi-Factor portal for web apps
Stars: ✭ 11,094 (+6623.64%)
Mutual labels:  2fa, totp
Authenticator
Two-Factor Authentication Client for iOS
Stars: ✭ 648 (+292.73%)
Mutual labels:  2fa, authenticator
Mintotp
Minimal TOTP generator in 20 lines of Python
Stars: ✭ 678 (+310.91%)
Mutual labels:  2fa, totp
Authenticator
Authenticator generates 2-Step Verification codes in your browser.
Stars: ✭ 979 (+493.33%)
Mutual labels:  2fa, authenticator
Otp.net
A .NET implementation of TOTP and HOTP for things like two-factor authentication codes.
Stars: ✭ 424 (+156.97%)
Mutual labels:  2fa, totp
Two Factor Bundle
[OUTDATED] Two-factor authentication for Symfony applications 🔐 (bunde version ≤ 4). Please use version 5 from https://github.com/scheb/2fa.
Stars: ✭ 388 (+135.15%)
Mutual labels:  2fa, totp
Swiftotp
A Swift library for generating One Time Passwords (OTP)
Stars: ✭ 119 (-27.88%)
Mutual labels:  2fa, totp
Java Otp
A one-time password (HOTP/TOTP) library for Java
Stars: ✭ 265 (+60.61%)
Mutual labels:  2fa, totp
pyotp
Python One-Time Password Library
Stars: ✭ 1,930 (+1069.7%)
Mutual labels:  totp, 2fa
Otplib
🔑 One Time Password (OTP) / 2FA for Node.js and Browser - Supports HOTP, TOTP and Google Authenticator
Stars: ✭ 916 (+455.15%)
Mutual labels:  2fa, authenticator
Otpauth
One Time Password (HOTP/TOTP) library for Node.js, Deno and browsers.
Stars: ✭ 135 (-18.18%)
Mutual labels:  totp, authenticator
Totp Cli
A cli-based pass-backed TOTP app
Stars: ✭ 76 (-53.94%)
Mutual labels:  2fa, totp
One Time
One Time Password (TOTP and HOTP) library for Clojure. TOTP/HOTP is widely used for Two Factor / Multi Factor Authentication.
Stars: ✭ 129 (-21.82%)
Mutual labels:  2fa, totp

python-bna

Requirements

  • Python 3.6+

Command-line usage

bna is a command line interface to the python-bna library. It can store and manage multiple authenticators, as well as create new ones.

Remember: Using an authenticator on the same device as the one you log in with is less secure than keeping the devices separate. Use this at your own risk.

Configuration is stored in ~/.config/bna/bna.conf. You can pass a different config path with bna --config=~/.bna.conf for example.

Creating a new authenticator

$ bna new

If you do not already have an authenticator, it will be set as default. You can pass --set-default otherwise.

Getting an authentication token

$ bna
01234567
$ bna EU-1234-1234-1234
76543210

Getting an authenticator's restore code

$ bna show-restore-code
Z45Q9CVXRR
$ bna restore EU-1234-1234-1234 ABCDE98765
Restored EU-1234-1234-1234

Getting an OTPAuth URL

To display the OTPAuth URL (used for setup QR Codes):

$ bna show-url
otpauth://totp/Blizzard:EU123412341234:?secret=ASFAS75ASDF75889G9AD7S69AS7697AS&issuer=Blizzard&digits=8

Now paste this to your OTP app, or convert to QRCode and scan, or manually enter the secret.

This is compatible with standard TOTP clients and password managers such as:

Getting a QR code

To encode to a QRCode on your local system install 'qrencode'

For a PNG file saved to disk :

$ bna show-url | qrencode -o ~/BNA-qrcode.png
# Scan QRCode
$ rm ~/BNA-qrcode.png

Or to attempt ot display QRCode in terminal as text output :

$ bna --otpauth-url | qrencode -t ANSI

Python library usage

Requesting a new authenticator

import bna
try:
    # region is EU or US
    # note that EU authenticators are valid in the US, and vice versa
    serial, secret = bna.request_new_serial("US")
except bna.HTTPError as e:
    print("Could not connect:", e)

Getting a token

    # Get and print a token using PyOTP
    from pyotp import TOTP
    totp = TOTP(secret, digits=8)
    print(totp.now())
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].