Closed majidmc2 closed 3 years ago
why would you want to do that ? to save data in it ? I don't think telegram will allow that;
Yes @painor, I research on strengths and weaknesses of MTProto 2.0. I read this and I think telegram doesn't validate the payload.
well yeah they don't actually validate anything and your client is both the server and client depending on who started the chat. So you can send custom objects if the other party understands them but most official clients won't.
I remember when I was writing the code I would use static values not random and I would verify them when received so I think it's possible.
Could you please help me which function I should overwrite for this purpose (send/receive a custom objects in custom client)?
Could you please help me which function I should overwrite for this purpose (send/receive a custom objects in custom client)?
@painor
Are you sure you're not seeing it there ? message_data_length should have the actual length while decrypted_data should have the ecnrypted+padding so to get the padding you'll need to do something like decrypted_data[message_data_length:]
in any case if you want to talk more about this you can use the official telethon telegram group or it's offtopic group .
Thanks for your help.
Are you sure you're not seeing it there ? message_data_length should have the actual length while decrypted_data should have the ecnrypted+padding so to get the padding you'll need to do something like decrypted_data[message_data_length:]
I want to see Padding when I send/receive a text message. At first I edited this line:
padding_data = os.urandom(padding)
print("padding data: ", padding_data)
message += padding_data
print("+ message: ", message)
Then I print the decrypted data after this line
print("decrypted data:", decrypted_data)
I used two client for test but message!=decrypted_data and I can't see the padding on decrypted_data ! This is depends on protocol design (MTProto 2.0, part 2) or I am mistake in read 'decrypted_data' or 'padding'?