blob: 13f2d7d11189cb35cb5dfa3a04526c4ad407c2b4 [file] [log] [blame]
Paul Kehrer1adb9aa2017-05-23 23:39:07 -07001pyca/cryptography
2=================
Alex Gaynor8d7fb752013-08-06 19:30:47 -07003
Jiangge Zhang739e0fa2015-06-08 16:00:09 +08004.. image:: https://img.shields.io/pypi/v/cryptography.svg
Alex Gaynor3414f5c2018-04-15 19:41:11 -04005 :target: https://pypi.org/project/cryptography/
Matt Iversen09347622014-05-20 02:47:22 +10006 :alt: Latest Version
7
Paul Kehrer77beba932014-09-27 11:41:32 -05008.. image:: https://readthedocs.org/projects/cryptography/badge/?version=latest
9 :target: https://cryptography.io
10 :alt: Latest Docs
11
Paul Kehrera7fd4602014-03-24 07:22:47 -040012.. image:: https://travis-ci.org/pyca/cryptography.svg?branch=master
Alex Gaynor45afb352013-11-05 16:29:00 -080013 :target: https://travis-ci.org/pyca/cryptography
14
Corey Farwell32c261c2014-10-08 00:12:38 -040015.. image:: https://codecov.io/github/pyca/cryptography/coverage.svg?branch=master
16 :target: https://codecov.io/github/pyca/cryptography?branch=master
Alex Gaynor45afb352013-11-05 16:29:00 -080017
Hynek Schlawackf30db512013-08-07 20:50:05 +020018
Alex Gaynor01ba7b72014-03-02 20:06:00 -080019``cryptography`` is a package which provides cryptographic recipes and
Alex Gaynor872cd972014-02-10 18:52:47 -080020primitives to Python developers. Our goal is for it to be your "cryptographic
Paul Kehrer4cf6e782017-10-12 06:06:01 +080021standard library". It supports Python 2.7, Python 3.4+, and PyPy 5.3+.
Alex Gaynor7a6b5cb2013-08-07 09:56:34 -070022
Paul Kehrerbf7b8de2017-05-24 13:33:39 -070023``cryptography`` includes both high level recipes and low level interfaces to
24common cryptographic algorithms such as symmetric ciphers, message digests, and
Alex Gaynorc0469912014-02-11 14:21:46 -080025key derivation functions. For example, to encrypt something with
26``cryptography``'s high level symmetric encryption recipe:
Alex Gaynor872cd972014-02-10 18:52:47 -080027
Alex Gaynor99936992014-02-11 14:10:37 -080028.. code-block:: pycon
Alex Gaynor872cd972014-02-10 18:52:47 -080029
30 >>> from cryptography.fernet import Fernet
31 >>> # Put this somewhere safe!
32 >>> key = Fernet.generate_key()
33 >>> f = Fernet(key)
34 >>> token = f.encrypt(b"A really secret message. Not for prying eyes.")
35 >>> token
36 '...'
37 >>> f.decrypt(token)
38 'A really secret message. Not for prying eyes.'
Alex Gaynor7a6b5cb2013-08-07 09:56:34 -070039
Donald Stufftbf9df012013-10-19 22:39:44 -040040You can find more information in the `documentation`_.
41
Alex Gaynor42dae6d2016-09-12 22:07:37 -040042You can install ``cryptography`` with:
43
44.. code-block:: console
45
46 $ pip install cryptography
47
48For full details see `the installation documentation`_.
49
Paul Kehrerc01ddc82013-10-07 15:58:33 -050050Discussion
51~~~~~~~~~~
52
Alex Gaynora11e74c2014-02-01 16:25:56 -080053If you run into bugs, you can file them in our `issue tracker`_.
54
Paul Kehrerc01ddc82013-10-07 15:58:33 -050055We maintain a `cryptography-dev`_ mailing list for development discussion.
56
Alex Gaynore21e14a2013-10-22 14:25:49 -070057You can also join ``#cryptography-dev`` on Freenode to ask questions or get
58involved.
Paul Kehrerc01ddc82013-10-07 15:58:33 -050059
Alex Gaynor3fe869f2017-10-28 20:14:42 -040060Security
61~~~~~~~~
62
63Need to report a security issue? Please consult our `security reporting`_
64documentation.
65
Alex Gaynore21e14a2013-10-22 14:25:49 -070066
67.. _`documentation`: https://cryptography.io/
Alex Gaynor42dae6d2016-09-12 22:07:37 -040068.. _`the installation documentation`: https://cryptography.io/en/latest/installation/
Alex Gaynora11e74c2014-02-01 16:25:56 -080069.. _`issue tracker`: https://github.com/pyca/cryptography/issues
Paul Kehrerc01ddc82013-10-07 15:58:33 -050070.. _`cryptography-dev`: https://mail.python.org/mailman/listinfo/cryptography-dev
Alex Gaynor3fe869f2017-10-28 20:14:42 -040071.. _`security reporting`: https://cryptography.io/en/latest/security/