{ "info": { "author": "Dimitris Karakostas", "author_email": "dimit.karakostas@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Security", "Topic :: Security :: Cryptography" ], "description": "django-ctx\n==============\n\nA simple integration of the CTX defense against side-channel attacks for Django projects.\n\nRequirements\n============\n\n- Python 2.5+\n- Django 1.9+\n- ctx-defense\n\nInstallation\n============\n\n- Install the latest stable version using ``pip``:\n\n```sh\npip install django-ctx\n```\n\nConfiguration\n=============\n\n- Add ctx to your *INSTALLED_APPS* setting:\n```python\nINSTALLED_APPS = (\n ...\n 'django_ctx',\n)\n```\n\n- Ctx processes the *context* for template requests, which is implemented using a\n *context processor*. Add the ctx processor to your *context_processors* setting:\n```python\ncontext_processors = (\n ...\n 'django_ctx.context_processors.ctx_protect',\n)\n```\n\nBasic Usage\n===========\n\n- Load the ctx tag library:\n```html\n{% load ctx_tags %}\n```\n\n- Use the *ctx_protect* tag to use ctx on secrets:\n```html\n{% ctx_protect secret origin alphabet %}\n```\n\n*secret* is a string containing the secret that needs to be protected and *origin*\nis a string uniquely identifying the CTX origin for the secret. *alphabet* is\nan optional argument to define the alphabet that the secret belongs to, default\nbeing 'ASCII' which refers to the [ASCII\nprintable](https://docs.python.org/2/library/string.html#string.printable) characters.\n\n- Add the *ctx_permutations* tag to include the used permutations for each\n origin:\n```html\n{% ctx_permutations %}\n```\n The *ctx_permutations* tag needs to be included after all *ctx_protect* tags\n that use an origin for the first time. It is proposed that it is included\n before the *
\n {% load ctx_tags %}\n\n This is a very sensitive secret from origin1: {% ctx_protect \"my secret\" \"origin1\" %}\n This is another very sensitive secret from origin2: {% ctx_protect \"my other secret\" \"origin2\" \"ASCII_printable\" %}\n\n {% ctx_permutations %}\n \n* HTML tag.\n\n- Include the ctx *client script* in the template:\n```html\n\n```\n\nExample\n=======\n```html\n\n\n\n\n
\n \n
\n\n\n
\n\n