Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hashlib
- import os
- from telethon.tl.functions.messages import GetDhConfigRequest
- from telethon.tl.functions.phone import RequestCallRequest
- from telethon.tl.types import PhoneCallProtocol
- def get_a(config):
- rand, a = bytes(x ^ y for x, y in zip(os.urandom(256), config.random)), 0
- while not (1 < a < config.p - 1): a = int.from_bytes(rand, 'little')
- return a
- async def call_user(user_id):
- config = await client(GetDhConfigRequest(0, 256))
- config.p = int.from_bytes(config.p)
- a = get_a(config)
- g_a = pow(config.g, a, config.p)
- g_a_hash = hashlib.sha256(int.to_bytes(g_a, 256)).digest()
- protocol = PhoneCallProtocol(min_layer=65, max_layer=93, udp_p2p=True, library_versions={})
- return await client(RequestCallRequest(user_id, g_a_hash=g_a_hash, protocol=protocol))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement