Telegram 2 22 – Messenger Based On The Mtproto Protocol

Posted on  by

Telegram was launched in 2013 by the brothers Nikolai and Pavel Durov, the founders of VK, Russia’s largest social network. Telegram Messenger LLP is an independent nonprofit company based in Berlin, Germany, which is not connected to VK. Nikolai created the new MTProto protocol that the messenger is based on, while Pavel provided financial. If you try to access to via a Web Browser, you can see that the https protocol is not enabled. If you look at here, there are a list of subdomains that implements https, you could try one of those to make your api request. Using MTProto 2.0 instead of MTProto 1.0. A client may either use only MTProto 2.0 or only MTProto 1.0 in the same TCP connection. The server detects the protocol used by the first message received from the client, and then uses the same encryption for its messages, and expects the client to use the same encryption henceforth.

The message exchange is, perhaps, what started the Internet. The man is a social being and across the history, communication and fast message delivery were among the major problems of the humanity. It is the need to exchange information that has given rise to such habitual phenomena as social networks, the most important function of which is the instant messaging. However, even the high popularity of social media did not reduce people’s need for Internet pagers.

Both special messaging programs and large social networks use various instant messaging protocols to implement the communication between users. Such chat protocols are, in fact, the core of the instant messaging, providing its basic features.

As the technologies develop and their capabilities grow, the requirements of the messaging systems’ users also increase. Today, for an average user, not only the text message exchange is important, but also many additional properties of the protocol: abilities to transfer media files, documents, and uphold the anonymity and protection of transmitted information.
In this article we will acquaint you with three popular messaging protocols: XMPP vs WebSockets vs MTProto, review their useful properties, capabilities, and implementations to give our readers the base for conscious choice.

Telegram 2 22 – Messenger Based On The Mtproto Protocol Handout

Read also: Messaging App Development

XMPP

Extensible Messaging and Presence Protocol (XMPP) is a free-to-use, open, and extensible chat protocol, formerly known as Jabber. The protocol supports the transmission of presence information based on the contact list, as well as files, voice, and video recordings. This protocol was used to create many well-known messaging services: Google Talk, WhatsApp, Juik and even was used in earlier versions of Facebook.

Advantages of XMPP

This protocol has a number of advantages, thanks to which its reliability and safety are ensured:

• Decentralized architecture – XMPP does not have a common central server and users are allowed to start their own dedicated servers;

• Openness – XMPP does not have any major maintainer and anyone can use it;

• Serious support – XMPP exists since 1998 and thanks to the support of renown large companies (Google, for instance) was augmented with many useful additions;

• Security – the security of data transmission is supplied primarily by the possibility to create separate (even isolated from the Internet) storage server;

• Flexibility – a plethora of plugins make the protocol applicable not only for messaging but also in other areas, including network administration, for example.

Disadvantages of XMPP

• The main disadvantage of XMPP is the redundancy of the transmitted data. Around 60% of all information transmitted by the protocol is the presence data, which creates the excess traffic.

• Another disadvantage is the poor scalability of the protocol. Because of the excessive traffic, XMPP is problematic for the creation of chat rooms and data publishing.

• The inability to transmit unmodified binary information is another issue of XMPP. Chatting is implemented in the form of the XML document, which forces app developers to use additional third-party protocols for file transfer.

WebSockets

This protocol was originally designed to provide the full-duplex communication between the browser and the web server in real time. Capable of simultaneously sending and receiving data over a TCP connection, WebSockets is ideally suited for the implementation in web servers and browsers but is also applicable to the development of messaging applications.

Advantages of WebSockets

The main advantage of WebSockets is its support by many famous and popular browsers (Google Chrome, Apple Safari, Mozilla, Opera), which makes it extremely convenient for the implementation of various web projects. However, WebSockets also has a number of features, useful in messaging:

• High-speed data exchange, which is ensured by the small size of data packets, – WebSockets exchange is faster than most other protocols used in instant messaging;

• Persistent communication channels, even when inactive, without the need for constant rechecks;

• No restrictions on the number of simultaneously opened sessions to one server;

• The possibility to create the cross-domain applications, based on the fact that the limitations in the protocol are determined on the server side;

• UTF-8 encoding.

Disadvantages of WebSockets

The main drawback of the protocol is its low security. For example, in October 2010, Google’s security analyst Adam Barth accompanied by Carnegie-Mellon scientists in their work “Transparent Proxies: Threat or Menace” demonstrating how to intercept the WebSockets feeds of the users working through transparent proxies and substitute the information they receive. This gives a wide field for scamming, which is why Firefox and Opera refused to support the protocol until the more secure version is released. In addition, some popular anti-virus programs, such as Avast, consider this protocol harmful and block its usage completely.

MTProto

This is a very well-known instant messaging protocol, created by the developers of the Telegram Messenger. The idea of the protocol was to implement the maximum protection of user transmissions with the help of encryption.

Telegram 2 22 – Messenger Based On The Mtproto Protocol Download

Advantages of MTProto

The ability to create encrypted communication channels, which guarantee the complete security of exchange, became the selling feature of the protocol and skyrocketed its popularity.

Transmission Security: How is this implemented in MTProto?

To maximize the messaging security, MTProto designers (the most famous being Nikolai Durov) used a very original combination of the AES encryption algorithm, Diffie-Hellman key exchange method, and hashing functions. Also, end-to-end encryption is possible with key reconciliation. When encrypting with the AES algorithm, a sequence of procedures and transformations are applied to the data using a private cryptographic key. Thanks to this, even an intercepted message cannot be deciphered. The Diffie-Hellman method allows to create secure communications by exchanging the public keys with recipients over open channels. Thus, the MTProto protocol not only provides secure communication channels but also encrypts the transmitted data so that only the data exchange participants can read the information freely.

Disadvantages of MTProto

Among the disadvantages of MTProto are a number of vulnerabilities to man-in-the-middle (MITM) attacks. One should note, though, that MTProto is a relatively young and actively developing protocol. Such faults are constantly monitored and fixed, there’s even an incentive system with money prizes for those, who find such vulnerabilities.

Reviewed Instant Messaging Protocols: Is There an Evident Winner?

Comparing the capabilities, advantages, and disadvantages of XMPP vs MTProto vs WebSockets messaging protocols, we can clearly see that each of them implements the messaging process in its own way, which gives the mobile development professionals under Android and iOS a freedom to choose the one that best suits their objectives. MTProto and XMPP provide the security of exchange, while WebSockets creates reliable uninterrupted channels with a high transfer rate.

Protocol

When comparing MTProto vs XMPP, we can say that XMPP is secure against MITM attacks but unsuitable for binary files transfer, while MTProto has some minor vulnerabilities but from the start is equipped with media exchange capabilities and hypertext links integration. Thus, it is difficult to draw conclusions about which of the protocols is better used for the instant messaging and depends greatly on the requirements and properties of the developed project.