Alex Gaynor | 1abfac7 | 2013-08-07 12:59:04 -0700 | [diff] [blame] | 1 | Welcome to ``cryptography`` |
| 2 | =========================== |
| 3 | |
Alex Gaynor | 66ba601 | 2013-10-28 10:11:21 -0700 | [diff] [blame] | 4 | ``cryptography`` is a Python library which exposes cryptographic recipes and |
Alex Gaynor | 31df535 | 2013-12-12 18:03:26 -0800 | [diff] [blame] | 5 | primitives. We hope it'll be your one-stop-shop for all your cryptographic |
| 6 | needs in Python. |
| 7 | |
| 8 | Installing |
| 9 | ---------- |
| 10 | |
| 11 | We don't yet have a release on PyPI, for now you can install ``cryptography`` |
| 12 | directly from Github: |
| 13 | |
| 14 | .. code-block:: console |
| 15 | |
| 16 | $ pip install git+https://github.com/pyca/cryptography |
Alex Gaynor | c62e91f | 2013-08-06 19:25:52 -0700 | [diff] [blame] | 17 | |
Alex Gaynor | 9f3468d | 2013-08-11 08:17:48 -0400 | [diff] [blame] | 18 | Why a new crypto library for Python? |
| 19 | ------------------------------------ |
| 20 | |
Alex Gaynor | 31df535 | 2013-12-12 18:03:26 -0800 | [diff] [blame] | 21 | If you've done cryptographic work in Python before, you've probably seen some |
| 22 | other libraries in Python, such as *M2Crypto*, *PyCrypto*, or *PyOpenSSL*. In |
| 23 | building ``cryptography`` we wanted to address a few issues we observed in the |
| 24 | existing libraries: |
Alex Gaynor | 9f3468d | 2013-08-11 08:17:48 -0400 | [diff] [blame] | 25 | |
Alex Gaynor | d8d91d4 | 2013-08-12 09:33:18 -0400 | [diff] [blame] | 26 | * Lack of PyPy and Python 3 support. |
Alex Gaynor | d6bef56 | 2013-08-11 09:09:28 -0400 | [diff] [blame] | 27 | * Lack of maintenance. |
Alex Gaynor | ec4ba73 | 2013-08-11 08:19:05 -0400 | [diff] [blame] | 28 | * Use of poor implementations of algorithms (i.e. ones with known side-channel |
Alex Gaynor | d6bef56 | 2013-08-11 09:09:28 -0400 | [diff] [blame] | 29 | attacks). |
| 30 | * Lack of high level, "Cryptography for humans", APIs. |
| 31 | * Absence of algorithms such as AES-GCM. |
| 32 | * Poor introspectability, and thus poor testability. |
Alex Gaynor | f0d139a | 2013-08-11 09:13:27 -0400 | [diff] [blame] | 33 | * Extremely error prone APIs, and bad defaults. |
Alex Gaynor | 9f3468d | 2013-08-11 08:17:48 -0400 | [diff] [blame] | 34 | |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 35 | Layout |
| 36 | ------ |
Alex Gaynor | 9f3468d | 2013-08-11 08:17:48 -0400 | [diff] [blame] | 37 | |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 38 | ``cryptography`` is broadly divided into two levels. One with safe |
| 39 | cryptographic recipes, "cryptography for humans" if you will. These are safe |
| 40 | and easy to use and don't require developers to make many decisions. |
| 41 | |
| 42 | The other level is low-level cryptographic primitives. These are often |
| 43 | dangerous and can be used incorrectly. They require making decisions and having |
| 44 | an in-depth knowledge of the cryptographic concepts at work. Because of the |
Alex Gaynor | df8bfea | 2013-12-16 10:17:48 -0800 | [diff] [blame] | 45 | potential danger in working at this level, this is referred to as the |
Alex Gaynor | 77762bc | 2014-01-01 07:53:48 -0800 | [diff] [blame] | 46 | "hazardous materials" or "hazmat" layer. These live in the |
Alex Gaynor | d8614a2 | 2014-01-01 08:22:40 -0800 | [diff] [blame] | 47 | ``cryptography.hazmat`` package, and their documentation will always contain an |
Alex Gaynor | 77762bc | 2014-01-01 07:53:48 -0800 | [diff] [blame] | 48 | admonition at the top. |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 49 | |
| 50 | We recommend using the recipes layer whenever possible, and falling back to the |
| 51 | hazmat layer only when necessary. |
| 52 | |
| 53 | The recipes layer |
| 54 | ~~~~~~~~~~~~~~~~~ |
Alex Gaynor | c62e91f | 2013-08-06 19:25:52 -0700 | [diff] [blame] | 55 | |
| 56 | .. toctree:: |
Alex Gaynor | 1abfac7 | 2013-08-07 12:59:04 -0700 | [diff] [blame] | 57 | :maxdepth: 2 |
| 58 | |
Alex Gaynor | f1a3fc0 | 2013-11-02 14:03:34 -0700 | [diff] [blame] | 59 | exceptions |
Alex Gaynor | 8c9dcb3 | 2013-11-03 13:10:57 -0800 | [diff] [blame] | 60 | glossary |
Donald Stufft | f04317a | 2013-10-27 16:44:30 -0400 | [diff] [blame] | 61 | |
Alex Gaynor | 2cfbc12 | 2013-12-16 10:19:00 -0800 | [diff] [blame] | 62 | The hazardous materials layer |
| 63 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Donald Stufft | f04317a | 2013-10-27 16:44:30 -0400 | [diff] [blame] | 64 | |
| 65 | .. toctree:: |
| 66 | :maxdepth: 2 |
| 67 | |
| 68 | hazmat/primitives/index |
Alex Gaynor | f8796b1 | 2013-12-13 20:28:55 -0800 | [diff] [blame] | 69 | hazmat/backends/index |
Alex Stapleton | c368ac2 | 2013-12-31 13:43:38 +0000 | [diff] [blame] | 70 | hazmat/bindings/index |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 71 | |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 72 | The ``cryptography`` open source project |
| 73 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 74 | |
| 75 | .. toctree:: |
| 76 | :maxdepth: 2 |
| 77 | |
| 78 | contributing |
| 79 | security |
Alex Gaynor | 1a9bbf2 | 2013-12-24 10:59:50 -0800 | [diff] [blame] | 80 | api-stability |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 81 | community |