Skip to main content

Pure Python implementation of the binary-to-text encoding from RFC 1751, S/Key

Project description

This is a Pure-Python implementation of RFC 1751.

Using this small library, you can turn binary strings (for example IDs or passwords) into small sequences of short English words. For example:

EB33 F77E E73D 4053

would become:

TIDE ITCH SLOW REIN RULE MOT

The algorithm turns a 64-bit string into 6 English words and vice versa. Two bits of parity are included in the sequence of words, which allow detecting an invalid or corrupted phrase.

Usage

>>> rfc1751.bytes_to_string([204, 172, 42, 237, 89, 16, 86, 190])
'RASH BUSH MILK LOOK BAD BRIM'
>>> rfc1751.bytes_to_string(b'\xCC\xAC\x2A\xED\x59\x10\x56\xBE')
'RASH BUSH MILK LOOK BAD BRIM'
>>> rfc1751.string_to_bytes('RASH BUSH MILK LOOK BAD BRIM')
b'\xCC\xAC\x2A\xED\x59\x10\x56\xBE'
>>> list(rfc1751.string_to_bytes('RASH BUSH MILK LOOK BAD BRIM'))
[204, 172, 42, 237, 89, 16, 86, 190]

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

rfc1751-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

rfc1751-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file rfc1751-0.1.0.tar.gz.

File metadata

  • Download URL: rfc1751-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for rfc1751-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e7af56a927b4ddb21f40d2343c26418a86a498c808d236063849f573b753ba7a
MD5 6b5fa23d465dfd6388d8d70ff85a4951
BLAKE2b-256 130913a70b77c89624c038f0f0ec3b1a4ea0f20158a35e012b9c208bf68465af

See more details on using hashes here.

Provenance

File details

Details for the file rfc1751-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rfc1751-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for rfc1751-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4712d748591a4d5beeee1aaeb90147a93d66813fc5e5d1afaf9feb60d0805b05
MD5 e5b7f4b729dd381104c61778888ee59f
BLAKE2b-256 3184af2604eeacd7c17e056df1835d5bb1e10ac2198d6a8bd7a45a69ce650ff4

See more details on using hashes here.

Provenance

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