This article considers the problem of illegal entry into a certain information system and, in addition, the problem of illegal entry into the office of the Director. In the first case a distributed information management system (IMS) is considered, its block diagram is shown, the leak channels are shown, the numerical estimates for the probabilities of unauthorized access through these channels to the IMS are got, the average probability of "breaking" the IMS is calculated by raising the logical function of the movement information on the system. In addition, we studied the process of penetration of the attacker with unguarded areas inside the room where there is the head office containing information of interest to the attacker. We developed a graphic model of penetration of the malefactor in this study, which helped to calculate the rating for probability of penetration in this study, indirectly characterizing the damage from the penetration. On the proposed algorithms the probability of cracking (damage) of the different scenarios implemented by the attacker can be calculated. Therefore, the main purpose of the research results presented in this work is the presentation of an original algorithm in the General case, allowing to calculate in a certain way the average, that is equal to the probability of breaking the whole system, including "hacking" of each unit or transmission channels of information through the design of logical functions corresponding to each individual procedure, the unauthorized entry into any information system.