Shear plate data protection method and device, electronic equipment and storage medium

By receiving clipboard data change messages and verifying data integrity using preset verification algorithms, we ensure that all clipboard data is encrypted and processed when writing, solving the problem of clipboard data leakage caused by injection failure in the prior art. , realizes data security guarantee.

CN119272299APending Publication Date: 2025-01-07厦门天锐科技股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411303978.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

Existing clipboard data protection schemes rely on injection target processes to monitor clipboard operations. If injection fails, clipboard data cannot be controlled, resulting in a risk of leakage.

Method used

By receiving the clipboard data change message sent by the system, use the preset verification algorithm to verify the current clipboard data. If the verification value matches the value in shared memory, it is determined that the data is encrypted, otherwise the data is cleared to ensure that All written data must be encrypted.

Benefits of technology

Effectively avoid the risk of leakage caused by unprotected operation of clipboard data, ensuring that all clipboard data is encrypted and processed when written, thereby preventing leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119272299A_ABST
    Figure CN119272299A_ABST
Patent Text Reader

Abstract

The invention provides a clipboard data protection method and device, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: receiving a clipboard data change message sent by a system, and performing verification calculation on current clipboard data by adopting a preset verification algorithm to obtain a target verification value; if the target verification value is the same as the verification value stored in the shared memory, determining that the current clipboard data is encrypted; and if the target verification value is different from the verification value stored in the shared memory, clearing the current clipboard data. It can be seen that the data written into the clipboard is encrypted and the check value is calculated in advance, when the clipboard data is changed, whether the clipboard data is encrypted or not can be judged according to the check value, and compared with the prior art, the data written into the clipboard must be encrypted, otherwise, the data is cleared, so that the clipboard data is encrypted. And therefore, the leakage risk caused by unprotected operation of the data of the clipboard is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a clipboard data protection method, device, electronic device and storage medium. Background Art

[0002] For convenience, users can quickly copy and store data, such as text and pictures, through the clipboard. However, while the clipboard cache data is convenient for users, it also constitutes a data protection vulnerability to a certain extent. If the clipboard cache data is hijacked and used by attackers, it may cause data leakage. Therefore, it is necessary to protect the clipboard cache data.

[0003] Existing clipboard data protection solutions basically rely on injecting components into other processes, hooking clipboard-related APIs (application programming interfaces) in these processes, implementing the process of monitoring reading, writing, and enumerating clipboard data, and marking the data source when writing clipboard data and further encrypting the clipboard data. That is, according to whether data flow is allowed between the data source process and the data acquisition process, the return results when enumerating clipboard data and reading clipboard data are adjusted to achieve control of the flow permission of clipboard data between processes.

[0004] The basis of the existing clipboard data protection scheme is that it is necessary to successfully inject one's own monitoring component into the target process that needs to be controlled in order to monitor the target process's reading and writing operations on the clipboard data. If the monitoring component cannot be injected into the target process or cannot be initialized normally due to permissions, self-protection of the target software, etc., the monitoring component cannot control the clipboard operations of the target process, which means that the target process cannot be controlled when reading the clipboard data, and will not mark the data source process when writing the clipboard data, nor will the clipboard data written this time be encrypted, which will cause the hidden danger of clipboard data leakage. Summary of the invention

[0005] The purpose of the present application is to provide a clipboard data protection method, device, electronic device and storage medium, which can prevent clipboard data leakage.

[0006] In a first aspect, an embodiment of the present application provides a clipboard data protection method, comprising:

[0007] After receiving the clipboard data change message sent by the system, a preset verification algorithm is used to verify the current clipboard data to obtain a target verification value;

[0008] If the target check value is the same as the check value stored in the shared memory, it is determined that the current clipboard data has been encrypted;

[0009] If the target check value is different from the check value stored in the shared memory, the current clipboard data is cleared.

[0010] In a possible implementation, before using a preset verification algorithm to perform verification calculation on the current clipboard data, the method further includes:

[0011] Determine whether the current clipboard data is of the preset content type;

[0012] If the current clipboard data is of a preset content type, then continue to use a preset verification algorithm to perform verification calculations on the current clipboard data;

[0013] If the current clipboard data is not of the preset content type, the process ends.

[0014] In a possible implementation manner, the preset content type includes at least one of text, rich text, and image.

