About online security

About online security

This article was written a few years ago when blocking the Telegram messenger was actively discussed by the community and contains my thoughts on this matter. And although today this topic is almost forgotten, I hope that perhaps it will still be of interest to someone.

This text came about as a result of my reflections on the topic of digital security, and for a long time I doubted whether it was worth publishing. Fortunately, there are a huge number of specialists who correctly understand all the problems, and I can’t tell them anything new. However, besides them, there are still a huge number of publicists and other bloggers who not only make mistakes themselves, but also generate a huge number of myths with their articles.

It's no secret that serious passions have been raging in the digital theater of war lately. We, of course, have in mind one of the most discussed topics of Russian modernity, namely the blocking of the Telegram messenger.

Opponents of the blockade present this as a confrontation between the individual and the state, freedom of speech and total control over the individual. Supporters, on the contrary, are guided by considerations of public safety and the fight against criminal and terrorist structures.

First, let's imagine how the Telegram messenger works. We can go to their main page and read about how they position themselves. One of the main advantages of using this particular solution will be the uncompromising emphasis on the security of the end user. But what exactly is meant by this?

As in many other public services, your data is transmitted in encrypted form, but only to the central servers, where they are completely open and any admin, if he really wants to, can easily see all your correspondence. Doubt? Then think about how the synchronization function between devices is implemented. If the data is secret, how does it get to the third device? After all, you do not provide any special client keys for decryption.

For example, as it is done in the ProtonMail mail service, where to work with the service you need to provide a key that is stored on your local machine and which is used by the browser to decrypt messages in your mailbox.

But not everything is so simple. In addition to regular chats, there are also secret ones. Here, correspondence is really conducted only between two devices and there is no question of any synchronization. This feature is only available on mobile clients, and chat screenshots are blocked at the application level, and the chat is destroyed after a set time. On the technical side, the data flow still goes through the central servers, but is not stored there. Moreover, the preservation itself is meaningless, since only clients have decryption keys, and encrypted traffic is of no particular value.

This scheme will work as long as clients and the server honestly implement it and as long as there are no various kinds of programs on the device that send screenshots of your screen to third parties without your knowledge. So maybe the reason for such dislike for Telegram on the part of law enforcement agencies should be sought in secret chats? In this, in my opinion, lies the root of the misunderstanding of the bulk of the people. And we will not be able to fully understand the reason for this misunderstanding until we figure out what encryption is in general and from whom it is designed to protect your data.

Let's imagine that some intruder wants to send a secret message to his friends. So important that it is worth both getting confused and playing it safe. Is Telegram such a good choice from the point of view of an information security specialist? No is not. I argue that using any of the popular messengers for this is the worst option that you can choose.

The main problem is the use of the messaging system, where your correspondence will be looked for in the first place. And even if it is protected well enough, the very fact of its presence can compromise you. Recall that the connection of clients still occurs through central servers and at least the fact that a message was sent between two users can still be proven. Therefore, it is pointless to use e-mail, social networks and any other public services.

How, then, to organize correspondence that meets all security requirements? As part of our review, we will deliberately discard all illegal or controversial methods in order to show that the task can only be solved within the framework of the law. No spyware, hacking or hard-to-find software hardware is required.
Virtually all tools are included in the set of standard utilities that come with any GNU/Linux operating system, and banning them would mean banning computers as such.

The World Wide Web resembles a huge web of servers, with the GNU / Linux operating system usually running on them and the rules for routing packets between these servers. Most of these servers are not available for direct connection, however, in addition to them, there are millions of servers with quite accessible addresses that serve all of us, passing through them a huge amount of traffic. And no one will ever look for your correspondence among all this chaos, especially if it does not stand out in any way against the general background.

Those who wish to organize a secret communication channel will simply buy a VPS (virtual machine in the cloud) from one of the hundreds of players on the market. The price of the issue, as it is not difficult to see, is a few dollars a month. Of course, this cannot be done anonymously, and in any case, this virtual machine will be tied to your means of payment, and therefore to your identity. However, most hosts don't care what you run on their hardware as long as you don't exceed their basic limits, such as the amount of traffic or connections given on port 23.

Although such an opportunity exists, it simply does not pay off for him to spend the few dollars that he earned on you to also follow you.
And even if he wants to or will be forced to do this, he must first understand what kind of software you use specifically and, based on this knowledge, create a tracking infrastructure. Manually, this is not difficult, but automating this process will be an extremely difficult task. For the same reason, it will not be economically viable to store all traffic passing through your server, unless you first come to the attention of the relevant structures that want to do this.

The next step is to create a secure channel using one of the many existing methods.

  • The easiest way is to create a secure ssh connection to the server. Several clients connect via OpenSSH and communicate, for example using the wall command. Cheap and cheerful.
  • Raising a VPN server and connecting several clients through a central server. Alternatively, look for any chat program for local networks and go.
  • Simple FreeBSD NetCat suddenly has built-in functionality for primitive anonymous chat. Supports encryption by certificates and much more.

It is not necessary to mention that in the same way, in addition to simple text messages, you can transfer any files. Any of these methods is implemented in 5-10 minutes and is not technically difficult. Messages will look like simple encrypted traffic, which is the majority on the Internet.

This approach is called steganography - hiding messages where they would not even think to look. By itself, this does not guarantee the security of correspondence, but reduces the probability of its detection to zero. In addition, if your server is also located in another country, the data extraction process may not be possible for other reasons. And even if someone still gets access to it, then your correspondence up to this point, most likely, will not be compromised, since, unlike public services, it is not stored locally anywhere (this, of course, depends on the mode of communication).

