A method for preventing screenshots, computing equipment and readable storage medium
By dynamically managing screenshots in the computing device, it is based on the display status of the confidential document to open or close the screenproof -proof, solving the problem of the existing technology cannot effectively protect the confidential document, and realize the fine particle size security control of the confidential documents.
Patent Information
- Application Number
- CN202110835897.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-23
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2041-07-23
AI Technical Summary
The existing anti-screening technology cannot specify confidential documents and cannot effectively ensure the security of confidential documents.
By achieving a screenshot -proof method in the computing device, it dynamically opens or close the screen -proof function based on the process status of the application. When a screenproof instructions sent by the application displayed by the confidential document displayed, the anti -screenshot function is turned on; when the secret document is hidden or closed, the anti -screen screen is closed and the anti -screen screen function is closed.
It achieves fine-grained control over confidential documents, ensuring that screenshots of confidential documents are prevented when displayed, and screenshots of non-confidential documents are allowed when not displayed, which not only ensures the security of documents, but also does not affect the normal use of users.
Smart Images

Figure CN113486413B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to an anti-screenshot processing method, a computing device, and a readable storage medium. Background Art
[0002] In recent years, with the rapid development of enterprise informatization, the security risks of electronic documents within enterprises have become increasingly prominent. Based on this, a series of solutions to protect documents to prevent the content from being leaked have emerged, such as anti-screenshot technology.
[0003] However, the control granularity of the existing anti-screenshot technology can only be specific to the application. Specifically, the content opened by the protected application is prohibited from being screenshotted by the user, while the content opened by the non-protected application is allowed to be screenshotted by the user. Obviously, when a confidential document is opened by a non-protected application, the user can still take a screenshot normally, and the security of the confidential document cannot be guaranteed. When a non-confidential document is opened by a protected application, the user cannot take a screenshot, which affects the user's use.
[0004] Therefore, a new anti-screenshot processing method is urgently needed to solve the above problems. Summary of the invention
[0005] To this end, the present invention provides an anti-screenshot processing method, a computing device, and a readable storage medium, in an effort to solve or at least alleviate the above problems.
[0006] According to one aspect of the present invention, there is provided an anti-screenshot processing method, which is executed in a computing device, wherein an operating system is running in the computing device, and one or more applications are running on the operating system, the method comprising: when an anti-screenshot enable instruction sent by a first process is received, the anti-screenshot function is enabled, the first process being a process corresponding to an application whose window displays a confidential document; when an anti-screenshot disable instruction sent by a second process is received, it is determined whether there are other processes that have the anti-screenshot function enabled, the second process being a process corresponding to an application that performs a predetermined operation on the confidential document displayed in the window, the predetermined operation comprising a hiding operation and a closing operation; if there are other processes that have the anti-screenshot function enabled, the anti-screenshot function is kept enabled; if there are no other processes that have the anti-screenshot function enabled, the anti-screenshot function is disabled.
[0007] Optionally, in the anti-screenshot processing method according to the present invention, when an anti-screenshot start instruction sent by the first process is received, the step of turning on the anti-screenshot function includes: when an anti-screenshot start instruction sent by the first process is received, judging whether the first process has the permission to turn on the anti-screenshot function; if the first process has the permission to turn on the anti-screenshot function, turning on the anti-screenshot function.
[0008] Optionally, in the anti-screenshot processing method according to the present invention, when an anti-screenshot shutdown instruction is received from the second process, the step of determining whether there are other processes that have turned on the anti-screenshot function includes: when an anti-screenshot shutdown instruction is received from the second process, determining whether the second process has the authority to turn off the anti-screenshot function; if the second process has the authority to turn off the anti-screenshot function, determining whether there are other processes that have turned on the anti-screenshot function.
[0009] Optionally, in the anti-screenshot processing method according to the present invention, a first list for recording process names with permission to set the anti-screenshot function is stored in the computing device, so as to determine whether the corresponding process has permission to turn on or off the anti-screenshot function based on the first list.
[0010] Optionally, in the anti-screenshot processing method according to the present invention, a second list for recording process numbers for which the anti-screenshot function has been turned on is stored in the computing device. When the anti-screenshot function is turned on, the method also includes: storing the process number of the first process in the second list.
[0011] Optionally, in the anti-screenshot processing method according to the present invention, the step of determining whether there are other processes with the anti-screenshot function turned on includes: determining whether the second list currently includes only the process number of the second process; if the second list currently includes only the process number of the second process, determining that there are currently no other processes with the anti-screenshot function turned on; if the second list currently includes the process numbers of other processes in addition to the second process, determining that there are other processes with the anti-screenshot function turned on.
[0012] Optionally, in the anti-screenshot processing method according to the present invention, when determining whether there is another process with an anti-screenshot function enabled, the method further includes: removing the process number of the second process from the second list.
[0013] Optionally, in the anti-screenshot processing method according to the present invention, the anti-screenshot opening instruction and the anti-screenshot closing instruction are received through a switch control interface registered in the dbus bus.
[0014] Optionally, the anti-screenshot processing method according to the present invention also includes: monitoring the abnormal exit of the process in the second list; when the abnormal exit of the third process in the second list is monitored, removing the process number of the third process from the second list, and determining whether the second list is currently an empty list; if the second list is currently an empty list, turning off the anti-screenshot function; if the second list is not currently an empty list, continuing to keep the anti-screenshot function turned on.
[0015] Optionally, in the anti-screenshot processing method according to the present invention, the step of monitoring the abnormal exit of the processes in the second list includes: periodically detecting whether each process in the second list exists in the current process directory of the computing device; if it is detected that the third process does not exist in the current process directory of the computing device, it is determined that the third process has exited abnormally.
[0016] Optionally, in the anti-screenshot processing method according to the present invention, when the anti-screenshot function is turned on, the method also includes: when it is monitored that the user operates a screenshot tool to take a screenshot, determining whether the screenshot tool is the screenshot tool to be intercepted; if the screenshot tool is the screenshot tool to be intercepted, intercepting the screenshot function in the screenshot tool through a pre-registered hook function to prohibit the user from taking screenshots, and the hook function is registered in a dynamic library pre-loaded by the screenshot tool.
[0017] Optionally, in the anti-screenshot processing method according to the present invention, a third list for recording the names of the screenshot tools to be intercepted is stored in the computing device, so as to determine whether the screenshot tool is the screenshot tool to be intercepted based on the third list.
[0018] According to another aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for execution by at least one processor, and the program instructions include instructions for executing the anti-screenshot processing method according to the present invention.
[0019] According to another aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the anti-screenshot processing method according to the present invention.
[0020] According to the anti-screenshot processing method of the present invention, when an anti-screenshot opening instruction is received from the process corresponding to the application program whose window displays a confidential document, the anti-screenshot function is turned on. When an anti-screenshot closing instruction is received from the process corresponding to the application program that performs a predetermined operation on the confidential document displayed in the window, it is determined whether there are other processes that have turned on the anti-screenshot function. If there are other processes that have turned on the anti-screenshot function, the anti-screenshot function continues to be turned on. If there are no other processes that have turned on the anti-screenshot function, the anti-screenshot function is turned off. It can be seen that the control granularity of the anti-screenshot processing method of the present invention can be specific to confidential documents. When the application window displays a confidential document, the anti-screenshot function is in the turned-on state, and it is in the turned-off state at other times. In this way, the anti-screenshot processing method of the present invention can ensure the security of confidential documents without affecting the user's normal screenshots of non-confidential documents. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The above and other purposes, features and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout the present disclosure, the same reference numerals generally refer to the same parts or elements.
[0022] Figure 1 A structural block diagram of a computing device 100 according to an embodiment of the present invention is shown;
[0023] Figure 2 A flowchart of an anti-screenshot processing method 200 according to an embodiment of the present invention is shown;
[0024] Figure 3 A flowchart of a method 300 for preventing screenshots when a third process is detected to have abnormally exited according to an embodiment of the present invention is shown;
[0025] Figure 4 A schematic diagram showing a method 400 for prohibiting a user from taking screenshots according to another embodiment of the present invention is shown;
[0026] Figure 5 A schematic diagram of an anti-screenshot processing method 500 according to another embodiment of the present invention is shown;
[0027] Figure 6 A schematic diagram of a method 600 for monitoring abnormal exit of processes in an anti-screenshot whitelist according to another embodiment of the present invention is shown. DETAILED DESCRIPTION
[0028] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0029] Figure 1 FIG. 1 shows a block diagram of a computing device 100 according to an embodiment of the present invention. It should be noted that: Figure 1 The computing device 100 shown is only an example. In practice, the computing device used to implement the anti-screenshot processing method of the present invention can be any type of device, and its hardware configuration can be different from the above. Figure 1 The computing device 100 shown is the same as Figure 1 The computing device 100 shown in the figure is different. In practice, the computing device used to implement the anti-screenshot processing method of the present invention can be Figure 1 The hardware components of the computing device 100 shown are increased or deleted, and the present invention does not limit the specific hardware configuration of the computing device.
[0030] like Figure 1 As shown, in a basic configuration 102, computing device 100 typically includes system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between processor 104 and system memory 106.
[0031] Depending on the desired configuration, the processor 104 can be any type of processor, including but not limited to: a microprocessor (μP), a microcontroller (μC), a digital information processor (DSP), or any combination thereof. The processor 104 can include one or more levels of cache such as a first-level cache 110 and a second-level cache 112, a processor core 114, and registers 116. An example processor core 114 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 118 can be used with the processor 104, or in some implementations, the memory controller 118 can be an internal part of the processor 104.
[0032] Depending on the desired configuration, the system memory 106 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.) or any combination thereof. The physical memory in the computing device generally refers to the volatile memory RAM, and the data in the disk needs to be loaded into the physical memory before it can be read by the processor 104. The system memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some embodiments, the application 122 may be arranged to execute instructions on the operating system by one or more processors 104 using program data 124. The operating system 120 may be, for example, Linux, Windows, etc., which includes program instructions for processing basic system services and performing tasks that depend on hardware. The application 122 includes program instructions for implementing various user-desired functions, and the application 122 may be, for example, a browser, instant messaging software, a software development tool (such as an integrated development environment IDE, a compiler, etc.), etc., but is not limited thereto. When the application 122 is installed in the computing device 100, a driver module may be added to the operating system 120.
[0033] When the computing device 100 starts running, the processor 104 reads and executes the program instructions of the operating system 120 from the system memory 106. The application 122 runs on the operating system 120 and uses the interfaces provided by the operating system 120 and the underlying hardware to implement various functions desired by the user. When the user starts the application 122, the application 122 is loaded into the system memory 106, and the processor 104 reads and executes the program instructions of the application 122 from the system memory 106.
[0034] Computing device 100 also includes a storage device 132 including a removable storage 136 and a non-removable storage 138 , both of which are connected to storage interface bus 134 .
[0035] The computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via a network communication link via one or more communication ports 164.
[0036] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can be carried out in a manner that encodes information in the signal. As non-limiting examples, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.
[0037] In the computing device 100 according to the present invention, the application 122 includes instructions for executing the anti-screenshot processing method 200 of the present invention, and the instructions can instruct the processor 104 to execute the anti-screenshot processing method of the present invention. Those skilled in the art can understand that, in addition to the instructions for executing the anti-screenshot processing method 200, the application 122 can also include other applications 126 for implementing other functions.
[0038] Figure 2 A flowchart of an anti-screenshot processing method 200 according to an embodiment of the present invention is shown. The method 200 is suitable for a computing device (eg Figure 1 The computing device 100 is executed in the computing device 100 shown in the figure. The computing device runs an operating system, and one or more application programs are run on the operating system.
[0039] It should be noted that the identification of confidential documents in the present invention is completed by the application itself. Specifically, when a certain application window displays a document, the application determines whether the document displayed in the current window contains a confidential document. The document displayed in the current window of the application refers to the document that can be seen by the user's eyes.
[0040] If the document displayed in the current window contains a confidential document, the application sends an anti-screenshot turn-on instruction. That is, the application will only send an anti-screenshot turn-on instruction when the application window displays a confidential document. In addition, when all confidential documents displayed in a certain application window are hidden or closed (confidential documents are hidden, including confidential documents being minimized and confidential documents being blocked by other documents on the upper layer), the application will also send an anti-screenshot turn-off instruction. That is, when the confidential document displayed in the application window is minimized or closed or is completely blocked by other non-confidential documents, the application will also send an anti-screenshot turn-off instruction. In other words, when the application window no longer displays a confidential document, the application will also send an anti-screenshot turn-off instruction.
[0041] In addition, it is necessary to explain that when the confidential document displayed in the application window is completely blocked by other documents, the application sends an anti-screenshot shutdown instruction. The application can also control the blocking strength.
[0042] Specifically, the application can set an occlusion threshold, and the application will send an anti-screenshot shutdown instruction only when the size of the confidential document displayed in the application window is obscured by the non-confidential document is smaller than the occlusion threshold. That is, when a confidential document displayed in a certain application window is obscured by a non-confidential document, the application will first determine whether the size of the confidential document obscured by the non-confidential document is smaller than the occlusion threshold. If it is smaller than the occlusion threshold, the anti-screenshot shutdown instruction is sent; if it is not smaller than the occlusion threshold, the anti-screenshot function continues to be turned on. For example, the occlusion threshold can be set to 80% of the size of the confidential document. Then, when the size of the confidential document displayed in a certain application window is obscured by the non-confidential document is smaller than 80% of the size of the confidential document, the application will send an anti-screenshot shutdown instruction. Of course, the present invention does not limit the setting of the occlusion threshold.
[0043] Among them, the application can determine whether the document displayed in its window is a confidential document in a variety of ways. For example, it can be determined by the confidential mark of the document, which is not limited by the present invention. In a specific embodiment, those skilled in the art can set it according to actual needs.
[0044] like Figure 2 As shown, the anti-screenshot processing method 200 of the present invention starts at step S210. In step S210, when the anti-screenshot activation instruction sent by the first process is received, the anti-screenshot function is activated, and the first process is the process corresponding to the application program whose window displays a confidential document. When the anti-screenshot function is activated, the process number of the first process can also be stored in the second list. The second list is a list stored in the computing device for recording the process numbers of the currently activated anti-screenshot function. In addition, the default state of the anti-screenshot function is preferably set to the off state.
[0045] According to one embodiment of the present invention, when receiving the anti-screenshot activation instruction sent by the first process, it can be determined whether the first process has the permission to activate the anti-screenshot function. If the first process has the permission to activate the anti-screenshot function, the anti-screenshot function is activated, a message indicating that the anti-screenshot function is activated successfully is returned, and the process number of the first process is stored in the second list. If the first process does not have the permission to activate the anti-screenshot function, the anti-screenshot function is not activated, and a message indicating that the anti-screenshot function is activated unsuccessfully is returned.
[0046] Among them, in the step of determining whether the first process has the permission to enable the anti-screenshot function, the process name of the first process can be compared with the process name in the first list stored in the computing device for recording the process names with the permission to set the anti-screenshot function (i.e., the permission to turn on and off the anti-screenshot function) to determine whether the first process has the permission to enable the anti-screenshot function.
[0047] Specifically, when the process name of the first process is the same as a process name in the first list, it is determined that the first process has the permission to enable the anti-screenshot function. When the process name of the first process is different from any process name in the first list, it is determined that the first process does not have the permission to enable the anti-screenshot function.
[0048] Then, step S220 is entered. When the anti-screenshot closing instruction sent by the second process is received, it is determined whether there are other processes that have turned on the anti-screenshot function. The second process is the process corresponding to the application that performs a predetermined operation on the confidential document displayed in the window, and the predetermined operation includes a hiding operation and a closing operation. That is, the second process is the process corresponding to the application that performs a hiding or closing operation on the confidential document displayed in the window. Among them, the hiding operation includes a minimization operation and a blocking operation.
[0049] According to one embodiment of the present invention, when receiving the anti-screenshot closing instruction sent by the second process, it can be determined whether the second process has the permission to close the anti-screenshot function. Wherein, it can be determined whether the second process has the permission to close the anti-screenshot function by comparing the process name of the second process with the process name in the first list stored in the computing device for recording the process names with the permission to set the anti-screenshot function.
[0050] Specifically, when the process name of the second process is the same as a process name in the first list, it is determined that the second process has the permission to turn off the anti-screenshot function. When the process name of the second process is different from any process name in the first list, it is determined that the second process does not have the permission to turn off the anti-screenshot function.
[0051] If the second process does not have the permission to turn off the anti-screenshot function, the anti-screenshot function will not be turned off, and a message indicating that the anti-screenshot function has failed to be turned off will be returned. If the second process has the permission to turn off the anti-screenshot function, it will be determined whether there are other processes that have turned on the anti-screenshot function.
[0052] According to an embodiment of the present invention, it can be determined whether there are other processes with the anti-screenshot function enabled currently by determining whether the second list currently includes only the process number of the second process.
[0053] If the second list currently includes the process numbers of other processes besides the second process, it is determined that there are other processes that have the anti-screenshot function turned on. That is, there are still application windows displaying confidential documents in the current computing device. At this time, step S230 is entered to continue to keep the screenshot function turned on, and a message indicating that the anti-screenshot function has failed to be turned off is returned. At the same time, the process number of the second process is removed from the second list.
[0054] If the second list currently only includes the process number of the second process, it is determined that there are no other processes that have the anti-screenshot function turned on. That is, no confidential document is displayed in the windows of all application programs currently turned on by the computing device. Then, step S240 is entered to turn off the anti-screenshot function, and the process number of the second process is removed from the second list. At the same time, a message is returned that the anti-screenshot function is successfully turned off.
[0055] It can be seen from this that for an application, when switching between confidential document tags and non-confidential document tags, it will also turn on or off the anti-screenshot function accordingly. This can avoid the problem of unified anti-screenshot processing for opening other non-confidential document tags as long as there is a confidential document tag.
[0056] Here, one thing should be explained. The present invention receives the anti-screenshot enable instruction sent by the first process and the anti-screenshot disable instruction sent by the second process through the switch control interface. That is, the application turns on or off the anti-screenshot function by calling the switch control interface. Among them, the switch control interface program can use the super user system-level dbus service to provide the switch control interface to the outside. In this way, it can be determined whether the interface service program calls this switch control interface based on whether it is a dbus call. When it is determined that the interface service program calls this switch control interface, the anti-screenshot function is turned off. Otherwise, the process of turning on or off the anti-screenshot function of the above-mentioned application is executed.
[0057] In addition, when any application turns on the anti-screenshot function, it may crash and exit abnormally. In this case, since the application exits abnormally, it will not send the anti-screenshot shutdown instruction, which will cause the anti-screenshot function to remain in the turned-on state. In view of this, it is also necessary to monitor the abnormal crash exit of the process that has turned on the anti-screenshot function, that is, to monitor the abnormal exit of the process in the second list. Specifically, it is regularly detected whether each process in the second list exists in the current process directory of the computing device. If it is detected that a process in the second list does not exist in the current process directory of the computing device, it is determined that the process has exited abnormally. For example, if it is detected that the third process in the second list does not exist in the current process directory of the computing device, it is determined that the third process has exited abnormally.
[0058] Figure 3 FIG. 3 is a flowchart of a method 300 for preventing screenshots from being processed when a third process is detected to have exited abnormally according to an embodiment of the present invention. Figure 3 As shown, the method 300 starts at step S310.
[0059] In step S310, when it is detected that the third process in the second list exits abnormally, the process number of the third process is removed from the second list, and it is determined whether the second list is currently an empty list. If the second list is currently an empty list, it indicates that there is currently no process with the anti-screenshot function turned on, then the process goes to step S320 to turn off the anti-screenshot function. If the second list is currently not an empty list, it indicates that there is currently a process with the anti-screenshot function turned on, then the process goes to step S330 to continue to keep the anti-screenshot function turned on.
[0060] Among them, the commonly used anti-screenshot method is to blacken the screenshot of the confidential document after the user takes a screenshot. That is, the user is allowed to take a screenshot, but the screenshot is blackened after the user takes the screenshot. Obviously, this anti-screenshot method cannot really prohibit users from taking screenshots of confidential documents. Based on this, the present invention proposes to use hook technology to track and intercept the call of the screenshot function of the screenshot tool to prevent users from taking screenshots. Specifically, the screenshot function of the screenshot tool is hooked by a hook function pre-registered in the dynamic library pre-loaded by the screenshot tool to achieve anti-screenshot.
[0061] According to one embodiment of the present invention, when the anti-screenshot function is turned on, if it is detected that the user operates a certain screenshot tool to take a screenshot, it is determined whether the screenshot tool is the screenshot tool to be intercepted. The name of the screenshot tool can be compared with the names of the screenshot tools in the third list stored in the computing device for recording the names of the screenshot tools to be intercepted, to determine whether the screenshot tool operated by the user is the screenshot tool to be intercepted.
[0062] Specifically, when the name of the screenshot tool operated by the user is the same as the name of a screenshot tool in the third list, it is determined that the screenshot tool operated by the user is the screenshot tool to be intercepted. When the name of the screenshot tool operated by the user is different from the name of any screenshot tool in the third list, it is determined that the screenshot tool operated by the user is not the screenshot tool to be intercepted.
[0063] If the screenshot tool operated by the user is the one to be intercepted, the screenshot function in the screenshot tool is hooked by a pre-registered hook function to prohibit the user from taking screenshots, and an error message is returned to the screenshot tool. If the screenshot tool operated by the user is not the one to be intercepted, the original screenshot function is returned to the screenshot tool to ensure that the user can take screenshots normally.
[0064] When the anti-screenshot function is turned off, if the user is detected taking a screenshot, the original screenshot function of the screenshot tool will be directly returned to ensure that the user can take a screenshot normally.
[0065] Figure 4A schematic diagram of a method 400 for prohibiting a user from taking screenshots according to another embodiment of the present invention is shown. The user's screenshot operation is monitored, and when it is detected that the user operates a certain screenshot tool to take a screenshot, it is first determined whether the screenshot tool is the screenshot tool to be intercepted. If the screenshot tool operated by the user is not the screenshot tool to be intercepted, the original screenshot function of the screenshot tool is returned to ensure that the user can take screenshots normally.
[0066] If the screenshot tool operated by the user is the one to be intercepted, the current state of the anti-screenshot function is determined. If the current anti-screenshot function is turned on, the screenshot function in the screenshot tool is hooked by a pre-registered hook function to prohibit the user from taking screenshots, and an error message is returned to the screenshot tool. If the current anti-screenshot function is turned off, the original screenshot function is returned to the screenshot tool to ensure that the user can take screenshots normally.
[0067] According to the anti-screenshot processing method of the present invention, when an anti-screenshot opening instruction is received from the process of an application program whose window displays a confidential document, the anti-screenshot function is turned on. When an anti-screenshot closing instruction is received from the process of an application program that performs a predetermined operation on a confidential document displayed in a window, it is determined whether there are other processes that have turned on the anti-screenshot function. If there are other processes that have turned on the anti-screenshot function, the anti-screenshot function continues to be turned on. If there are no other processes that have turned on the anti-screenshot function, the anti-screenshot function is turned off. It can be seen that the control granularity of the anti-screenshot processing method of the present invention can be specific to confidential documents. When a confidential document is displayed in the application window, the anti-screenshot function is in the turned-on state, and it is in the turned-off state at other times. In this way, the anti-screenshot processing method of the present invention can ensure the security of confidential documents without affecting the user's normal screenshots of non-confidential documents.
[0068] In order to better understand the anti-screenshot processing method of the present invention, the following will be combined with Figure 5 The whole process of the anti-screenshot processing method of the present invention is described by a specific example. Further, when a process of a certain application calls the switch control interface to set the anti-screenshot switch value (i.e., turning on or off the anti-screenshot function), the processing process of the switch control interface is described.
[0069] Let me first explain that the switch control interface program uses the superuser system-level dbus service to provide a switch interface to the outside world. Its main function is to provide a switch interface and control the interface call. The switch interface includes setting the switch value, obtaining the switch value interface, and the switch value change dbus signal. In addition, when the switch control interface program is started, it will first read the configuration file to prepare for the subsequent authentication. The configuration file includes the switch default value and the whitelist that can call the switch control interface. Among them, the switch default value is set to false (that is, the anti-screenshot function is set to the off state by default), and the whitelist that can call the switch control interface records the various processes that can call the switch control interface (for the convenience of description, the whitelist that can call the switch control interface is collectively referred to as the switch call whitelist below). Next, the processing process of the switch control interface is explained.
[0070] When a process A calls the switch control interface to set the anti-screenshot switch value (that is, when process A calls the switch control interface to turn on or off the anti-screenshot function), the switch control interface program will authenticate the caller's user and whitelist, and perform corresponding processing in combination with the switch value settings of other whitelist processes.
[0071] Specifically, the switch control interface first determines whether the call is a dbus call. If it is not a dbus call, it determines that process A is the process corresponding to the switch control interface service program. Then, the anti-screenshot function will be turned off. If it is a dbus call, it determines that process A is not the process corresponding to the switch control interface service program. Then, the user is authenticated.
[0072] If the user authentication fails, a message indicating that the user authentication failed is returned. If the user authentication succeeds, whitelist authentication of process A is continued, that is, whether process A is a whitelist process is determined. Specifically, whether process A is a process in the switch call whitelist is determined. If process A is not a process in the switch call whitelist, it is determined that process A is not a whitelist process, and a message indicating that the whitelist authentication failed is returned. If process A is a process in the switch call whitelist, it is determined that process A is a whitelist process, and the switch value to be set by process A calling the switch control interface is continued to be read.
[0073] If process A calls the switch control interface to set the switch value to true (i.e., process A calls the switch control interface to enable the anti-screenshot function), the anti-screenshot function is enabled, and process A is inserted into the whitelist of processes that have enabled anti-screenshot (for ease of description, the whitelist of processes that have enabled anti-screenshot is collectively referred to as the anti-screenshot whitelist). At the same time, the switch value true is sent as a signal to notify the anti-screenshot program, and a message is returned indicating that the anti-screenshot function is successfully enabled.
[0074] If process A calls the switch control interface to set the switch value to false (ie, process A calls the switch control interface to turn off the anti-screenshot function), it is determined whether there is another whitelist process that has the anti-screenshot function turned on.
[0075] If there are other whitelist processes that have the anti-screenshot function enabled, the current switch value will be kept as true, and a message indicating that there are other whitelist processes that have the anti-screenshot function enabled and that the anti-screenshot function has failed to be disabled will be returned. At the same time, process A will be removed from the anti-screenshot whitelist.
[0076] If there is no other whitelist process with the anti-screenshot function enabled, the anti-screenshot function is disabled, and the switch value false is sent as a signal to notify the anti-screenshot program, and then a message is returned indicating that the anti-screenshot function is successfully disabled. At the same time, process A is removed from the anti-screenshot whitelist.
[0077] In addition, the switch control interface program will also regularly monitor the crash or abnormal exit of the processes in the anti-screenshot whitelist. Figure 6 As shown, the switch control interface program periodically polls to check whether each process in the anti-screenshot whitelist has exited abnormally. Specifically, it is periodically detected whether each process number pid in the anti-screenshot whitelist exists in the current process directory of the computing device. If a process number does not exist in the current process directory of the computing device, indicating that the process has exited abnormally, the process is removed from the anti-screenshot whitelist, that is, the anti-screenshot whitelist is refreshed. Then, it is determined whether the current anti-screenshot whitelist is an empty list (that is, no process is recorded). If so, the anti-screenshot function is turned off. If not, the anti-screenshot function continues to be turned on.
[0078] It can be seen that the anti-screenshot processing method of the present invention provides an anti-screenshot switch control interface for application calls. In this way, when a confidential document is displayed in the window of any application, the application can call the switch control interface to set the switch value to turn on the anti-screenshot function. When the confidential document displayed in the application window is minimized, closed, or completely blocked by other documents, the application can also call the switch control interface to set the switch value to turn off the anti-screenshot function. Obviously, the control granularity of the anti-screenshot processing method of the present invention can be specific to confidential documents. When a confidential document is displayed in the application window, the anti-screenshot function is in the on state, and in the off state at other times, thereby ensuring the security of confidential documents and not affecting the user's normal screenshots of non-confidential documents.
[0079] In addition, in the anti-screenshot processing method of the present invention, the switch control interface will also authenticate the user and the process, thereby ensuring the security of the switch control interface call.
[0080] A9. The method as described in any one of A5-A7 also includes: monitoring the abnormal exit of the process in the second list; when the abnormal exit of the third process in the second list is monitored, removing the process number of the third process from the second list, and determining whether the second list is currently an empty list; if the second list is currently an empty list, turning off the anti-screenshot function; if the second list is not currently an empty list, continuing to keep the anti-screenshot function turned on.
[0081] A10. A method as described in A9, wherein the step of monitoring the abnormal exit of processes in the second list includes: periodically detecting whether each process in the second list exists in the current process directory of the computing device; if it is detected that the third process does not exist in the current process directory of the computing device, it is determined that the third process has exited abnormally.
[0082] A11. A method as described in any one of A1-A10, wherein when the anti-screenshot function is turned on, the method further includes: when it is monitored that a user operates a screenshot tool to take a screenshot, determining whether the screenshot tool is the screenshot tool to be intercepted; if the screenshot tool is the screenshot tool to be intercepted, intercepting the screenshot function in the screenshot tool through a pre-registered hook function to prohibit the user from taking a screenshot, and the hook function is registered in a dynamic library pre-loaded by the screenshot tool.
[0083] A12. A method as described in A11, wherein a third list for recording the names of the screenshot tools to be intercepted is stored in the computing device, so as to determine whether the screenshot tool is the screenshot tool to be intercepted based on the third list.
[0084] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or some aspects or parts of the method and apparatus of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.
[0085] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute the document loading method of the present invention according to the instructions in the program code stored in the memory.
[0086] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer readable instructions, data structures, program modules or other data. Communication media generally embody computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and include any information transfer medium. Any combination of the above is also included within the scope of readable media.
[0087] In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the examples of the present invention. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to implement the content of the present invention described herein, and the above description of specific languages is for the purpose of disclosing the best mode of the present invention.
[0088] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0089] It should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0090] Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.
[0091] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0092] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0093] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions. Therefore, a processor with necessary instructions for implementing the method or method elements forms a device for implementing the method or method elements. In addition, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.
[0094] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.
[0095] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.
Claims
1. A method for preventing screenshots, suitable for execution in a computing device, wherein an operating system is running in the computing device, and one or more application programs are running on the operating system, the method comprising: When receiving an anti-screenshot activation instruction sent by a first process, activating the anti-screenshot function, the first process being a process corresponding to the application program whose window displays a confidential document; When receiving the anti-screenshot closing instruction sent by the second process, determining whether there is another process that has turned on the anti-screenshot function, the second process is a process corresponding to an application that performs a predetermined operation on the confidential document displayed in the window, and the predetermined operation includes a hiding operation and a closing operation; If there are other processes with the anti-screenshot function enabled, the anti-screenshot function will continue to be enabled; If there is no other process with the anti-screenshot function enabled, disable the anti-screenshot function. Among them, the computing device stores a second list for recording process numbers for which the anti-screenshot function has been turned on, and the method also includes: monitoring the abnormal exit of the processes in the second list, and when the abnormal exit of the third process in the second list is detected, removing the process number of the third process from the second list, and determining whether the second list is currently an empty list, if the second list is currently an empty list, turning off the anti-screenshot function, and if the second list is not currently an empty list, continuing to keep the anti-screenshot function turned on.
2. The method of claim 1, wherein: The step of enabling the anti-screenshot function when receiving the anti-screenshot enabling instruction sent by the first process includes: When receiving the anti-screenshot activation instruction sent by the first process, determining whether the first process has permission to activate the anti-screenshot function; If the first process has permission to enable the anti-screenshot function, the anti-screenshot function is enabled.
3. The method of claim 1, wherein: The step of determining whether there is another process with the anti-screenshot function turned on when receiving the anti-screenshot turn-off instruction sent by the second process includes: When receiving the anti-screenshot closing instruction sent by the second process, determining whether the second process has the authority to close the anti-screenshot function; If the second process has the permission to turn off the anti-screenshot function, it is determined whether there is another process that has turned on the anti-screenshot function.
4. The method according to claim 2 or 3, wherein: The computing device stores a first list for recording the names of processes having the permission to set the anti-screenshot function, so as to determine whether the corresponding process has the permission to turn on or off the anti-screenshot function based on the first list.
5. The method according to any one of claims 1 to 3, wherein: When the anti-screenshot function is enabled, the method further includes: The process ID of the first process is stored in the second list.
6. The method of claim 5, wherein: The step of determining whether there is another process with the anti-screenshot function enabled currently includes: Determine whether the second list currently includes only the process ID of the second process; If the second list currently includes only the process number of the second process, it is determined that no other process with the anti-screenshot function enabled currently exists; If the second list currently includes process numbers of other processes in addition to the second process, it is determined that there are other processes that have enabled the anti-screenshot function.
7. The method of claim 5, wherein: When determining whether there is another process that has an anti-screenshot function enabled, the method further includes: The process ID of the second process is removed from the second list.
8. The method according to any one of claims 1 to 3, wherein: The anti-screenshot opening instruction and the anti-screenshot closing instruction are received through the switch control interface registered in the dbus bus.
9. The method of claim 1, wherein: The step of monitoring abnormal exit of processes in the second list comprises: Periodically detecting whether each process in the second list exists in a current process directory of the computing device; If it is detected that the third process does not exist in the current process directory of the computing device, it is determined that the third process has exited abnormally.
10. The method according to any one of claims 1 to 3, wherein: When the anti-screenshot function is turned on, the method further includes: When it is detected that a user operates a certain screenshot tool to take a screenshot, determining whether the screenshot tool is the screenshot tool to be intercepted; If the screenshot tool is the screenshot tool to be intercepted, the screenshot function in the screenshot tool is intercepted by a pre-registered hook function to prohibit the user from taking screenshots. The hook function is registered in a dynamic library pre-loaded by the screenshot tool.
11. The method of claim 10, wherein: The computing device stores a third list for recording the names of the screenshot tools to be intercepted, so as to determine whether the screenshot tool is the screenshot tool to be intercepted based on the third list.
12. A computing device comprising: at least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the method according to any one of claims 1 to 11.
13. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, the computing device executes the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Anti-screenshot technology-based file data protection method
CN102004878A