{ "info": { "author": "Dimitris Karakostas", "author_email": "dimit.karakostas@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Flask", "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": "flask-ctx\n==============\n\nA simple integration of the CTX defense against side-channel attacks for Flask projects.\n\nRequirements\n============\n\n- Python 2.5+\n- Flask 0.10+\n- ctx-defense\n\nInstallation\n============\n\n- Install the latest stable version using ``pip``:\n\n```sh\npip install flask-ctx\n```\n\nConfiguration\n=============\n\n- Import the *ctx_processor* function from ctx's context processors:\n```python\nfrom flask_ctx.context_processors import ctx_processor\n```\n\n- Add the *ctx_processor* in the application's context processors:\n```python\napp.context_processor(ctx_processor)\n```\n\nBasic Usage\n===========\n\n- Use the *ctx_protect* function 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 the [ASCII_printable](https://docs.python.org/2/library/string.html#string.printable) characters.\n\n- Add the *ctx_permutations* function to include the used permutations for each\n origin:\n```html\n{{ ctx_permutations() }}\n```\n\nThe *ctx_permutations* function needs to run after all *ctx_protect* calls\nthat use an origin for the first time. It is proposed that it is included\nbefore the *
\n This is a very sensitive secret: {{ ctx_protect(\"a secret\", \"origin1\") }}\n This is another very sensitive secret: {{ ctx_protect(\"another secret\", \"origin2\") }}\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\n```html\n\n\n\n\n
\n \n
\n\n\n
\n\n