Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andreax79/python-securid
python-securid is a Python library for generating RSA SecurID 128-bit compatible token codes.
https://github.com/andreax79/python-securid
python securid
Last synced: about 1 month ago
JSON representation
python-securid is a Python library for generating RSA SecurID 128-bit compatible token codes.
- Host: GitHub
- URL: https://github.com/andreax79/python-securid
- Owner: andreax79
- License: mit
- Created: 2020-04-06T21:38:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-07T12:34:54.000Z (5 months ago)
- Last Synced: 2024-11-07T23:58:33.765Z (about 1 month ago)
- Topics: python, securid
- Language: Python
- Homepage:
- Size: 587 KB
- Stars: 25
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: changelog.txt
- License: LICENSE
Awesome Lists containing this project
README
python-securid - RSA SecurID 128-bit Token Library
==================================================python-securid is a Python library for generating RSA SecurID 128-bit compatible token codes.
(Python port of `stoken `_).
This project is not affiliated with or endorsed by RSA Security.|made-with-python| |Build Status| |PyPI version| |PyPI| |Downloads| |PyPI license| |Code style|
.. |made-with-python| image:: https://img.shields.io/badge/Made%20with-Python-1f425f.svg
:target: https://www.python.org/
.. |Build Status| image:: https://github.com/andreax79/python-securid/workflows/Tests/badge.svg
:target: https://github.com/andreax79/python-securid/actions
.. |PyPI version| image:: https://badge.fury.io/py/securid.svg
:target: https://badge.fury.io/py/securid
.. |PyPI| image:: https://img.shields.io/pypi/pyversions/securid.svg
:target: https://pypi.org/project/securid
.. |Downloads| image:: https://pepy.tech/badge/securid/month
:target: https://pepy.tech/project/securid
.. |PyPI license| image:: https://img.shields.io/pypi/l/securid.svg
:target: https://pypi.python.org/pypi/asecurid/
.. |Code style| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/blackInstallation
------------
::pip install securid
Usage
-----Shell
~~~~~Generate token from a password protected sdtid file.
.. code:: bash
$ securid --filename my.sdtid --password very_secret
24848935Convert a sdtid file into an unprotected JSON file and generate token from the JSON file.
.. code:: bash
$ securid --filename my.sdtid --password very_secret --export > my.json
$ securid --filename my.json
24848935
$ cat my.json
{"digits": 8, "exp_date": "2025-04-13", "period": 60, "secret": [15, 63, 116, 57, 194, 241, 34, 224, 68, 60, 168, 234, 155, 194, 99, 167], "serial": "530965299048", "type": "SecurID"}Sdtid File
~~~~~~~~~~
::import securid
from securid.sdtid import SdtidFile# Read sdtid file
sdtid = SdtidFile('filename.sdtid')
# Decrypt token with password
token = sdtid.get_token(password='000123456789')
# Generate OTP
token.now() #=> '123456'Stoken File
~~~~~~~~~~~
::import securid
from securid.stoken import StokenFile# Read ~/.stokenrc file
stoken = StokenFile()
# Get token
token = stoken.get_token()
# Generate OTP
token.now() #=> '123456'Generating a new Token
~~~~~~~~~~~~~~~~~~~~~~
::import securid
token = securid.Token.random(exp_date=date(2030,1,1))
str(token) # => digits: 6 exp_date: 2030-01-01 interval: 60 issuer: label: seed: 34b7e942eb6fb35bbf81579dcd9b0522 serial: 922729241304
# Generate OTP
token.now() #=> '755546'Links
~~~~~* `Project home page (GitHub) `_
* `Documentation (Read the Docs) `_
* `stoken - Software Token for Linux/UNIX `_
* `PyOTP - Python One-Time Password Library `_