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 | 59a6bc6 | 2014-02-18 18:13:48 -0800 | [diff] [blame] | 36 | |
| 37 | .. _cryptography-layout: |
| 38 | |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 39 | Layout |
| 40 | ------ |
Alex Gaynor | 9f3468d | 2013-08-11 08:17:48 -0400 | [diff] [blame] | 41 | |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 42 | ``cryptography`` is broadly divided into two levels. One with safe |
| 43 | cryptographic recipes, "cryptography for humans" if you will. These are safe |
| 44 | and easy to use and don't require developers to make many decisions. |
| 45 | |
| 46 | The other level is low-level cryptographic primitives. These are often |
| 47 | dangerous and can be used incorrectly. They require making decisions and having |
| 48 | 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] | 49 | 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] | 50 | "hazardous materials" or "hazmat" layer. These live in the |
Alex Gaynor | d8614a2 | 2014-01-01 08:22:40 -0800 | [diff] [blame] | 51 | ``cryptography.hazmat`` package, and their documentation will always contain an |
Alex Gaynor | 77762bc | 2014-01-01 07:53:48 -0800 | [diff] [blame] | 52 | admonition at the top. |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 53 | |
| 54 | We recommend using the recipes layer whenever possible, and falling back to the |
| 55 | hazmat layer only when necessary. |
| 56 | |
| 57 | The recipes layer |
| 58 | ~~~~~~~~~~~~~~~~~ |
Alex Gaynor | c62e91f | 2013-08-06 19:25:52 -0700 | [diff] [blame] | 59 | |
| 60 | .. toctree:: |
Alex Gaynor | 1abfac7 | 2013-08-07 12:59:04 -0700 | [diff] [blame] | 61 | :maxdepth: 2 |
| 62 | |
Alex Gaynor | 333fb10 | 2013-10-31 10:27:35 -0700 | [diff] [blame] | 63 | fernet |
Alex Gaynor | 2a70f91 | 2014-02-06 09:47:07 -0800 | [diff] [blame] | 64 | random-numbers |
Alex Gaynor | f1a3fc0 | 2013-11-02 14:03:34 -0700 | [diff] [blame] | 65 | exceptions |
Alex Gaynor | de06b29 | 2014-02-18 16:40:09 -0800 | [diff] [blame] | 66 | faq |
Alex Gaynor | 8c9dcb3 | 2013-11-03 13:10:57 -0800 | [diff] [blame] | 67 | glossary |
Donald Stufft | f04317a | 2013-10-27 16:44:30 -0400 | [diff] [blame] | 68 | |
Alex Gaynor | 2cfbc12 | 2013-12-16 10:19:00 -0800 | [diff] [blame] | 69 | The hazardous materials layer |
| 70 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Donald Stufft | f04317a | 2013-10-27 16:44:30 -0400 | [diff] [blame] | 71 | |
| 72 | .. toctree:: |
| 73 | :maxdepth: 2 |
| 74 | |
| 75 | hazmat/primitives/index |
Alex Gaynor | f8796b1 | 2013-12-13 20:28:55 -0800 | [diff] [blame] | 76 | hazmat/backends/index |
Alex Stapleton | c368ac2 | 2013-12-31 13:43:38 +0000 | [diff] [blame] | 77 | hazmat/bindings/index |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 78 | |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 79 | The ``cryptography`` open source project |
| 80 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 81 | |
| 82 | .. toctree:: |
| 83 | :maxdepth: 2 |
| 84 | |
skeuomorf | b0293bf | 2014-01-29 21:41:02 +0200 | [diff] [blame] | 85 | installation |
Paul Kehrer | 0839aa8 | 2014-02-11 22:36:51 -0600 | [diff] [blame] | 86 | development/index |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 87 | security |
Alex Stapleton | 68bba2d | 2014-03-22 23:03:15 +0000 | [diff] [blame] | 88 | limitations |
Alex Gaynor | 1a9bbf2 | 2013-12-24 10:59:50 -0800 | [diff] [blame] | 89 | api-stability |
Alex Gaynor | 89063f6 | 2014-01-06 15:52:38 -0800 | [diff] [blame] | 90 | doing-a-release |
Alex Gaynor | 3f23040 | 2014-01-08 09:21:57 -0800 | [diff] [blame] | 91 | changelog |
Alex Gaynor | 7c06746 | 2013-12-16 10:11:00 -0800 | [diff] [blame] | 92 | community |
Alex Gaynor | a8fc6f3 | 2014-01-23 10:48:16 -0600 | [diff] [blame] | 93 | |
| 94 | |
Alex Gaynor | 92ddd76 | 2014-03-03 19:39:40 -0800 | [diff] [blame] | 95 | .. note:: |
| 96 | |
| 97 | ``cryptography`` has not been subjected to an external audit of its code or |
| 98 | documentation. If you're interested in discussing an audit please |
Alex Gaynor | 0df8c97 | 2014-03-03 19:43:50 -0800 | [diff] [blame] | 99 | :doc:`get in touch </community>`. |
Alex Gaynor | 92ddd76 | 2014-03-03 19:39:40 -0800 | [diff] [blame] | 100 | |
Alex Gaynor | e7651de | 2014-01-23 11:34:35 -0600 | [diff] [blame] | 101 | .. _`pre-compiled binaries`: https://www.openssl.org/related/binaries.html |