{"id":25765513,"url":"https://github.com/jidn/obscure","last_synced_at":"2025-02-26T22:19:39.406Z","repository":{"id":57447675,"uuid":"54350434","full_name":"jidn/obscure","owner":"jidn","description":"Obscure sequential IDs  through reversable transformation","archived":false,"fork":false,"pushed_at":"2023-10-23T18:20:46.000Z","size":30,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-24T17:06:29.582Z","etag":null,"topics":["feistel","obfuscate","obscure","primary-key"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jidn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-21T01:21:39.000Z","updated_at":"2023-10-23T18:20:50.000Z","dependencies_parsed_at":"2024-11-06T17:24:39.243Z","dependency_job_id":"ed3f1425-0d84-4107-832d-9537312e61e6","html_url":"https://github.com/jidn/obscure","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":"0.15384615384615385","last_synced_commit":"18c7e3845b7dbbdcedcb83007d75e0cf532585c4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jidn%2Fobscure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jidn%2Fobscure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jidn%2Fobscure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jidn%2Fobscure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jidn","download_url":"https://codeload.github.com/jidn/obscure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240941958,"owners_count":19882123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["feistel","obfuscate","obscure","primary-key"],"created_at":"2025-02-26T22:19:38.362Z","updated_at":"2025-02-26T22:19:39.400Z","avatar_url":"https://github.com/jidn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build status](https://travis-ci.org/jidn/obscure.svg?branch=master)](https://travis-ci.org/jidn/obscure.svg?branch=masterp)\n![version](http://img.shields.io/pypi/v/obscure.svg)\n![license](http://img.shields.io/pypi/l/obscure.svg)\n![coverage](https://coveralls.io/repos/github/jidn/obscure/badge.svg?branch=master)\n![downloads](http://img.shields.io/pypi/dm/obscure.svg)\n\n# Obscure\n\nShowing a steadily increasing sequence of integer IDs leaks information\nto customers, competitors, or malicious entities about the number and\nfrequency of customers, inventory, or orders. Some example include:\n\n    /customer/123\n    /order/308\n\nFrom these, I would conclude that I am only your 123rd customer with the\n308th order. How a customer or competitor would feel about this would\ndiffer. However, the point is do I really want others to know this\ninformation? In addition, by creating another account or order, I can\nestimate the rate of change within your systems.\n\nThis class will help obscure your sequential order by providing a\nreversible transformation to your numbers. By using different salts\nyour transformations will be unique. In addition, the class gives some\noutput helpers for hex, base32, and base64. There is one I call 'tame'\nas it removes the letters i and u to elimination some common offensive\nwords.\n\n# Install\n\nBy far the simplest method is to use pip:\n\n```console\n$ pip install obscure\n```\n\n# Example\n\n$python -m obscure --bits=64 --demo 0 1 2\n\n```python\n\u003e\u003e\u003e from obscure import FeistelCipher, Encoder\n\u003e\u003e\u003e cipher = FeistelCipher(bits=64)\n# For a consistant transformations between instances,give a\n# salt and small prime for the Feistel cipher's round function\n\u003e\u003e\u003e cipher = FeistelCipher(0x1234, 0xc101, bits=64)\n\u003e\u003e\u003e numeric_id = 1234\n\u003e\u003e\u003e cipher(numeric_id)\n249699227\n# Reverse the transformation\n\u003e\u003e\u003e cipher(cipher(numeric_id))\n1234\n# Use an Encoder to wrap the Feistel cipher\n\u003e\u003e\u003e encoder = Encoder(Feistel, \"base32\")\n\u003e\u003e\u003e encoder.encode(numeric_id)\n\"XXX\"\n\u003e\u003e\u003e encoder.decode('XXX\")\n1234\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjidn%2Fobscure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjidn%2Fobscure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjidn%2Fobscure/lists"}