Skip to main content

μOTP+: The next generation OTP toolkit

Project description

μOTP+ is the next generation OTP toolkit.

Installation

You will need Python 3.4 or higher in order to run uotp.

$ pip install -U uotp

How to use μOTP+ as GUI application

Run uotp gui.

$ uotp gui

How to use μOTP+ as CLI application

Just run uotp.

$ uotp

μOTP+ will automatically issue a new account and sync time with the server for you.

Once you have successfully issued the new account, running uotp again will start giving you the OTP token.

For more information, see uotp --help.

Configuration file

By default, a new configuration file will be automatically generated on ~/.config/uotp/config.yml.

This behaviour however can be overriden by passing --conf=/path/to/config.yml to uotp command or setting UOTP_CONF=/path/to/config.yml environment variable.

$ uotp --conf=uotp.yml new
$ UOTP_CONF=uotp.yml uotp new

How to develop an application using μOTP+

# Import everything
from uotp import OTPTokenGenerator, OTPUtil
from uotp.packet import IssueRequest, TimeRequest


# Issue a new account
req = IssueRequest()
req['mno'] = 'KTF'
req['hw_id'] = 'GA15'
req['hw_model'] = 'SM-N900P'
req['version'] = (2, 0)

resp = req()
oid = resp['oid']
seed = resp['seed']
serial_number = resp['serial_number']

print(Util.humanize(serial_number, char='-', each=4))


# Sync time with the server
remote_now = TimeRequest()()['time']
local_now = Util.now()

timediff = remote_now - local_now


# Get a new OTP token
generator = OTPTokenGenerator(oid, seed)
generator.compensate_time_deviation(timediff)
token = generator.generate_token()

print(Util.humanize(token, char=' ', each=3, maxgroup=2)

License

All proprietary materials are intellectual property of (C) 2004 - 2017 ATsolutions

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

uotp-0.3.0.tar.gz (14.4 kB view hashes)

Uploaded Source

Built Distribution

uotp-0.3.0-py2.py3-none-any.whl (18.0 kB view hashes)

Uploaded Python 2 Python 3

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