[0015] In a possible implementation, the method further includes:

[0016] When the clipboard performs a data writing operation, the written data is encrypted and the encrypted written data is written into the clipboard;

[0017] A preset verification algorithm is used to calculate a verification value for the encrypted write data, and the verification value is saved in the shared memory.

[0018] In a second aspect, an embodiment of the present application provides a clipboard data protection device, including:

[0019] The verification module is used to receive the clipboard data change message sent by the system, use a preset verification algorithm to verify the current clipboard data, and obtain a target verification value;

[0020] The processing module is used to determine that the current clipboard data has been encrypted if the target check value is the same as the check value stored in the shared memory; if the target check value is different from the check value stored in the shared memory, clear the current clipboard data.

[0021] In a possible implementation, the verification module is further used to:

[0022] Before using the preset verification algorithm to perform verification calculation on the current clipboard data, determine whether the current clipboard data is of the preset content type;

[0023] If the current clipboard data is of a preset content type, then continue to use a preset verification algorithm to perform verification calculations on the current clipboard data;

[0024] If the current clipboard data is not of the preset content type, the process ends.

[0025] In a possible implementation manner, the preset content type includes at least one of text, rich text, and image.

[0026] In a possible implementation manner, the device further includes:

[0027] The encryption module is used to encrypt the written data when the clipboard performs a data writing operation, and write the encrypted written data into the clipboard;

[0028] The verification module is also used to calculate a verification value for the encrypted write data using a preset verification algorithm, and save the verification value in the shared memory.

[0029] In a third aspect, the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect.

[0030] In a fourth aspect, the present application provides a computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions can be executed by a processor to implement the method described in the first aspect.

[0031] Compared with the prior art, the clipboard data protection method provided by the present application receives the clipboard data change message sent by the system, uses a preset verification algorithm to verify and calculate the current clipboard data, and obtains a target verification value; if the target verification value is the same as the verification value stored in the shared memory, it is determined that the current clipboard data has been encrypted; if the target verification value is different from the verification value stored in the shared memory, the current clipboard data is cleared. It can be seen that the present application encrypts the data written to the clipboard and calculates the verification value in advance. When the clipboard data changes, it can be determined whether the clipboard data has been encrypted based on the verification value. Compared with the prior art, the data written to the clipboard in the present application must be encrypted, otherwise it will be cleared, thereby avoiding the risk of leakage caused by unprotected operation of the clipboard data. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0033] Figure 1 A flowchart of a clipboard data protection method provided by an embodiment of the present application is shown;

[0034] Figure 2A schematic diagram of the structure of a shear board data protection device provided in an embodiment of the present application is shown;

[0035] Figure 3 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0036] 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 described herein. On the contrary, these embodiments are provided in order 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.

[0037] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by technicians in the field to which this application belongs.

[0038] In addition, the terms "first" and "second" etc. are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0039] Please refer to Figure 1 , Figure 1 1 is a flowchart of a clipboard data protection method provided by an embodiment of the present application, comprising the following steps S101 to S103:

[0040] S101, receiving a clipboard data change message sent by the system, using a preset verification algorithm to perform verification calculation on the current clipboard data to obtain a target verification value;

[0041] The execution subject of the embodiment of the present application can be a terminal process, which pre-applies to the system for a shared memory to save the verification value of the clipboard content. When any target process is monitored to write data to the clipboard, the written data is encrypted and the encrypted written data is written to the clipboard; a preset verification algorithm is used to calculate the verification value of the encrypted written data, and the verification value is saved in the shared memory.

[0042] The implementation method of monitoring the target process is: injecting a DLL (Dynamic Link Library) file with a clipboard monitoring function into the target process to monitor the target process's operation on the clipboard.

[0043] In order to ensure that all clipboard write operations are initiated by the monitored target process rather than by other third-party processes, the embodiment of the present application sets up a clipboard data change message reminder. When a clipboard data change message sent by the system is received, a preset verification algorithm is used to verify the current clipboard data to obtain the target verification value.

[0044] The above-mentioned preset verification algorithm can adopt relevant technologies, and this application does not limit this.

[0045] The way to set the clipboard data change message reminder is: call the system SetClipboardViewer interface to register as a clipboard viewer window, so that the system will push WM_DRAWCLIPBOARD messages to the terminal process when the clipboard content changes.

