Skip to main content

Crate grammers_crypto

Crate grammers_crypto 

Source
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.
DequeBuffer
A growable buffer with the properties of a deque.
ObfuscatedCipher
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_key and aes_iv from auth_key and msg_key as 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.