2019-01-17 14:23:46 +00:00
|
|
|
Fast Crypto
|
|
|
|
===========
|
2018-02-17 13:44:59 +00:00
|
|
|
|
2022-01-07 09:18:51 +00:00
|
|
|
Pyrogram's speed can be boosted up by TgCrypto_, a high-performance, easy-to-install cryptography library specifically
|
|
|
|
written in C for Pyrogram as a Python extension.
|
2018-02-17 13:44:59 +00:00
|
|
|
|
2022-01-07 09:18:51 +00:00
|
|
|
TgCrypto is a replacement for a slower Python-only alternative and implements the cryptographic algorithms Telegram
|
|
|
|
requires, namely: AES-256-IGE, AES-256-CTR and AES-256-CBC.
|
2018-02-17 13:44:59 +00:00
|
|
|
|
|
|
|
Installation
|
|
|
|
------------
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
2020-03-30 11:03:02 +00:00
|
|
|
$ pip3 install -U tgcrypto
|
2018-02-17 13:44:59 +00:00
|
|
|
|
2022-01-07 09:18:51 +00:00
|
|
|
.. note:: When TgCrypto is not detected in your system, Pyrogram will automatically fall back to a slower Python-only
|
|
|
|
implementation and will show you a warning.
|
2018-02-17 13:44:59 +00:00
|
|
|
|
2022-01-07 09:18:51 +00:00
|
|
|
The reason about being an optional package is that TgCrypto requires extra system tools in order to be compiled.
|
2018-02-17 13:44:59 +00:00
|
|
|
The errors you receive when trying to install TgCrypto are system dependent, but also descriptive enough to understand
|
|
|
|
what you should do next:
|
|
|
|
|
2021-03-21 21:08:04 +00:00
|
|
|
- **Windows**: Install `Visual C++ 2015 Build Tools <https://www.microsoft.com/en-us/download/details.aspx?id=48159>`_.
|
|
|
|
- **macOS**: A pop-up will automatically ask you to install the command line developer tools.
|
|
|
|
- **Linux**: Install a proper C compiler (``gcc``, ``clang``) and the Python header files (``python3-dev``).
|
|
|
|
- **Termux**: Install ``clang`` package.
|
2018-02-17 13:44:59 +00:00
|
|
|
|
2022-01-07 09:18:51 +00:00
|
|
|
.. _TgCrypto: https://github.com/pyrogram/tgcrypto
|