mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 05:19:41 +00:00
First attempt at TelegramClient. Added fixes and doc
This commit is contained in:
@@ -4,18 +4,21 @@
|
||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Auth/Step2_DHExchange.cs
|
||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Auth/Step3_CompleteDHExchange.cs
|
||||
|
||||
from network.mtproto_plain_sender import MtProtoPlainSender
|
||||
from utils.binary_writer import BinaryWriter
|
||||
from utils.binary_reader import BinaryReader
|
||||
from utils.factorizator import Factorizator
|
||||
from utils.auth_key import AuthKey
|
||||
import utils.helpers as utils
|
||||
import time
|
||||
from utils.rsa import RSA
|
||||
from utils.aes import AES
|
||||
|
||||
import utils.helpers as utils
|
||||
from crypto.aes import AES
|
||||
from crypto.auth_key import AuthKey
|
||||
from crypto.factorizator import Factorizator
|
||||
from crypto.rsa import RSA
|
||||
from network.mtproto_plain_sender import MtProtoPlainSender
|
||||
from utils.binary_reader import BinaryReader
|
||||
from utils.binary_writer import BinaryWriter
|
||||
|
||||
|
||||
def do_authentication(transport):
|
||||
"""Executes the authentication process with the Telegram servers.
|
||||
If no error is rose, returns both the authorization key and the time offset"""
|
||||
sender = MtProtoPlainSender(transport)
|
||||
|
||||
# Step 1 sending: PQ Request
|
||||
@@ -201,4 +204,4 @@ def do_authentication(transport):
|
||||
|
||||
def get_fingerprint_text(fingerprint):
|
||||
"""Gets a fingerprint text in 01-23-45-67-89-AB-CD-EF format (no hyphens)"""
|
||||
return ''.join(hex(b)[2:].rjust(2, '0').upper() for b in fingerprint)
|
||||
return ''.join(hex(b)[2:].rjust(2, '0').upper() for b in fingerprint)
|
||||
|
Reference in New Issue
Block a user