Very simple modhex library when working with yubikey OTPs.
Project description
python_modhex
When working with yubikeys, you get OTPs in modhex
, which according to https://developers.yubico.com/OTP/Modhex_Converter.html
is similar to hex encoding but with a different encoding alphabet.
The alphabet is ALPHABET = "cbdefghijklnrtuv"
.
This module merely does what https://developers.yubico.com/OTP/Modhex_Converter.html offers as well:
- Convert a
modhex
string tohex
. - Convert a
hex
string tomodhex
.
Installation
pip install python_modhex
The installation also creates an executable, thatprovidesa simple interfaces:
python_modhex --version
python_modhex --help
# From modhex.
python_modhex from-modhex cccccctcjhhrrrdeejrtrvdldhthenggvuedgfevjecu <list_of_modhex_strings>
# To modhex.
python_modhex to-modhex 000000d0866ccc2338cdcf2a26d63b55fe32543f830e <list_of_hex_strings>
Use as module
>>> import python_modhex
>>> modhex = "cccccccgklgcvnkcvnnegrnhgrjkhlkfhdkclfncvlgj"
>>> hex_ = "000000059a50fb90fbb35cb65c896a946290a4b0fa58
>>>
>>> from_modhex(modhex)
>>> 000000059a50fb90fbb35cb65c896a946290a4b0fa58
>>>
>>> to_modhex(hex_)
>>> cccccccgklgcvnkcvnnegrnhgrjkhlkfhdkclfncvlgj
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python_modhex-0.0.1.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for python_modhex-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e322d04ee357a9832b28e9be235bf0f3f1bab84844c13995998d96cbdc40381 |
|
MD5 | 9f37f944d607effd011d9e430fad7f97 |
|
BLAKE2b-256 | 233c9ea2dff79b4ef29a86793a74887001bda9856dbea5c448ace1c5bb0fbc90 |