However, it may be objected to me that I am looking in the wrong place, the intelligence of the world has long thought of everything and in all encryption protocols there have long been holes for internal use. Quite a sound statement, given the history of the issue. How to be in this case?

All encryption systems that underlie modern cryptography have some property - cryptographic strength. It is assumed that any cipher can be broken - it is only a matter of time and resources. Ideally, it should be achieved that this process is simply not beneficial to the attacker, no matter how important the data is. Or it took so long that at the time of hacking, the data would already lose its importance.

This statement is not entirely true. It is correct when it comes to the most common encryption protocols in use today. However, among all the variety of ciphers, there is one that is absolutely resistant to cracking and at the same time very easy to understand. It is theoretically impossible to crack if all conditions are met.

The idea behind the Vernam Cipher is very simple - sequences of random keys are created in advance to encrypt messages. Moreover, each key is used only once to encrypt and decrypt one message. In the simplest case, we create a long string of random bytes and convert each byte of the message through the XOR operation with the corresponding byte in the key and send it further over an unencrypted channel. It is easy to see that the cipher is symmetrical and the key for encryption and decryption is the same.

This method has drawbacks and is rarely used, but the advantage achieved is that if the two parties agree in advance on the key and this key is not compromised, then you can be sure that the data will not be read.

How does it work? The key is generated in advance and transmitted between all participants via an alternative channel. It can be handed over at a personal meeting on neutral territory, if possible, in order to completely exclude possible inspection, or simply sent by mail with a USB flash drive. We still live in a world where there is no technical possibility to inspect all media that crosses borders, all hard drives and phones.
After all participants in the correspondence have received the key, it can take quite a long time until the communication session occurs, which makes it even more difficult to counter this system.

One byte in the key is used only once to encrypt one character of the secret message and decrypt it by other participants. Spent keys can be automatically destroyed by all participants in the correspondence after data transfer. Having once exchanged secret keys, it is possible to transmit messages with a total volume equal to their length. This fact is usually cited as a drawback of this cipher, it is much more pleasant when the key has a limited length and does not depend on the size of the message. However, these people forget about progress, and if during the Cold War it was a problem, today it is not. If we proceed from the fact that the possibility of modern media is practically unlimited and in the most modest case we are talking about gigabytes, then a secure communication channel can operate indefinitely.

Historically, the Vernam Cipher, or one-time pad encryption, was widely used during the Cold War to transmit secret messages. Although there are cases when, due to inattention, different messages were encrypted with the same keys, that is, the encryption procedure was violated and this allowed them to be decrypted.

Is it difficult to use this method in practice? Rather trivial, and the automation of this process with the help of modern computers is within the power of a novice amateur.

So maybe the purpose of blocking is to damage a specific Telegram messenger? If so, then pass again. The Telegram client out of the box supports proxy servers and the SOCKS5 protocol, which gives the user the opportunity to work through external servers with non-blocked IP addresses. Finding a public SOCKS5 server for a short session is not difficult, and setting up such a server yourself on your VPS is even easier.

Although the impact on the ecosystem of the messenger will still happen, since for most users these restrictions will still create an insurmountable barrier and its popularity among the population will suffer.

So let's sum it up. All the hype around Telegram is hype and nothing more. Blocking it for reasons of public safety is technically illiterate and pointless. Any structures that are vitally interested in secure correspondence can organize their channel using several techniques that complement each other, and, most interestingly, this is done extremely simply, as long as there is at least some kind of access to the network.

The front of information security today passes not through instant messengers, but rather through ordinary network users, even if they do not realize it. The modern Internet is a reality that must be reckoned with and in which laws that seemed unshakable until recently cease to operate. Blocking Telegram is another example of wars for the information market. Not the first and certainly not the last.

A few decades ago, before the mass development of the Internet, the key problem facing all kinds of intelligence networks was to establish a secure communication channel both among themselves and coordinate their work with the center. Tight control over private radio stations during the Second World War in all participating countries (registration is still required today), numbered radio stations of the Cold War (some still operate today), mini films in the sole of a shoe - all this looks simply ridiculous at a new stage in the development of civilization. As well as the inertia of consciousness, forcing the state machine to rigidly block any phenomenon that is not under its control. That is why blocking IP addresses should not be considered as an acceptable solution, and only shows the lack of competence of the people who make such decisions.

The main problem of our time is not the storage or analysis of personal correspondence data by third parties (this is quite an objective reality in which we live today), but the fact that people themselves are ready to provide this data. Every time you access the Internet from your favorite browser, dozens of scripts stare at you, recording how and where you clicked and what page you went to. When installing the next smartphone application, most consider the window for asking for privileges to the program as an annoying barrier before starting to use it. Not noticing the fact that a harmless program crawls into your notebook and wants to read all your messages. Security and privacy are willingly traded for ease of use. And a person himself often completely voluntarily parted with his personal information, and therefore with his freedom, thus filling the databases of world private and public organizations with the most valuable information about his life. And those, of course, will use this information for their own purposes. And also in the race for profit, they will resell it to everyone, ignoring any moral and ethical standards.

I hope that the information presented in the article will allow you to take a fresh look at the problem of information security and, perhaps, change some of your habits when working on the network. And the experts will sneer sternly and move on.

Peace to your home.

Source: habr.com

Add a comment