Skip to main content

Token utilities

Project description

Utilities to generate and verify tokens (autodeprecating or not).

Currently implemented :

  • Time-based One-time Password (TOTP)

TOTP Example

Below is an example of a token based on TOTP, self-deprecating after a given number of seconds

from roughrider.token.hmac_factories import TOTTokenFactory

factory = TOTTokenFactory(secret=b'secret', TTL=180)  # 3 min TTL
token = factory.generate('my word')
assert factory.challenge(token, 'my word') is True
assert factory.challenge(token, 'my other word') is False

CHANGES

0.1 (2021-10-09)

  • Initial release.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

roughrider.token-0.1.tar.gz (5.9 kB view hashes)

Uploaded Source

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