cryptography is a package designed to expose cryptographic primitives and recipes to Python developers.
Failed to load latest commit information.
.github Use a checklist for bumping openssl version (#4221) May 9, 2018
.jenkins switch cryptography wheel builders back to pip wheel (#4334) Jul 14, 2018
.travis Fixes #4459 -- switch all our builds to xenial on travis (#4486) Oct 9, 2018
docs Enhance info on pip requirements intallation (#4499) Oct 19, 2018
src Remove branch for old libressl versions that we don't support any more ( Oct 20, 2018
tests OCSP response serialization (#4482) Oct 7, 2018
vectors add OCSP request with a request extension (nonce) (#4462) Sep 7, 2018
.coveragerc properly merge pypy coverage with coveragerc paths Jan 7, 2016
.gitignore Add bindings for SSL_OP_NO_DTLS* (#4079) Jan 16, 2018
.mention-bot @dstufft is also annoyed by the mentionbot Jan 2, 2016
.travis.yml Add testing with LibreSSL 2.8.2 (#4501) Oct 20, 2018
AUTHORS.rst Expose OpenSSL constant time bignum arithmetic (#4200) Apr 25, 2018
CHANGELOG.rst add note about dropping LibreSSL 2.4.x support (#4506) Oct 20, 2018
CONTRIBUTING.rst link the CONTRIBUTING.rst to the development section of our docs Mar 2, 2014
Jenkinsfile Add flags to error on compile with incompatible pointer type (#4455) Sep 6, 2018
LICENSE nit in LICENSE, itself doesn't make sense here (#4016) Nov 10, 2017
LICENSE.APACHE Added new license files. Refs #1209 Oct 31, 2014
LICENSE.BSD Added new license files. Refs #1209 Oct 31, 2014
LICENSE.PSF C locking callback (#3226) Nov 13, 2016 Fixes #3548 - add a pyproject.toml (#4363) Jul 23, 2018
README.rst Update URLs for new pypi! (#4194) Apr 15, 2018
codecov.yml revert codecov.yml workaround and pin coverage to 4.3.4 (#3662) Jun 3, 2017
dev-requirements.txt install only the minimum required to build our docs for rtd (#4133) Mar 6, 2018
pyproject.toml Fixes #3548 - add a pyproject.toml (#4363) Jul 23, 2018 Remove CDN purging, the new PyPI does the right thing (#4198) Apr 17, 2018
rtd-requirements.txt install only the minimum required to build our docs for rtd (#4133) Mar 6, 2018 blacklist some pytests (#4502) Oct 19, 2018
tox.ini Move linkcheck tox env to use to get docs dependencies (#4473) Sep 14, 2018



Latest Version Latest Docs

cryptography is a package which provides cryptographic recipes and primitives to Python developers. Our goal is for it to be your "cryptographic standard library". It supports Python 2.7, Python 3.4+, and PyPy 5.3+.

cryptography includes both high level recipes and low level interfaces to common cryptographic algorithms such as symmetric ciphers, message digests, and key derivation functions. For example, to encrypt something with cryptography's high level symmetric encryption recipe:

>>> from cryptography.fernet import Fernet
>>> # Put this somewhere safe!
>>> key = Fernet.generate_key()
>>> f = Fernet(key)
>>> token = f.encrypt(b"A really secret message. Not for prying eyes.")
>>> token
>>> f.decrypt(token)
'A really secret message. Not for prying eyes.'

You can find more information in the documentation.

You can install cryptography with:

$ pip install cryptography

For full details see the installation documentation.


If you run into bugs, you can file them in our issue tracker.

We maintain a cryptography-dev mailing list for development discussion.

You can also join #cryptography-dev on Freenode to ask questions or get involved.


Need to report a security issue? Please consult our security reporting documentation.