Stop leaking information by obscuring sequential ID numbers
Project description
[![build status](https://travis-ci.org/jidn/obscure.svg?branch=master)](https://travis-ci.org/jidn/obscure.svg?branch=masterp) ![version](http://img.shields.io/pypi/v/obscure.svg) ![license](http://img.shields.io/pypi/l/obscure.svg) ![coverage](https://coveralls.io/repos/github/jidn/obscure/badge.svg?branch=master) ![downloads](http://img.shields.io/pypi/dm/obscure.svg)
# Obscure
Showing a steadly 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 reverseable 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:
`console $ pip install obscure `
# Example
`python >>> from obscure import Obscure >>> customer_id = 123 >>> num = Obscure(0x1234) >>> num.transform(customer_id) 249699227 >>> num.transform(249699227) 123 >>> num.encode_hex(customer_id) '0ee21b9b' >>> num.encode_base32(customer_id) 'B3RBXGY' >>> num.decode_base32(num.encode_base32(customer_id)) 123 >>> num.encode_base64(customer_id) 'DuIbmw' >>> num.encode_tame(customer_id) 'JB4XFK5' >>> num.decode_tame(num.encode_tame(customer_id)) 123 `
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
Built Distribution
File details
Details for the file obscure-1.0.1.tar.gz
.
File metadata
- Download URL: obscure-1.0.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66457aa705553eff182729bdc3a5efc74286d033b61cbee5f87dab22b5bed395 |
|
MD5 | 79626472114a6dff7221baca77f24421 |
|
BLAKE2b-256 | ce7bebedf560068174b3c4a7c3835ea07ee5d86baaf89c2158a217c12a23f379 |
File details
Details for the file obscure-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: obscure-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7b2d6a83299ca62a55fe71d859528102d188d11230768b534f8d079e31f4535 |
|
MD5 | 95f6779b24b011554bb337359310e935 |
|
BLAKE2b-256 | 9297517442fc79453b409e5c1f145f84bf29d96af6b0551812a8027419de1336 |