Expand description
This library contains a collection of functions that relate to encrypting and decryption values when exchanging messages with Telegram.
Modules§
- aes
- AES-Infinite Garble Extension implementation.
- hex
- Functions to convert a byte-string to and from hexadecimal form.
- rsa
- Contains the function to RSA-encrypt hashed data as expected by Telegram.
- two_
factor_ auth - Functions used by Telegram’s Two-Factor Authentication.
Macros§
- sha1
- Calculate the SHA1 hash of zero or more expressions evaluating to a sequence of bytes.
- sha256
- Calculate the SHA256 hash of zero or more expressions evaluating to a sequence of bytes.
Structs§
- AuthKey
- Telegram’s Authorization Key.
- Deque
Buffer - A growable buffer with the properties of a deque.
- Obfuscated
Cipher - This implements the AES-256-CTR cipher used by Telegram to encrypt data when using the obfuscated transport.
Enums§
- Error
- The error type for
decrypt_data_v2.
Functions§
- decrypt_
data_ v2 - This method is the inverse of
encrypt_data_v2. Returns the slice of the input buffer that contains the decrypted plaintext. - encrypt_
data_ v2 - This function implements the MTProto 2.0 algorithm for computing
aes_keyandaes_ivfromauth_keyandmsg_keyas specified - factorize
- Factorize the given number into its two prime factors.
- generate_
key_ data_ from_ nonce - Generate the AES key and initialization vector from the server nonce and the new client nonce. This is done after the DH exchange.