[0046] S102: If the target check value is the same as the check value stored in the shared memory, it is determined that the current clipboard data has been encrypted.

[0047] S103: If the target check value is different from the check value stored in the shared memory, clear the current clipboard data.

[0048] If the target check value is different from the check value stored in the shared memory, it means that the current clipboard data is written or modified by a process that is not monitored, may not be encrypted, and there may be a possibility of clipboard data leakage. Therefore, the current clipboard data is cleared to avoid clipboard data leakage, thereby avoiding the risk of leakage caused by unprotected operation of clipboard data.

[0049] In an embodiment of the present application, a check value is calculated for the clipboard data content written in the protected process and the check value is stored in the shared memory. In the clipboard data change notification pushed by the system, the check value of the clipboard data is recalculated and compared with the data in the shared memory to confirm whether the data is written to the clipboard under the protected process. If not, the clipboard data is cleared.

[0050] The clipboard data protection method of the present application may further include the following steps:

[0051] Before using the preset verification algorithm to perform verification calculation on the current clipboard data, determine whether the current clipboard data is of the preset content type;

[0052] If the current clipboard data is of a preset content type, then continue to use a preset verification algorithm to perform verification calculations on the current clipboard data;

[0053] If the current clipboard data is not of the preset content type, the process ends.

[0054] Specifically, the preset content type may include at least one of text, rich text and image.

[0055] Specifically, the embodiment of the present application limits the types of clipboard data that need to be protected. After receiving a clipboard data change message, if the clipboard currently contains text, rich text, or image type data, the clipboard data and the clipboard content check value stored in the shared memory are immediately checked to see if they match. If they do not match, it means that the writing process of the clipboard data is not protected, and the clipboard data is cleared.

[0056] The clipboard data protection method provided in the embodiment of the present application has the following beneficial effects:

[0057] The clipboard data protection method provided by the present application receives a clipboard data change message sent by the system, uses a preset verification algorithm to verify and calculate the current clipboard data, and obtains a target verification value; if the target verification value is the same as the verification value stored in the shared memory, it is determined that the current clipboard data has been encrypted; if the target verification value is different from the verification value stored in the shared memory, the current clipboard data is cleared. It can be seen that the present application encrypts the data written to the clipboard and calculates the verification value in advance. When the clipboard data changes, it can be determined whether the clipboard data has been encrypted based on the verification value. Compared with the prior art, the data written to the clipboard in the present application must be encrypted, otherwise it will be cleared, thereby avoiding the risk of leakage caused by unprotected operation of the clipboard data.

[0058] In the above-mentioned embodiment, a clipboard data protection method is provided, and correspondingly, the present application also provides a clipboard data protection device. The clipboard data protection device provided in the embodiment of the present application can implement the above-mentioned clipboard data protection method, and the clipboard data protection device can be implemented by software, hardware, or a combination of software and hardware. For example, the clipboard data protection device can include integrated or separate functional modules or units to execute the corresponding steps in the above-mentioned methods.

[0059] Please refer to Figure 2 As shown, the clipboard data protection device 10 provided in the embodiment of the present application includes:

[0060] The verification module 101 is used to receive the clipboard data change message sent by the system, and use a preset verification algorithm to perform verification calculation on the current clipboard data to obtain a target verification value;

[0061] The processing module 102 is used to determine that the current clipboard data has been encrypted if the target check value is the same as the check value stored in the shared memory; if the target check value is different from the check value stored in the shared memory, clear the current clipboard data.

[0062] In a possible implementation, the verification module 101 is further configured to:

[0063] Before using the preset verification algorithm to perform verification calculation on the current clipboard data, determine whether the current clipboard data is of the preset content type;

[0064] If the current clipboard data is of a preset content type, then continue to use a preset verification algorithm to perform verification calculations on the current clipboard data;

[0065] If the current clipboard data is not of the preset content type, the process ends.

[0066] In a possible implementation manner, the preset content type includes at least one of text, rich text, and image.

[0067] In a possible implementation manner, the device further includes:

[0068] The encryption module is used to encrypt the written data when the clipboard performs a data writing operation, and write the encrypted written data into the clipboard;

