One of the most important rules of cybersecurity is: never roll your own encryption.
And what did the guys at Telegram do? Rolled their own encryption.
If you are into Telegram because you think it's secure, think again. There are much better alternatives out there, adopting proved industry standards. Signal or Matrix just to name a few.