index.rst 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. Welcome to ``pyca/cryptography``
  2. ================================
  3. ``cryptography`` includes both high level recipes and low level interfaces to
  4. common cryptographic algorithms such as symmetric ciphers, message digests, and
  5. key derivation functions. For example, to encrypt something with
  6. ``cryptography``'s high level symmetric encryption recipe:
  7. .. code-block:: pycon
  8. >>> from cryptography.fernet import Fernet
  9. >>> # Put this somewhere safe!
  10. >>> key = Fernet.generate_key()
  11. >>> f = Fernet(key)
  12. >>> token = f.encrypt(b"A really secret message. Not for prying eyes.")
  13. >>> token
  14. '...'
  15. >>> f.decrypt(token)
  16. 'A really secret message. Not for prying eyes.'
  17. If you are interested in learning more about the field of cryptography, we
  18. recommend `Crypto 101, by Laurens Van Houtven`_.
  19. Installation
  20. ------------
  21. You can install ``cryptography`` with ``pip``:
  22. .. code-block:: console
  23. $ pip install cryptography
  24. See :doc:`Installation <installation>` for more information.
  25. .. _cryptography-layout:
  26. Layout
  27. ------
  28. ``cryptography`` is broadly divided into two levels. One with safe
  29. cryptographic recipes that require little to no configuration choices. These
  30. are safe and easy to use and don't require developers to make many decisions.
  31. The other level is low-level cryptographic primitives. These are often
  32. dangerous and can be used incorrectly. They require making decisions and having
  33. an in-depth knowledge of the cryptographic concepts at work. Because of the
  34. potential danger in working at this level, this is referred to as the
  35. "hazardous materials" or "hazmat" layer. These live in the
  36. ``cryptography.hazmat`` package, and their documentation will always contain an
  37. admonition at the top.
  38. We recommend using the recipes layer whenever possible, and falling back to the
  39. hazmat layer only when necessary.
  40. .. toctree::
  41. :maxdepth: 2
  42. :caption: The recipes layer
  43. fernet
  44. x509/index
  45. .. toctree::
  46. :maxdepth: 2
  47. :caption: The hazardous materials layer
  48. hazmat/primitives/index
  49. exceptions
  50. random-numbers
  51. hazmat/backends/index
  52. hazmat/bindings/index
  53. .. toctree::
  54. :maxdepth: 2
  55. :caption: The cryptography open source project
  56. installation
  57. changelog
  58. faq
  59. development/index
  60. security
  61. limitations
  62. api-stability
  63. doing-a-release
  64. community
  65. glossary
  66. .. note::
  67. ``cryptography`` has not been subjected to an external audit of its code or
  68. documentation. If you're interested in discussing an audit please
  69. :doc:`get in touch </community>`.
  70. .. _`Crypto 101, by Laurens Van Houtven`: https://www.crypto101.io/