[0069] The verification module 101 is further used to calculate a verification value for the encrypted write data using a preset verification algorithm, and save the verification value in the shared memory.

[0070] The clipboard data protection device provided in the embodiment of the present application and the clipboard data protection method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented therein.

[0071] The embodiment of the present application also provides an electronic device corresponding to the method provided in the above embodiment, and the electronic device can be an electronic device used for a client, such as a mobile phone, a laptop computer, a tablet computer, a desktop computer, etc., to execute the above clipboard data protection method.

[0072] Please refer to Figure 3 , which shows a schematic diagram of an electronic device provided by some embodiments of the present application. Figure 3 As shown, the electronic device 20 includes: a processor 200, a memory 201, a bus 202 and a communication interface 203, and the processor 200, the communication interface 203 and the memory 201 are connected via the bus 202; the memory 201 stores a computer program that can be run on the processor 200, and when the processor 200 runs the computer program, it executes the clipboard data protection method provided in any of the aforementioned embodiments of the present application.

[0073] The memory 201 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 203 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.

[0074] The bus 202 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 201 is used to store programs, and the processor 200 executes the programs after receiving the execution instruction. The clipboard data protection method disclosed in any implementation of the embodiment of the present application may be applied to the processor 200, or implemented by the processor 200.

[0075] The processor 200 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 200. The above processor 200 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a readily available programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 201, and the processor 200 reads the information in the memory 201 and completes the steps of the above method in combination with its hardware.

[0076] The electronic device provided in the embodiment of the present application and the clipboard data protection method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented therein.

[0077] An embodiment of the present application also provides a computer-readable storage medium corresponding to the clipboard data protection method provided in the aforementioned embodiment, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it will execute the clipboard data protection method provided in any of the aforementioned embodiments.

[0078] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.

[0079] The computer-readable storage medium provided by the above-mentioned embodiment of the present application and the clipboard data protection method provided by the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.

[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and specification of the present application.

Claims

1. A clipboard data protection method, characterized in that: include: After receiving the clipboard data change message sent by the system, a preset verification algorithm is used to verify the current clipboard data to obtain a target verification value; If the target check value is the same as the check value stored in the shared memory, it is determined that the current clipboard data has been encrypted; If the target check value is different from the check value stored in the shared memory, the current clipboard data is cleared.

2. The method according to claim 1, characterized in that Before using a preset verification algorithm to perform verification calculation on the current clipboard data, the method further includes: Determine whether the current clipboard data is of the preset content type; If the current clipboard data is of a preset content type, then continue to use a preset verification algorithm to perform verification calculations on the current clipboard data; If the current clipboard data is not of the preset content type, the process ends.

3. The method according to claim 2, characterized in that The preset content type includes at least one of text, rich text and image.

4. The method according to claim 1, characterized in that: The method further comprises: When the clipboard performs a data writing operation, the written data is encrypted and the encrypted written data is written into the clipboard; A preset verification algorithm is used to calculate a verification value for the encrypted write data, and the verification value is saved in the shared memory.

5. A shear board data protection device, characterized in that: include: The verification module is used to receive the clipboard data change message sent by the system, use a preset verification algorithm to verify the current clipboard data, and obtain a target verification value; A processing module, configured to determine that the current clipboard data has been encrypted if the target check value is the same as the check value stored in the shared memory; If the target check value is different from the check value stored in the shared memory, the current clipboard data is cleared.

6. The device according to claim 5, characterized in that The verification module is further used for: Before using the preset verification algorithm to perform verification calculation on the current clipboard data, determine whether the current clipboard data is of the preset content type; If the current clipboard data is of a preset content type, then continue to use a preset verification algorithm to perform verification calculations on the current clipboard data; If the current clipboard data is not of the preset content type, the process ends.

7. The device according to claim 6, characterized in that The preset content type includes at least one of text, rich text and image.

8. The device according to claim 5, characterized in that The device also includes: The encryption module is used to encrypt the written data when the clipboard performs a data writing operation, and write the encrypted written data into the clipboard; The verification module is also used to calculate a verification value for the encrypted write data using a preset verification algorithm, and save the verification value in the shared memory.

9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 4 when executing the computer program.

10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and the computer-readable instructions can be executed by a processor to implement the method according to any one of claims 1 to 4.