{ "info": { "author": "Amit Upadhyay", "author_email": "upadhyay@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: Information Technology", "Intended Audience :: Other Audience", "Intended Audience :: System Administrators", "Natural Language :: English", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development" ], "description": "django-encrypted-id\n===================\n\n**Note**: Encrypted IDs generated by version 0.3.0 onwards will be different\nfrom those generated by version 0.2.0. But versions 0.3.x will decrypt the IDs\ngenerated by the version 0.2.0.\n\n**Note**: Version 0.2.0 is a breaking change from versions\n`0.1.x `_.\nIf you've been using *ekey* in permalinks, then it is recommended for you to\nnot upgrade to 0.2.x.\n\n----\n\nConsider this example model:\n\n.. code-block:: python\n\n from django.db import models\n\n from encrypted_id.models import EncryptedIDModel\n\n\n class Foo(EncryptedIDModel):\n text = models.TextField()\n\n\nBy inheriting from ``EncryptedIDModel``, you get .ekey as a property on your\nmodel instances. This is how they will look like:\n\n.. code-block:: python\n\n In [1]: from tapp.models import Foo\n\n In [2]: f = Foo.objects.create(text=\"asd\")\n\n In [3]: f.id\n Out[3]: 1\n\n In [4]: f.ekey\n Out[4]: 'bxuZXwM4NdgGauVWR-ueUA'\n You can do reverse lookup:\n\n In [5]: from encrypted_id import decode\n\n In [6]: decode(f.ekey)\n Out[6]: 1\n\nIf you can not inherit from the helper base class, no problem, you can just use\nthe ``ekey()`` function from ``encrypted_id`` package:\n\n.. code-block:: python\n\n In [7]: from encrypted_id import ekey\n\n In [8]: from django.contrib.auth.models import User\n\n In [9]: ekey(User.objects.get(pk=1))\n Out[9]: 'bxuZXwM4NdgGauVWR-ueUA'\n\n\nTo do the reverse lookup, you have two helpers available. First is provided by\n``EncryptedIDManager``, which is used by default if you inherit from\n``EncryptedIDModel``, and have not overwritten the ``.objects``:\n\n.. code-block:: python\n\n In [10]: Foo.objects.get_by_ekey(f.ekey)\n Out[10]: \n\n\nBut sometimes you will prefer the form:\n\n.. code-block:: python\n\n In [11]: Foo.objects.get_by_ekey_or_404(f.ekey)\n Out[11]: \n\n\nWhich works the same, but instead of raising ``DoesNotExist``, it raises\n``Http404``, so it can be used in views.\n\nYou your manager is not inheriting from ``EncryptedIDManager``, you can use:\n\n.. code-block:: python\n\n In [12]: e = ekey(User.objects.first())\n\n In [13]: e\n Out[13]: 'bxuZXwM4NdgGauVWR-ueUA'\n\n In [14]: get_object_or_404(User, e)\n Out[14]: \n\n\n``encrypted_id.get_object_or_404``, as well as\n``EncryptedIDManager.get_by_ekey`` and\n``EncryptedIDManager.get_by_ekey_or_404`` take extra keyword argument, that can\nbe used to filter if you want.\n\nIf you are curious, the regex used to match the generated ids is:\n\n.. code-block:: python\n\n \"[0-9a-zA-Z-_]+\"\n\n\nIf you are using `smarturls `_, you can use URL\npattern like:\n\n.. code-block:: python\n\n \"//\"\n\n\nI recommend this usage of encrypted-id over UUID, as UUIDs have significant\nissues that should be considered (tldr: they take more space on disk and RAM,\nand have inferior indexing than integer ids), and if your goal is simply to\nmake URLs non guessable, encrypted id is a superior approach.\n\nIf you are curious about the encryption used: I am using ``AES``, from\n``pycrypto`` library, and am using ``SECRET_KEY`` for password\n(``SECRET_KEY[:32]``) and ``IV`` (first 16 characters of hash of ``SECRET_KEY``\nand a *sub_key*), in the ``AES.CBC`` mode. The *sub_key* is taken from the\nmodel's ``Meta`` attribute ``ek_key``, or simply ``db_table`` if ``ek_key`` is\nnot set.\n\nIn general it is recommended not to have static ``IV``, but ``CBC`` offsets\nsome of the problems with having static IV. What is the the issue with static\nIV you ask: if plain text \"abc\" and \"abe\" are encrypted, the first two bytes\nwould be same. Now this does not present a serious problem for us, as the\nplain text that I am encrypting uses ``CRC32`` in the beginning of payload, so\neven if you have ids, 1, 11, an attacker can not say they both start with same\nfirst character.\n\nThe library also supports the scenario that you have to cycle ``SECRET_KEY``\ndue to some reason, so URLs encrypted with older ``SECRET_KEY`` can still be\ndecoded after you have changed it (as long as you store old versions in\n``SECRET_KEYS`` setting). In order to decrypt the library tries each secret\nkey, and compares the ``CRC32`` of data to know for sure (as sure as things get\nin such things), that we have decrypted properly.\n\nDo feel free to raise an issue here, if you face any issues, I would be happy\nto help. The library supports both python 2.7 and 3.5, as well as it all\nversions of django that django team supports.\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/amitu/django-encrypted-id", "keywords": "Django", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "django-encrypted-id", "package_url": "https://pypi.org/project/django-encrypted-id/", "platform": "", "project_url": "https://pypi.org/project/django-encrypted-id/", "project_urls": { "Homepage": "https://github.com/amitu/django-encrypted-id" }, "release_url": "https://pypi.org/project/django-encrypted-id/0.3.2/", "requires_dist": null, "requires_python": "", "summary": "Encrypted IDs for Django Models", "version": "0.3.2" }, "last_serial": 4819191, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "30295f33493aafcd3500ea3675fce1bc", "sha256": "b1c45f4cd3b1117909203418596bc03ea663e3f2620c0680de5b4362f1a727d7" }, "downloads": -1, "filename": "django_encrypted_id-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "30295f33493aafcd3500ea3675fce1bc", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4152, "upload_time": "2016-05-02T10:22:58", "url": "https://files.pythonhosted.org/packages/80/7a/b0ed64abd214fdb471ba1b472c73e85787489835351efe33b8079f55a201/django_encrypted_id-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "083d91b307114c9a72f04a77eb74ca40", "sha256": "27fb95bb621fa82eba17549a63cca41aba1fc4593bdafdb4cfa8551d0c3c5072" }, "downloads": -1, "filename": "django-encrypted-id-0.1.0.tar.bz2", "has_sig": false, "md5_digest": "083d91b307114c9a72f04a77eb74ca40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2785, "upload_time": "2016-05-02T10:23:22", "url": "https://files.pythonhosted.org/packages/b2/4a/dfac2090c6258647a6fbf095babfbbfa2bf17b1dd7c997e083ba27b412a4/django-encrypted-id-0.1.0.tar.bz2" }, { "comment_text": "", "digests": { "md5": "62fff340de2a57d8fb45fea1dd36ffe5", "sha256": "4013af2ccc96c4ad55978f52436825d50c9180bf5540ff84381e250f45bd62f0" }, "downloads": -1, "filename": "django-encrypted-id-0.1.0.zip", "has_sig": false, "md5_digest": "62fff340de2a57d8fb45fea1dd36ffe5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5193, "upload_time": "2016-05-02T10:23:37", "url": "https://files.pythonhosted.org/packages/b4/bb/16920dcb3db771699ead091d4b51b74926017a2bcb1213c72ab39ed511aa/django-encrypted-id-0.1.0.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8dfd8f2d8dace54e8cb28540dca55e3d", "sha256": "4d1057b7360b29738fc39b71ba0f589ffb40d00079c69a7145ecc5fa198d3d72" }, "downloads": -1, "filename": "django_encrypted_id-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8dfd8f2d8dace54e8cb28540dca55e3d", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4254, "upload_time": "2016-05-02T13:43:01", "url": "https://files.pythonhosted.org/packages/76/6c/2cb8ff3155e6c52bee4661308c0d1ab632e1cc524ba55c0660c8495d63fa/django_encrypted_id-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ee2e32146507d0150ec708bd4c822f24", "sha256": "bd5cd92f2fd1b0d2fe99660edadbaed1567efa214c68f19d3a0f7f28a78c1153" }, "downloads": -1, "filename": "django-encrypted-id-0.1.1.tar.bz2", "has_sig": false, "md5_digest": "ee2e32146507d0150ec708bd4c822f24", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2846, "upload_time": "2016-05-02T13:43:15", "url": "https://files.pythonhosted.org/packages/fd/55/3da4e2b785947af841bbf402a78edc252d7d18abb1278a5954029508804e/django-encrypted-id-0.1.1.tar.bz2" }, { "comment_text": "", "digests": { "md5": "5a094f80571961b0ac0610afdd5d7544", "sha256": "cd61d25888e9caa4ce33059381d56cc77f66489a47f9ca52feede94d9033a67d" }, "downloads": -1, "filename": "django-encrypted-id-0.1.1.zip", "has_sig": false, "md5_digest": "5a094f80571961b0ac0610afdd5d7544", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5475, "upload_time": "2016-05-02T13:43:22", "url": "https://files.pythonhosted.org/packages/67/18/b6bb4f1866d9b16202a2a7d8a8df9348aa01dbb5b0945e36654117661f9d/django-encrypted-id-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "82988b111484ba76cb0b306340340eaa", "sha256": "ed140c4e74ec53f8329b443ae1bd0ea82b8d14a0127ae8e5438147109eaf38f7" }, "downloads": -1, "filename": "django_encrypted_id-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "82988b111484ba76cb0b306340340eaa", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7670, "upload_time": "2016-05-30T12:36:15", "url": "https://files.pythonhosted.org/packages/61/f2/eca6e66073a87443605510386dec72d4649d904aceacfed0673408e8962e/django_encrypted_id-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "65a62ddf926eaad50e966ad9c5a9da13", "sha256": "3048c882980080540cedb2c5c190662a6844959e5be3eab677de26325f1d54ee" }, "downloads": -1, "filename": "django-encrypted-id-0.1.2.tar.bz2", "has_sig": false, "md5_digest": "65a62ddf926eaad50e966ad9c5a9da13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5260, "upload_time": "2016-05-30T12:36:20", "url": "https://files.pythonhosted.org/packages/10/36/4832872d0403184fe52076aa20497d715d438d8837821afb9096e899e524/django-encrypted-id-0.1.2.tar.bz2" }, { "comment_text": "", "digests": { "md5": "aca5b983ed1154029e7862ec2b40ba59", "sha256": "2e5e5335f52ccb9d2a246830bf5fee4af1a1b59c7b6cfad7a3e37090a707a941" }, "downloads": -1, "filename": "django-encrypted-id-0.1.2.zip", "has_sig": false, "md5_digest": "aca5b983ed1154029e7862ec2b40ba59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10732, "upload_time": "2016-05-30T12:36:26", "url": "https://files.pythonhosted.org/packages/7a/85/643e72b6dc23a7091f44ad92176adf1086e1bdb7c7d83277c07b78334bc3/django-encrypted-id-0.1.2.zip" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "31a3776d302ade7dc8289da211f87a78", "sha256": "59ae1b8953dbd6d642eed87c5bbd199abe577d0c69445755473b6a18c44b3a77" }, "downloads": -1, "filename": "django_encrypted_id-0.1.3-py2.7.egg", "has_sig": false, "md5_digest": "31a3776d302ade7dc8289da211f87a78", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 7112, "upload_time": "2017-05-10T17:28:32", "url": "https://files.pythonhosted.org/packages/e3/a7/8dbaa8eb05492c1c181ff4e6223ca73d978f50206c45d1612e65c96a69e0/django_encrypted_id-0.1.3-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "bb9f43e5acdbbe366f5ffbc7298803cf", "sha256": "d653bad2e1d3a1475a63f3809a93f34545fd3c7f03e6a2415edcc272c83feb13" }, "downloads": -1, "filename": "django_encrypted_id-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bb9f43e5acdbbe366f5ffbc7298803cf", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7684, "upload_time": "2017-05-10T17:28:36", "url": "https://files.pythonhosted.org/packages/ef/6a/7b3631da5355f80a772bdf601771276ed69e8587e9e6cfa7d02d10897df1/django_encrypted_id-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0c1899130096590e1e112a1c8b4aea2a", "sha256": "44b2039270424639edd02340af992a1ccebf08bf3901459470b965c2cff8a1c5" }, "downloads": -1, "filename": "django-encrypted-id-0.1.3.tar.bz2", "has_sig": false, "md5_digest": "0c1899130096590e1e112a1c8b4aea2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5289, "upload_time": "2017-05-10T17:28:40", "url": "https://files.pythonhosted.org/packages/b7/92/75d168268c06c7890cd3d9516347764b85c2cc7b1ea5cba636781d152167/django-encrypted-id-0.1.3.tar.bz2" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "30cc9023ede6667d3e6013034f192c3b", "sha256": "632b6ac72c62f1e89c8fcd22ffdb355ae0ed3b6656c58e224d4c7336de7f648f" }, "downloads": -1, "filename": "django_encrypted_id-0.2.0-py2.7.egg", "has_sig": false, "md5_digest": "30cc9023ede6667d3e6013034f192c3b", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 8526, "upload_time": "2017-06-12T13:29:33", "url": "https://files.pythonhosted.org/packages/6e/b2/f07e4f2d4e3106b1676479688256d10ca79cd7a2f2839a0ccd850dabe7cd/django_encrypted_id-0.2.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "552c4c48d6705fa88e90cb77a4e78404", "sha256": "005cef7d8417bcf4b1bb4089c8787e3962019cbae05e1b8d5b0240ca2c0c972a" }, "downloads": -1, "filename": "django_encrypted_id-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "552c4c48d6705fa88e90cb77a4e78404", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8447, "upload_time": "2017-06-12T13:29:37", "url": "https://files.pythonhosted.org/packages/38/09/b0b9234486e87cfcd7a95ac8ceaa7e390825546b9589723a6bd08cdbf2ec/django_encrypted_id-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8379b9c461c23bc39e382439da238bca", "sha256": "20d97f8fedaad8170ea2fc6f6c22fa5aa5cf3952892035b06510090e1ecbf57f" }, "downloads": -1, "filename": "django-encrypted-id-0.2.0.tar.bz2", "has_sig": false, "md5_digest": "8379b9c461c23bc39e382439da238bca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5851, "upload_time": "2017-06-12T13:29:41", "url": "https://files.pythonhosted.org/packages/04/1e/27a70742a8a1a1318f6957cb3d48f271f270f2280312f43a726cce05c8ca/django-encrypted-id-0.2.0.tar.bz2" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "46e954bfc4e43457a910715a10228880", "sha256": "862b9b71d700f2c0e96ddfb1659b4009b3e13b383b8bb9c7309a48a14e6fea22" }, "downloads": -1, "filename": "django_encrypted_id-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "46e954bfc4e43457a910715a10228880", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 5626, "upload_time": "2018-06-01T14:17:56", "url": "https://files.pythonhosted.org/packages/7a/bf/c91e94fce5eca2285fedd8dc1792f6fb7f1d0b709dec1e5b86424092adc1/django_encrypted_id-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c4a395ba7f205b4c3537ee78268adb35", "sha256": "9740e72dfef8038ad0df0562d477261cd51ff5c3a197f21cfa5ca8c9e6b40ca6" }, "downloads": -1, "filename": "django-encrypted-id-0.3.0.tar.bz2", "has_sig": false, "md5_digest": "c4a395ba7f205b4c3537ee78268adb35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6073, "upload_time": "2018-06-01T14:17:59", "url": "https://files.pythonhosted.org/packages/7e/e8/650185e1842e12a381f73339c40bb98f559af153d395fdb6cb06ec221a1c/django-encrypted-id-0.3.0.tar.bz2" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "1da3ed9b0ceca1be4bec3f28caff3c0d", "sha256": "ecbb21a92225ae3c286aa10df25557772e2cd78bdb6f43b0d3c62f515fea365d" }, "downloads": -1, "filename": "django_encrypted_id-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1da3ed9b0ceca1be4bec3f28caff3c0d", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 5661, "upload_time": "2018-06-19T12:58:56", "url": "https://files.pythonhosted.org/packages/37/e3/b9d574d8c9f1a23ad2474d325c226229edbbd22402d52320fb8f15a374cd/django_encrypted_id-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7e0d8bcf27a76000e17ffea50b5f8b0b", "sha256": "4f37a9ee92bbf2ef14802589e2d4f30ca8ba8e72bac622a31cb598ac211b14b6" }, "downloads": -1, "filename": "django-encrypted-id-0.3.1.tar.bz2", "has_sig": false, "md5_digest": "7e0d8bcf27a76000e17ffea50b5f8b0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6049, "upload_time": "2018-06-19T12:59:00", "url": "https://files.pythonhosted.org/packages/4c/91/803e9d3f814be351e87c729cad860952432ed40ceebb7a42bbe6a3a059e5/django-encrypted-id-0.3.1.tar.bz2" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "c9708d6a13d38c096eb38f464df533fc", "sha256": "9ec99c9f123e63a939f68d4b30dd6a33e07eceb81f442b20c940b60c62f3e976" }, "downloads": -1, "filename": "django_encrypted_id-0.3.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c9708d6a13d38c096eb38f464df533fc", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 5678, "upload_time": "2019-02-14T07:22:04", "url": "https://files.pythonhosted.org/packages/6f/1b/367adb7ad3796f7b04be87d8b9aa1b54e8f03c943d248e3f17d967361466/django_encrypted_id-0.3.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ce1a8ff633e330e6b068ad1c0d742ee6", "sha256": "11aebdf3867f79100fba739d161a72d78b30da204c1b1ccc2288eb4a0f854437" }, "downloads": -1, "filename": "django-encrypted-id-0.3.2.tar.bz2", "has_sig": false, "md5_digest": "ce1a8ff633e330e6b068ad1c0d742ee6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6089, "upload_time": "2019-02-14T07:22:07", "url": "https://files.pythonhosted.org/packages/d5/53/e50ad82b8db8d5836ca387cd0c4646f943b4e8a1b5b37205573fe0594a57/django-encrypted-id-0.3.2.tar.bz2" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c9708d6a13d38c096eb38f464df533fc", "sha256": "9ec99c9f123e63a939f68d4b30dd6a33e07eceb81f442b20c940b60c62f3e976" }, "downloads": -1, "filename": "django_encrypted_id-0.3.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c9708d6a13d38c096eb38f464df533fc", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 5678, "upload_time": "2019-02-14T07:22:04", "url": "https://files.pythonhosted.org/packages/6f/1b/367adb7ad3796f7b04be87d8b9aa1b54e8f03c943d248e3f17d967361466/django_encrypted_id-0.3.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ce1a8ff633e330e6b068ad1c0d742ee6", "sha256": "11aebdf3867f79100fba739d161a72d78b30da204c1b1ccc2288eb4a0f854437" }, "downloads": -1, "filename": "django-encrypted-id-0.3.2.tar.bz2", "has_sig": false, "md5_digest": "ce1a8ff633e330e6b068ad1c0d742ee6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6089, "upload_time": "2019-02-14T07:22:07", "url": "https://files.pythonhosted.org/packages/d5/53/e50ad82b8db8d5836ca387cd0c4646f943b4e8a1b5b37205573fe0594a57/django-encrypted-id-0.3.2.tar.bz2" } ] }