Skip to content

miniproto.auth

Telegram authorization, data-center selection, key exchange, and SRP helpers.

  • TEST_DC_OPTIONS — Public attribute miniproto.auth.dc.TEST_DC_OPTIONS.
  • dc_options_from_env — Read local test-DC overrides from environment-style mappings.
  • dc_options_from_raw — Convert raw Telegram DC options to immutable session-model options.
  • select_dc_option — Choose the best endpoint for a data center.
  • AuthKeyExchange — Perform Telegram’s RSA- and DH-protected MTProto authorization handshake.
  • AuthKeyExchangeResult — Authenticated MTProto key material and metadata produced by an exchange.
  • AuthKeyTransport — Transport capability required for Telegram’s unencrypted handshake.
  • ClientDHInnerData — Client DH public value encrypted into set_client_DH_params.
  • DHGenFaildh_gen_fail response containing the third new-nonce hash.
  • DHGenOkdh_gen_ok response containing the first new-nonce hash.
  • DHGenRetrydh_gen_retry response containing the second new-nonce hash.
  • PQInnerDataDC — Plaintext p_q_inner_data_dc encrypted into req_DH_params.
  • RSAKey — Telegram RSA public key used to encrypt the req_DH_params payload.
  • ReqDHParams — Serialized req_DH_params request containing RSA-encrypted inner data.
  • ReqPQMulti — Serialized req_pq_multi request carrying a client nonce.
  • ResPQ — Decoded resPQ response received at the start of key exchange.
  • ServerDHInnerData — Validated plaintext DH group and server public value from Telegram.
  • ServerDHParamsFailserver_DH_params_fail response proving Telegram rejected the request.
  • ServerDHParamsOk — Successful server_DH_params_ok wrapper for encrypted DH parameters.
  • SetClientDHParams — Serialized set_client_DH_params request carrying AES-IGE ciphertext.
  • compute_auth_key — Compute the 256-byte MTProto key from validated DH peer and private values.
  • compute_new_nonce_hash — Compute Telegram’s keyed new-nonce confirmation hash number 1, 2, or 3.
  • decrypt_server_dh_answer — Decrypt, integrity-check, and decode Telegram’s encrypted DH inner payload.
  • derive_tmp_aes_key_iv — Derive the temporary AES-256-IGE key and IV defined by MTProto key exchange.
  • encode_client_dh_inner_data — Serialize client_DH_inner_data before temporary AES-IGE encryption.
  • encode_pq_inner_data_dc — Serialize p_q_inner_data_dc before applying Telegram RSA padding.
  • factorize_pq — Factor Telegram’s small composite pq and return its factors in ascending order.
  • public_rsa_fingerprint — Calculate Telegram’s signed little-endian 64-bit RSA fingerprint.
  • rsa_pad — Apply Telegram’s randomized RSA_PAD encryption to a small inner payload.
  • select_rsa_key — Select the first server-offered fingerprint present in trusted keys.
  • server_salt — Derive the MTProto server salt by XORing the first nonce bytes.
  • compute_check_password — Build the request payload required to verify an account password.
  • AuthService — Run sign-in and data-center authorization flows for one client session.