Skip to main content

build status version license coverage downloads

Obscure

Showing a steadily increasing sequence of integer IDs leaks information to customers, competitors, or malicious entities about the number and frequency of customers, inventory, or orders. Some example include:

/customer/123
/order/308

From these, I would conclude that I am only your 123rd customer with the 308th order. How a customer or competitor would feel about this would differ. However, the point is do I really want others to know this information? In addition, by creating another account or order, I can estimate the rate of change within your systems.

This class will help obscure your sequential order by providing a reversible transformation to your numbers. By using different salts your transformations will be unique. In addition, the class gives some output helpers for hex, base32, and base64. There is one I call 'tame' as it removes the letters i and u to elimination some common offensive words.

Install

By far the simplest method is to use pip:

$ pip install obscure

Example

$python -m obscure --bits=64 --demo 0 1 2

>>> from obscure import FeistelCipher, Encoder
>>> cipher = FeistelCipher(bits=64)
# For a consistant transformations between instances,give a
# salt and small prime for the Feistel cipher's round function
>>> cipher = FeistelCipher(0x1234, 0xc101, bits=64)
>>> numeric_id = 1234
>>> cipher(numeric_id)
249699227
# Reverse the transformation
>>> cipher(cipher(numeric_id))
1234
# Use an Encoder to wrap the Feistel cipher
>>> encoder = Encoder(Feistel, "base32")
>>> encoder.encode(numeric_id)
"XXX"
>>> encoder.decode('XXX")
1234

License MIT

Metadata

Release files for obscure 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for obscure 1.0.4
File Size Uploaded Provenance Actions
obscure-1.0.4.tar.gz 13.3 kB With provenance Details for obscure-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for obscure 1.0.4
File Interpreter ABI Platform Actions
obscure-1.0.4-py3-none-any.whl Python 3 none any Details for obscure-1.0.4-py3-none-any.whl

Total release size: 23.9 kB

Release files / obscure-1.0.4.tar.gz

Download URL obscure-1.0.4.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cbbc72bab6b01ea52d74f69142cf135ca054f6631d6153ee8091b56d73fb6366
BLAKE2b-256 checksum
How to use checksums
fa4f86fc355d96d4badf268063a18217ca821caf4ae1108ed64000f5fb18e826
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 12, 2025.

Transparency log

Release files / obscure-1.0.4-py3-none-any.whl

Download URL obscure-1.0.4-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6350f43baae9fd26c4b2d8d8180e4bd6c20d5c6fb9986fe79282c25dbb716f16
BLAKE2b-256 checksum
How to use checksums
ae9fec7ac1937b3bf7da2ba34230db26039ba5e422aa5fc7052dee711672172a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 12, 2025.

Transparency log

Security for obscure 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for obscure-1.0.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 12, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page