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 | |
Alex Gaynor | 292902e | 2014-01-08 15:18:52 -0800 | [diff] [blame] | 11 | You can install ``cryptography`` with ``pip``: |
Alex Gaynor | 31df535 | 2013-12-12 18:03:26 -0800 | [diff] [blame] | 12 | |
| 13 | .. code-block:: console |
| 14 | |
Alex Gaynor | 292902e | 2014-01-08 15:18:52 -0800 | [diff] [blame] | 15 | $ pip install cryptography |
Alex Gaynor | c62e91f | 2013-08-06 19:25:52 -0700 | [diff] [blame] | 16 | |
Alex Gaynor | a8fc6f3 | 2014-01-23 10:48:16 -0600 | [diff] [blame^] | 17 | .. note:: |
| 18 | |
| 19 | If you're on Windows you'll need to make sure you have OpenSSL installed. |
| 20 | There are `pre-compiled binaries`_ available. |
| 21 | |
| 22 | |
Alex Gaynor | 9f3468d | 2013-08-11 08:17:48 -0400 | [diff] [blame] | 23 | Why a new crypto library for Python? |
| 24 | ------------------------------------ |
| 25 | |
Alex Gaynor | 31df535 | 2013-12-12 18:03:26 -0800 | [diff] [blame] | 26 | If you've done cryptographic work in Python before, you've probably seen some |
| 27 | other libraries in Python, such as *M2Crypto*, *PyCrypto*, or *PyOpenSSL*. In |
| 28 | building ``cryptography`` we wanted to address a few issues we observed in the |
| 29 | existing libraries: |
Alex Gaynor | 9f3468d | 2013-08-11 08:17:48 -0400 | [diff] [blame] | 30 | |
Alex Gaynor | d8d91d4 | 2013-08-12 09:33:18 -0400 | [diff] [blame] | 31 | * Lack of PyPy and Python 3 support. |
Alex Gaynor | d6bef56 | 2013-08-11 09:09:28 -0400 | [diff] [blame] | 32 | * Lack of maintenance. |
Alex Gaynor | ec4ba73 | 2013-08-11 08:19:05 -0400 | [diff] [blame] | 33 | * 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] | 34 | attacks). |
| 35 | * Lack of high level, "Cryptography for humans", APIs. |
| 36 | * Absence of algorithms such as AES-GCM. |
| 37 | * Poor introspectability, and thus poor testability. |
Alex Gaynor | f0d139a | 2013-08-11 09:13:27 -0400 | [diff] [blame] | 38 | * Extremely error prone APIs, and bad defaults. |
Alex Gaynor | 9f3468d | 2013-08-11 08:17:48 -0400 | [diff] [blame] | 39 | |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 40 | Layout |
| 41 | ------ |
Alex Gaynor | 9f3468d | 2013-08-11 08:17:48 -0400 | [diff] [blame] | 42 | |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 43 | ``cryptography`` is broadly divided into two levels. One with safe |
| 44 | cryptographic recipes, "cryptography for humans" if you will. These are safe |
| 45 | and easy to use and don't require developers to make many decisions. |
| 46 | |
| 47 | The other level is low-level cryptographic primitives. These are often |
| 48 | dangerous and can be used incorrectly. They require making decisions and having |
| 49 | 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] | 50 | 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] | 51 | "hazardous materials" or "hazmat" layer. These live in the |
Alex Gaynor | d8614a2 | 2014-01-01 08:22:40 -0800 | [diff] [blame] | 52 | ``cryptography.hazmat`` package, and their documentation will always contain an |
Alex Gaynor | 77762bc | 2014-01-01 07:53:48 -0800 | [diff] [blame] | 53 | admonition at the top. |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 54 | |
| 55 | We recommend using the recipes layer whenever possible, and falling back to the |
| 56 | hazmat layer only when necessary. |
| 57 | |
| 58 | The recipes layer |
| 59 | ~~~~~~~~~~~~~~~~~ |
Alex Gaynor | c62e91f | 2013-08-06 19:25:52 -0700 | [diff] [blame] | 60 | |
| 61 | .. toctree:: |
Alex Gaynor | 1abfac7 | 2013-08-07 12:59:04 -0700 | [diff] [blame] | 62 | :maxdepth: 2 |
| 63 | |
Alex Gaynor | 333fb10 | 2013-10-31 10:27:35 -0700 | [diff] [blame] | 64 | fernet |
Alex Gaynor | f1a3fc0 | 2013-11-02 14:03:34 -0700 | [diff] [blame] | 65 | exceptions |
Alex Gaynor | 8c9dcb3 | 2013-11-03 13:10:57 -0800 | [diff] [blame] | 66 | glossary |
Donald Stufft | f04317a | 2013-10-27 16:44:30 -0400 | [diff] [blame] | 67 | |
Alex Gaynor | 2cfbc12 | 2013-12-16 10:19:00 -0800 | [diff] [blame] | 68 | The hazardous materials layer |
| 69 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Donald Stufft | f04317a | 2013-10-27 16:44:30 -0400 | [diff] [blame] | 70 | |
| 71 | .. toctree:: |
| 72 | :maxdepth: 2 |
| 73 | |
| 74 | hazmat/primitives/index |
Alex Gaynor | f8796b1 | 2013-12-13 20:28:55 -0800 | [diff] [blame] | 75 | hazmat/backends/index |
Alex Stapleton | c368ac2 | 2013-12-31 13:43:38 +0000 | [diff] [blame] | 76 | hazmat/bindings/index |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 77 | |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 78 | The ``cryptography`` open source project |
| 79 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 80 | |
| 81 | .. toctree:: |
| 82 | :maxdepth: 2 |
| 83 | |
| 84 | contributing |
| 85 | security |
Alex Gaynor | 1a9bbf2 | 2013-12-24 10:59:50 -0800 | [diff] [blame] | 86 | api-stability |
Alex Gaynor | 89063f6 | 2014-01-06 15:52:38 -0800 | [diff] [blame] | 87 | doing-a-release |
Alex Gaynor | 3f23040 | 2014-01-08 09:21:57 -0800 | [diff] [blame] | 88 | changelog |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 89 | community |
Alex Gaynor | a8fc6f3 | 2014-01-23 10:48:16 -0600 | [diff] [blame^] | 90 | |
| 91 | |
| 92 | .. _`pre-compiled binaries`: http://slproweb.com/products/Win32OpenSSL.html |