Skip to main content

Module crypto

Module crypto 

Source
Expand description

Cryptographic primitives for Telegram secret chats (MTProto 2.0).

Constants§

EMOJI_FINGERPRINT_TABLE
The 333-emoji table that emoji_fingerprint_indices indexes into.

Functions§

decrypt_message
Decrypt an incoming secret chat blob.
emoji_fingerprint_indices
Compute four indices into EMOJI_FINGERPRINT_TABLE from auth_key.
encrypt_message
Encrypt a secret chat message blob.
file_decrypt
Decrypt file ciphertext with the key and iv from the inner TL media field.
file_encrypt
Encrypt file bytes with a freshly generated AES-256-IGE key and IV.
file_key_fingerprint
File key fingerprint, as defined by the secret chat spec.
key_fingerprint
Compute the 64-bit key_fingerprint: the last 8 bytes of SHA1(auth_key), read as a little-endian i64.