Registry / security / tgcrypto-pyrofork

tgcrypto-pyrofork

JSON →
library1.2.8pypypiunverified

Fast and portable cryptography extension library for Pyrofork, providing optimized implementations of AES-256-IGE, AES-256-CTR, and other Telegram-specific cryptographic primitives. Current version: 1.2.8, released in January 2025. Active development with occasional updates.

pip install tgcrypto-pyrofork
INSTALL
IMPORT
SIG · TGCRYPTO-PYROFORK
T
tgcrypto-pyrofork
securitypythonv1.2.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Tgcrypto
from tgcrypto_pyrofork import Tgcrypto
from tgcrypto import Tgcrypto

Basic usage of Tgcrypto for IGE encryption.

from tgcrypto import Tgcrypto # Create a new Tgcrypto instance crypto = Tgcrypto() # Example: encrypt data using AES-256-IGE key = b'\x00' * 32 # 32 bytes for AES-256 iv = b'\x00' * 32 # 32 bytes for IGE mode data = b'Hello, World!' encrypted = crypto.ige256_encrypt(key, iv, data) print(encrypted.hex())
Debug
Known issues
breakingPyrofork dependency: If you are upgrading from an older version of Pyrofork that bundled its own crypto (e.g., Pyrogram), you must install tgcrypto-pyrofork separately. This library is a drop-in replacement for the original tgcrypto, but it is not compatible with Pyrogram.
fix
Ensure you are using Pyrofork, not Pyrogram, and install tgcrypto-pyrofork via pip.
affects: all
gotchaImport path confusion: Users coming from the original tgcrypto library (for Pyrogram) might try 'import tgcrypto' expecting the old functionality. The correct import is 'from tgcrypto import Tgcrypto'. The module name is 'tgcrypto', but the class is 'Tgcrypto' (capital T).
fix
Use 'from tgcrypto import Tgcrypto' and instantiate Tgcrypto().
affects: all
gotchaKey and IV sizes: AES-256 requires 32-byte keys and 32-byte IVs for IGE mode (or 16-byte for CTR). Using wrong sizes will raise exceptions.
fix
Always use 32-byte keys and 32-byte IVs for IGE, and 32-byte keys with 16-byte IVs for CTR.
affects: all
deprecatedPython version requirement: tgcrypto-pyrofork requires Python >=3.10. If you are on an older Python, this library will not install.
fix
Upgrade Python to 3.10 or later.
affects: all
Upgrade
Version history
1.2.8latest on PyPI · released Oct 25, 2025
Audit
Dependencies
pyroforkoptionalTgCrypto-Pyrofork is designed as a crypto provider for Pyrofork, and although it can be used standalone, it is most commonly used with Pyrofork.
Agent activity
28 hits · last 30 days
node
26
Resources
tgcrypto-pyrofork — pip install tgcrypto-pyrofork · libregistry