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