| 1 |
API documentation |
| 2 |
----------------- |
| 3 |
|
| 4 |
.. toctree:: |
| 5 |
:hidden: |
| 6 |
|
| 7 |
cipher/cipher |
| 8 |
signature/signature |
| 9 |
hash/hash |
| 10 |
public_key/public_key |
| 11 |
protocol/protocol |
| 12 |
io/io |
| 13 |
random/random |
| 14 |
util/util |
| 15 |
|
| 16 |
All cryptographic functionalities are organized in sub-packages; |
| 17 |
each sub-package is dedicated to solving a specific class of problems. |
| 18 |
|
| 19 |
.. csv-table:: |
| 20 |
:header: Package, Description |
| 21 |
:widths: 20, 80 |
| 22 |
|
| 23 |
:doc:`Crypto.Cipher <cipher/cipher>`, "Modules for protecting **confidentiality** |
| 24 |
that is, for encrypting and decrypting data (example: AES)." |
| 25 |
:doc:`Crypto.Signature <signature/signature>`, "Modules for assuring **authenticity**, |
| 26 |
that is, for creating and verifying digital signatures of messages |
| 27 |
(example: PKCS#1 v1.5)." |
| 28 |
:doc:`Crypto.Hash <hash/hash>`, "Modules for creating cryptographic **digests** |
| 29 |
(example: SHA-256)." |
| 30 |
:doc:`Crypto.PublicKey <public_key/public_key>`, "Modules for generating, exporting or importing |
| 31 |
*public keys* (example: RSA or ECC)." |
| 32 |
:doc:`Crypto.Protocol <protocol/protocol>`, "Modules for faciliting secure communications |
| 33 |
between parties, in most cases by leveraging cryptograpic primitives |
| 34 |
from other modules (example: Shamir's Secret Sharing scheme)." |
| 35 |
:doc:`Crypto.IO <io/io>`, "Modules for dealing with encodings commonly used |
| 36 |
for cryptographic data (example: PEM)." |
| 37 |
:doc:`Crypto.Random <random/random>`, "Modules for generating random data." |
| 38 |
:doc:`Crypto.Util <util/util>`, "General purpose routines (example: XOR for byte |
| 39 |
strings)." |
| 40 |
|
| 41 |
In certain cases, there is some overlap between these categories. |
| 42 |
For instance, **authenticity** is also provided by *Message Authentication Codes*, |
| 43 |
and some can be built using digests, so they are included in the ``Crypto.Hash`` |
| 44 |
package (example: HMAC). |
| 45 |
Also, cryptographers have over time realized that encryption without |
| 46 |
**authentication** is often of limited value so recent ciphers found in the |
| 47 |
``Crypto.Cipher`` package embed it (example: GCM). |
| 48 |
|
| 49 |
*PyCryptodome* strives to maintain strong backward compatibility with the old |
| 50 |
*PyCrypto*'s API (except for those few cases where that is harmful to security) |
| 51 |
so a few modules don't appear where they should (example: the ASN.1 module |
| 52 |
is under ``Crypto.Util`` as opposed to ``Crypto.IO``). |