CN109857571B - Clipboard control method and device - Google Patents

Clipboard control method and device Download PDF

Info

Publication number
CN109857571B
CN109857571B CN201811646014.5A CN201811646014A CN109857571B CN 109857571 B CN109857571 B CN 109857571B CN 201811646014 A CN201811646014 A CN 201811646014A CN 109857571 B CN109857571 B CN 109857571B
Authority
CN
China
Prior art keywords
clipboard
key value
target object
preset
ciphertext
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811646014.5A
Other languages
Chinese (zh)
Other versions
CN109857571A (en
Inventor
刘佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qianxin Technology Group Co Ltd
Original Assignee
Qianxin Technology Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qianxin Technology Group Co Ltd filed Critical Qianxin Technology Group Co Ltd
Priority to CN201811646014.5A priority Critical patent/CN109857571B/en
Publication of CN109857571A publication Critical patent/CN109857571A/en
Application granted granted Critical
Publication of CN109857571B publication Critical patent/CN109857571B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention provides a clipboard control method and device. The method is applied to a first application program, and comprises the following steps: when a preset copying instruction carrying a target object is received, calling a preset clipboard compatible with a system clipboard of a terminal in the first application program; copying the target object into the preset clipboard, and acquiring a key value of the target object in the preset clipboard; and respectively encrypting the key value and the target object and writing the encrypted key value and the target object into the system clipboard. The embodiment of the invention solves the problem that the switch is used by the iOS system to control the clipboard in the prior art.

Description

Clipboard control method and device
Technical Field
The embodiment of the invention relates to the technical field of mobile communication, in particular to a clipboard control method and a clipboard control device.
Background
With the development of mobile communication technology, mobile terminals such as smart phones have become an indispensable part of people's lives, various application programs on the mobile terminals are gradually increased, and the internal functions of many application programs are more perfect, so that a lot of convenience is provided for users; the terminal is convenient and fast, and the safety of the terminal cannot be ignored. Taking a clipboard as an example, the clipboard is an area in memory used for transferring and sharing information between various applications.
In the android system, the security control of the clipboard is usually realized by encrypting the clipboard content, that is, after the entity content of the clipboard is encrypted, an identification tag is added to the front of the clipboard, and then the encrypted clipboard content is written into the system clipboard. In the current iOS system, due to the limitation of the system, clipboard data to be written cannot be obtained by hook (hook) technology, so a switch is usually used to control whether a certain application program can use the clipboard; for application programs without using permission, data cannot be copied mutually, and user experience is reduced.
Disclosure of Invention
The embodiment of the invention provides a clipboard control method and device, which are used for solving the problem that an iOS system uses a switch to control a clipboard in the prior art.
In one aspect, an embodiment of the present invention provides a clipboard control method, where the method is applied to a first application, and the method includes:
when a preset copying instruction carrying a target object is received, calling a preset clipboard compatible with a system clipboard of a terminal in the first application program;
copying the target object into the preset clipboard, and acquiring a key value of the target object in the preset clipboard;
and respectively encrypting the key value and the target object and writing the encrypted key value and the target object into the system clipboard.
In one aspect, an embodiment of the present invention provides a clipboard control method, where the method is applied to a second application, and the method includes:
when a ciphertext key value is newly added in a system clipboard of the terminal, the ciphertext key value is decrypted to obtain a key value;
searching ciphertext data according to the key value, and decrypting the ciphertext data to obtain a target object;
and calling a preset clipboard compatible with a system clipboard of the terminal in the second application program, and writing the decrypted key value and the target object into the preset clipboard.
In another aspect, an embodiment of the present invention provides a clipboard control device, where the clipboard control device is applied to a first application, and the clipboard control device includes:
the instruction receiving module is used for calling a preset clipboard compatible with a system clipboard of the terminal in the first application program when receiving a preset copying instruction carrying a target object;
the key value obtaining module is used for copying the target object into the preset clipboard and obtaining the key value of the target object in the preset clipboard;
and the writing module is used for writing the key value and the target object into the system clipboard after encrypting the key value and the target object respectively.
In another aspect, an embodiment of the present invention provides a clipboard control apparatus, where the apparatus is applied to a second application, and the apparatus includes:
the monitoring module is used for decrypting the ciphertext key values to obtain key values when monitoring that the ciphertext key values are newly added in a system clipboard of the terminal;
the decryption module is used for searching ciphertext data according to the key value and decrypting the ciphertext data to obtain a target object;
and the calling module is used for calling a preset clipboard compatible with a system clipboard of the terminal in the second application program and writing the decrypted key value and the target object into the preset clipboard.
On the other hand, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, a bus, and a computer program that is stored in the memory and is executable on the processor, where the processor implements the steps in the clipboard control method when executing the program.
In still another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the clipboard control method described above.
According to the clipboard control method and device provided by the embodiment of the invention, when a preset copy instruction carrying a target object is received, a preset clipboard compatible with a system clipboard of a terminal in a first application program is called, and the function of the system clipboard is executed by simulating the system clipboard in the first application program through the preset clipboard; copying the target object into the preset clipboard, and acquiring a key value of the target object in the preset clipboard; respectively encrypting the key value and the target object and writing the key value and the target object into the system clipboard; for a terminal with an operating system of an iOS system, respectively encrypting a key value and a target object to ensure that the target object can be copied and pasted in a packaged application program; and the non-encapsulated application program cannot find the ciphertext data and further cannot obtain the target object because the key value cannot be cracked, so that the data security in the encapsulated application program is protected.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating a clipboard control method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an exemplary terminal according to an embodiment of the present invention;
fig. 3 is a second flowchart illustrating a clipboard control method according to an embodiment of the present invention;
fig. 4 is a third schematic flowchart of a clipboard control method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a clipboard control device according to an embodiment of the present invention;
fig. 6 is a second schematic structural diagram of a clipboard control device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings and specific embodiments. In the following description, specific details such as specific configurations and components are provided only to help the full understanding of the embodiments of the present invention. Thus, it will be apparent to those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the invention. In addition, descriptions of well-known functions and constructions are omitted for clarity and conciseness.
It should be appreciated that reference throughout this specification to "an embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrase "in an embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
In various embodiments of the present invention, it should be understood that the sequence numbers of the following processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In the embodiments provided herein, it should be understood that "B corresponding to a" means that B is associated with a from which B can be determined. It should also be understood that determining B from a does not mean determining B from a alone, but may be determined from a and/or other information.
Fig. 1 is a flowchart illustrating a clipboard control method according to an embodiment of the present invention.
As shown in fig. 1, a clipboard control method provided in an embodiment of the present invention is applied to a first application, and the method specifically includes the following steps:
step 101, when receiving a preset copy instruction carrying a target object, calling a preset clipboard compatible with a system clipboard of a terminal in the first application program.
The first application program is a packaged application program, specifically, the attribute and implementation details of the first application program are hidden, and only the interface is externally disclosed to control the access level of reading and modification in the attribute.
When the first application program receives a preset copy instruction carrying a target object, for example, when a user wants to copy the target object in the first application program to a system clipboard of a terminal where the first application program is located, a long-press operation or other operation triggering a copy instruction may be performed on the target object, and when the first application program detects the operation, it is determined that the preset copy instruction for the target object is received.
Further, the clipboard provides an area for the operating system to centrally store data so that applications can share data with each other. The user can copy a copy of data in a certain program, and paste the data into the next program after switching to the next program; and most operating system clipboards have functions similar to cut, copy, paste operations.
When the first application program receives the preset copying instruction, the preset clipboard preset in the first application program is called, the preset clipboard is compatible with the system clipboard of the terminal where the first application program is located, and the function of the system clipboard can be executed by simulating the system clipboard in the first application program through the preset clipboard.
And 102, copying the target object into the preset clipboard, and acquiring a key value of the target object in the preset clipboard.
The preset clipboard is compatible with the system clipboard, the system clipboard is simulated in the first application program through the preset clipboard, the function of the system clipboard is executed, the target object is copied into the preset clipboard, and then the key value obtained after copying is the same as the key value obtained by copying the target object into the system clipboard.
It will be appreciated that the key value, i.e. an index on the clipboard where the target object is located, is used to locate the target object. And after copying the target object into the preset clipboard, acquiring a key value of the target object in the preset clipboard, and searching the target object according to the key value when other encapsulation application programs copy the target object.
And 103, encrypting the key value and the target object respectively and writing the encrypted key value and the encrypted target object into the system clipboard.
In order to realize the safe control of the clipboard, when the operating system of the terminal is an iOS system, the key values and the target objects are respectively encrypted, and then encrypted ciphertext key values and encrypted target objects (namely ciphertext data) are written into the system clipboard, wherein the encryption and decryption modes are only shared inside a packaged application program which has the same encryption/decryption function with the first application program, and a non-packaged application program cannot decrypt the plaintext of the key values, so that ciphertext data cannot be searched from the system clipboard.
For example, referring to fig. 2, a first application program writes a target object and a key value into a system clipboard after encrypting the target object and the key value respectively; a second application program and a third application program of the same terminal detect that the key value of the system clipboard is updated; the second application program is used as a packaging application program, a target object and a decryption algorithm of the key value are predicted, the key value is decrypted to obtain ciphertext data, the ciphertext data are further decrypted, the plaintext target object and the key value are restored, and the second application program can copy and paste the target object.
For the third application program which is not packaged, the key value cannot be cracked, ciphertext data cannot be searched, the target object cannot be obtained, and the target object cannot be copied and pasted, so that the data safety in the packaged application program is protected.
In the above embodiment of the present invention, when a preset copy instruction carrying a target object is received, a preset clipboard compatible with a system clipboard of a terminal in the first application is called, and a function of the system clipboard is executed by simulating the system clipboard in the first application through the preset clipboard; copying the target object into the preset clipboard, and acquiring a key value of the target object in the preset clipboard; respectively encrypting the key value and the target object and writing the key value and the target object into the system clipboard; for a terminal with an operating system of an iOS system, respectively encrypting a key value and a target object to ensure that the target object can be copied and pasted in a packaged application program; and the non-encapsulated application program cannot find the ciphertext data and further cannot obtain the target object because the key value cannot be cracked, so that the data security in the encapsulated application program is protected. The embodiment of the invention solves the problem that the switch is used by the iOS system to control the clipboard in the prior art.
Referring to fig. 3, another embodiment of the present invention provides a clipboard control method applied to a first application, where the method specifically includes the following steps:
step 301, when receiving a preset copy instruction carrying a target object, calling a preset clipboard compatible with a system clipboard of a terminal in the first application.
The first application program is a packaged application program, specifically, the attribute and implementation details of the first application program are hidden, and only the interface is externally disclosed to control the access level of reading and modification in the attribute.
When the first application program receives a preset copy instruction carrying a target object, for example, a user intends to copy the target object in the first application program to a system clipboard of a terminal where the first application program is located, a long press operation or other operation triggering the copy instruction may be performed on the target object, and when the first application program detects the operation, it is confirmed that the preset copy instruction for the target object is received, and a preset clipboard preset inside is called, where the preset clipboard is compatible with the system clipboard of the terminal where the first application program is located, and the function of the system clipboard can be executed by simulating the system clipboard inside the first application program through the preset clipboard.
Step 302, copying the target object into the preset clipboard, and obtaining a key value of the target object in the preset clipboard.
The preset clipboard is compatible with the system clipboard, the system clipboard is simulated in the first application program through the preset clipboard, the function of the system clipboard is executed, the target object is copied into the preset clipboard, and then the key value obtained after copying is the same as the key value obtained by copying the target object into the system clipboard.
Step 303, encrypting the key value according to a first preset encryption algorithm to obtain a ciphertext key value; and encrypting the target object according to a second preset encryption algorithm to obtain ciphertext data.
The key value is encrypted through a first preset encryption algorithm to obtain a ciphertext key value, so that the ciphertext key value can be decrypted by a packaged application program but cannot be decrypted by a non-packaged application program; in order to improve data security, the target object is further encrypted through a second preset encryption algorithm to obtain ciphertext data, so that the ciphertext data can be decrypted by a packaged application program but not by the packaged application program.
And step 304, writing the ciphertext key value and the ciphertext data into the system clipboard.
In order to realize the safe control of the clipboard, when the operating system of the terminal is an iOS system, the key values and the target objects are respectively encrypted, and then encrypted ciphertext key values and encrypted target objects (namely ciphertext data) are written into the system clipboard, wherein the encryption and decryption modes are only shared inside the encapsulated application program which is the same as the first application program, and the non-encapsulated application program cannot crack the key value plaintext, so that the ciphertext data cannot be searched from the system clipboard.
Optionally, in this embodiment of the present invention, the step of writing the ciphertext key and the ciphertext data into the system clipboard includes:
and adding a preset tag for the ciphertext key value.
The preset tag is used for indicating that the key value corresponding to the system clipboard is updated, namely, the data stored in the system clipboard is updated, and other application programs can be notified of the update through the preset tag.
In the above embodiment of the present invention, when a preset copy instruction carrying a target object is received, a preset clipboard compatible with a system clipboard of a terminal in the first application is called, and a function of the system clipboard is executed by simulating the system clipboard in the first application through the preset clipboard; copying the target object into the preset clipboard, and acquiring a key value of the target object in the preset clipboard; respectively encrypting the key value and the target object and writing the key value and the target object into the system clipboard; for a terminal with an operating system of an iOS system, respectively encrypting a key value and a target object to ensure that the target object can be copied and pasted in a packaged application program; and the non-encapsulated application program cannot find the ciphertext data and further cannot obtain the target object because the key value cannot be cracked, so that the data security in the encapsulated application program is protected.
Fig. 4 is a flowchart illustrating a clipboard control method according to an embodiment of the present invention.
As shown in fig. 4, the clipboard control method provided by the embodiment of the present invention is applied to a second application, and the method includes:
step 401, when it is monitored that a ciphertext key value is newly added to a system clipboard of a terminal, decrypting the ciphertext key value to obtain a key value.
The second application program is a packaged application program, specifically, the attribute and implementation details of the second application program are hidden, and only the interface is externally disclosed to control the access level of reading and modification in the attribute.
The clipboard provides an area for the operating system to centrally store data so that applications can share data with each other. The user can copy a copy of data in a certain program, and paste the data into the next program after switching to the next program; and most operating system clipboards have functions similar to cut, copy, paste operations.
And when the second application program monitors that the ciphertext key values are newly added in the system clipboard of the terminal, the ciphertext key values are decrypted according to a preset decryption algorithm to obtain the key values.
Step 402, searching cipher text data according to the key value, and decrypting the cipher text data to obtain a target object.
After the key value is obtained through decryption, ciphertext data corresponding to the key value is searched in the terminal system according to the key value, the ciphertext data is decrypted according to a preset decryption mode to obtain a target object, and the target object is obtained by encrypting internal data of other encapsulation application programs and writing the encrypted internal data into a system clipboard.
Step 403, calling a preset clipboard compatible with a system clipboard of the terminal in the second application program, and writing the decrypted key value and the target object into the preset clipboard.
After the second application program obtains the key value and the target object, a preset clipboard preset in the second application program is called, the preset clipboard is compatible with a system clipboard of a terminal where the second application program is located, the system clipboard can be simulated in the second application program through the preset clipboard, and functions of the system clipboard are executed.
And after the preset clipboard is called, writing the decrypted key value and the target object into the preset clipboard, so that the target object can be used in the second application program.
For example, referring to fig. 2, a first application program writes a target object and a key value into a system clipboard after encrypting the target object and the key value respectively; a second application program and a third application program of the same terminal detect that the key value of the system clipboard is updated; the second application program is used as a packaging application program, a target object and a decryption algorithm of the key value are predicted, the key value is decrypted to obtain ciphertext data, the ciphertext data are further decrypted, the plaintext target object and the key value are restored, and the second application program can copy and paste the target object.
For the third application program which is not packaged, the key value cannot be cracked, ciphertext data cannot be searched, the target object cannot be obtained, and the target object cannot be copied and pasted, so that the data safety in the packaged application program is protected.
In the embodiment of the invention, when a ciphertext key value is newly added to a system clipboard of a terminal, the ciphertext key value is decrypted to obtain the key value; searching ciphertext data according to the key value, and decrypting the ciphertext data to obtain a target object; and calling a preset clipboard compatible with a system clipboard of the terminal in the second application program, and writing the decrypted key value and the target object into the preset clipboard. Simulating a system clipboard to execute the function of the system clipboard in the second application program through a preset clipboard, and for a terminal with an operating system of an iOS system, respectively decrypting a ciphertext key value and ciphertext data to obtain a key value and a target object, so as to realize the copying and pasting of the target object in the packaged application program; and the non-encapsulated application program cannot find the ciphertext data and further cannot obtain the target object because the key value cannot be cracked, so that the data security in the encapsulated application program is protected. The embodiment of the invention solves the problem that the switch is used by the iOS system to control the clipboard in the prior art.
Optionally, in the embodiment of the present invention, the ciphertext key value is obtained by encrypting, by the first application program of the terminal, the key value of the target object according to a first preset encryption algorithm; and the first application program encrypts the key value through a first preset encryption algorithm to obtain a ciphertext key value.
Therefore, the step of decrypting the ciphertext key to obtain the key includes:
and decrypting the ciphertext key value according to a first preset decryption algorithm corresponding to the first preset encryption algorithm to obtain the key value.
And the second application program decrypts the ciphertext key assignment through a first preset decryption algorithm corresponding to the first preset encryption algorithm to obtain the key assignment, so that the ciphertext key assignment can be decrypted by the encapsulation application program, but the key assignment cannot be decrypted by the non-encapsulation application program.
Optionally, in the embodiment of the present invention, the ciphertext data is obtained by encrypting the target object by the first application program of the terminal according to a second preset encryption algorithm; in order to improve data security, the first application program further encrypts the target object through a second preset encryption algorithm to obtain ciphertext data, so that the ciphertext data can be decrypted by the encapsulation application program but not by the encapsulation application program.
The step of decrypting the ciphertext data to obtain the target object includes:
and decrypting the ciphertext data according to a second preset decryption algorithm corresponding to the second preset encryption algorithm to obtain the target object.
And the second application program decrypts the ciphertext data through a second preset decryption algorithm corresponding to the second preset encryption algorithm to obtain the target object.
Optionally, in the embodiment of the present invention, the step of monitoring that a ciphertext key value is newly added to a system clipboard of the terminal includes:
and determining a newly added ciphertext key value when the key value corresponding to the preset tag in the system clipboard of the terminal is monitored to be updated.
The preset tag is used for indicating that the key value corresponding to the system clipboard is updated, namely the data stored in the system clipboard is updated, and when the second application monitors that the key value corresponding to the preset tag is updated, the newly added ciphertext key value is determined.
In the embodiment of the invention, when a ciphertext key value is newly added to a system clipboard of a terminal, the ciphertext key value is decrypted to obtain the key value; searching ciphertext data according to the key value, and decrypting the ciphertext data to obtain a target object; and calling a preset clipboard compatible with a system clipboard of the terminal in the second application program, and writing the decrypted key value and the target object into the preset clipboard. Simulating a system clipboard to execute the function of the system clipboard in the second application program through a preset clipboard, and for a terminal with an operating system of an iOS system, respectively decrypting a ciphertext key value and ciphertext data to obtain a key value and a target object, so as to realize the copying and pasting of the target object in the packaged application program; and the non-encapsulated application program cannot find the ciphertext data and further cannot obtain the target object because the key value cannot be cracked, so that the data security in the encapsulated application program is protected.
The clipboard control method according to the embodiment of the present invention is described above, and the clipboard control apparatus according to the embodiment of the present invention will be described below with reference to the accompanying drawings.
Referring to fig. 5, an embodiment of the present invention provides a clipboard control apparatus applied to a first application, where the apparatus includes:
the instruction receiving module 501 is configured to call a preset clipboard compatible with a system clipboard of a terminal in the first application program when receiving a preset copy instruction carrying a target object.
The first application program is a packaged application program, specifically, the attribute and implementation details of the first application program are hidden, and only the interface is externally disclosed to control the access level of reading and modification in the attribute.
When the first application program receives a preset copy instruction carrying a target object, for example, a user intends to copy the target object in the first application program to a system clipboard of a terminal where the first application program is located, a long press operation or other operation triggering the copy instruction may be performed on the target object, and when the first application program detects the operation, it is confirmed that the preset copy instruction for the target object is received, and a preset clipboard preset inside is called, where the preset clipboard is compatible with the system clipboard of the terminal where the first application program is located, and the function of the system clipboard can be executed by simulating the system clipboard inside the first application program through the preset clipboard.
A key value obtaining module 502, configured to copy the target object into the preset clipboard, and obtain a key value of the target object in the preset clipboard.
The preset clipboard is compatible with the system clipboard, the system clipboard is simulated in the first application program through the preset clipboard, the function of the system clipboard is executed, the target object is copied into the preset clipboard, and then the key value obtained after copying is the same as the key value obtained by copying the target object into the system clipboard.
A writing module 503, configured to write the key value and the target object into the system clipboard after being encrypted respectively.
In order to realize the safe control of the clipboard, when the operating system of the terminal is an iOS system, the key values and the target objects are respectively encrypted, and then encrypted ciphertext key values and encrypted target objects (namely ciphertext data) are written into the system clipboard, wherein the encryption and decryption modes are only shared inside the encapsulated application program which is the same as the first application program, and the non-encapsulated application program cannot crack the key value plaintext, so that the ciphertext data cannot be searched from the system clipboard.
Optionally, in this embodiment of the present invention, the writing module 503 includes:
the encryption submodule is used for encrypting the key value according to a first preset encryption algorithm to obtain a ciphertext key value; encrypting the target object according to a second preset encryption algorithm to obtain ciphertext data;
and the writing sub-module is used for writing the ciphertext key value and the ciphertext data into the system clipboard.
Optionally, in an embodiment of the present invention, the write submodule includes:
and adding a preset tag for the ciphertext key value.
In the above embodiment of the present invention, when receiving a preset copy instruction carrying a target object, the instruction receiving module 501 invokes a preset clipboard compatible with a system clipboard of a terminal in the first application, and simulates the system clipboard to execute a function of the system clipboard in the first application through the preset clipboard; the key value obtaining module 502 copies the target object into the preset clipboard, and obtains the key value of the target object in the preset clipboard; the writing module 503 writes the key value and the target object into the system clipboard after encrypting them respectively; for a terminal with an operating system of an iOS system, respectively encrypting a key value and a target object to ensure that the target object can be copied and pasted in a packaged application program; and the non-encapsulated application program cannot find the ciphertext data and further cannot obtain the target object because the key value cannot be cracked, so that the data security in the encapsulated application program is protected.
Referring to fig. 6, an embodiment of the present invention provides a clipboard control apparatus applied to a second application, where the apparatus includes:
the monitoring module 601 is configured to decrypt the ciphertext key value to obtain the key value when it is monitored that the ciphertext key value is newly added to a system clipboard of the terminal.
The second application program is a packaged application program, specifically, the attribute and implementation details of the second application program are hidden, and only the interface is externally disclosed to control the access level of reading and modification in the attribute.
The clipboard provides an area for the operating system to centrally store data so that applications can share data with each other. The user can copy a copy of data in a certain program, and paste the data into the next program after switching to the next program; and most operating system clipboards have functions similar to cut, copy, paste operations.
And when the second application program monitors that the ciphertext key values are newly added in the system clipboard of the terminal, the ciphertext key values are decrypted according to a preset decryption algorithm to obtain the key values.
The decryption module 602 is configured to search for ciphertext data according to the key value, and decrypt the ciphertext data to obtain a target object.
After the key value is obtained through decryption, ciphertext data corresponding to the key value is searched in the terminal system according to the key value, the ciphertext data is decrypted according to a preset decryption mode to obtain a target object, and the target object is obtained by encrypting internal data of other encapsulation application programs and writing the encrypted internal data into a system clipboard.
The invoking module 603 is configured to invoke a preset clipboard compatible with a system clipboard of the terminal in the second application, and write the decrypted key value and the target object into the preset clipboard.
After the second application program obtains the key value and the target object, a preset clipboard preset in the second application program is called, the preset clipboard is compatible with a system clipboard of a terminal where the second application program is located, and the function of the system clipboard can be executed by simulating the system clipboard in the second application program through the preset clipboard.
And after the preset clipboard is called, writing the decrypted key value and the target object into the preset clipboard, so that the target object can be used in the second application program.
Optionally, in the embodiment of the present invention, the ciphertext key value is obtained by encrypting, by the first application program of the terminal, the key value of the target object according to a first preset encryption algorithm;
the decryption module 602 includes:
and the first decryption submodule is used for decrypting the ciphertext key value according to a first preset decryption algorithm corresponding to the first preset encryption algorithm to obtain the key value.
Optionally, in the embodiment of the present invention, the ciphertext data is obtained by encrypting the target object by the first application program of the terminal according to a second preset encryption algorithm;
the decryption module 602 includes:
and the second decryption submodule is used for decrypting the ciphertext data according to a second preset decryption algorithm corresponding to the second preset encryption algorithm to obtain the target object.
Optionally, in this embodiment of the present invention, the monitoring module 601 is configured to:
and determining a newly added ciphertext key value when the key value corresponding to the preset tag in the system clipboard of the terminal is monitored to be updated.
In the above embodiment of the present invention, when the monitoring module 601 monitors that a ciphertext key value is newly added to the system clipboard of the terminal, the ciphertext key value is decrypted to obtain a key value; the decryption module 602 searches for ciphertext data according to the key value, and decrypts the ciphertext data to obtain a target object; the calling module 603 calls a preset clipboard compatible with a system clipboard of the terminal in the second application program, and writes the decrypted key value and the target object into the preset clipboard. Simulating a system clipboard to execute the function of the system clipboard in the second application program through a preset clipboard, and for a terminal with an operating system of an iOS system, respectively decrypting a ciphertext key value and ciphertext data to obtain a key value and a target object, so as to realize the copying and pasting of the target object in the packaged application program; and the non-encapsulated application program cannot find the ciphertext data and further cannot obtain the target object because the key value cannot be cracked, so that the data security in the encapsulated application program is protected.
Fig. 7 is a schematic structural diagram of an electronic device according to yet another embodiment of the present invention.
As shown in fig. 7, the electronic device may include: a processor (processor)710, a communication Interface (Communications Interface)720, a memory (memory)730, and a communication bus 740, wherein the processor 710, the communication Interface 720, and the memory 730 communicate with each other via the communication bus 740. Processor 710 may call logic instructions in memory 730 to perform the following method:
when a preset copying instruction carrying a target object is received, calling a preset clipboard compatible with a system clipboard of a terminal in the first application program;
copying the target object into the preset clipboard, and acquiring a key value of the target object in the preset clipboard;
and respectively encrypting the key value and the target object and writing the encrypted key value and the target object into the system clipboard.
Or
When a ciphertext key value is newly added in a system clipboard of the terminal, the ciphertext key value is decrypted to obtain a key value;
searching ciphertext data according to the key value, and decrypting the ciphertext data to obtain a target object;
and calling a preset clipboard compatible with a system clipboard of the terminal in the second application program, and writing the decrypted key value and the target object into the preset clipboard.
In addition, the logic instructions in the memory 730 can be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products.
In another embodiment of the present invention, a non-transitory computer-readable storage medium is provided, where a computer program is stored on the non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the steps in the method provided in the foregoing embodiment of the present invention are implemented, and details of the implementation are not repeated.
Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (11)

1. A clipboard control method applied to a first application program is characterized in that in an IOS system, the method comprises the following steps:
when a preset copying instruction carrying a target object is received, calling a preset clipboard compatible with a system clipboard of a terminal in the first application program;
copying the target object into the preset clipboard, and acquiring a key value of the target object in the preset clipboard;
and respectively encrypting the key value and the target object and writing the encrypted key value and the target object into the system clipboard.
2. The method of claim 1, wherein the step of writing the key value and the target object to the system clipboard after being encrypted respectively comprises:
encrypting the key value according to a first preset encryption algorithm to obtain a ciphertext key value; encrypting the target object according to a second preset encryption algorithm to obtain ciphertext data;
and writing the ciphertext key value and the ciphertext data into the system clipboard.
3. The method of claim 2, wherein the step of writing the ciphertext key and the ciphertext data to the system clipboard comprises:
and adding a preset tag for the ciphertext key value.
4. A clipboard control method applied to a second application program is characterized in that in an IOS system, the method comprises the following steps:
when a ciphertext key value is newly added in a system clipboard of the terminal, the ciphertext key value is decrypted to obtain a key value;
searching ciphertext data according to the key value, and decrypting the ciphertext data to obtain a target object;
and calling a preset clipboard compatible with a system clipboard of the terminal in the second application program, and writing the decrypted key value and the target object into the preset clipboard.
5. The method according to claim 4, wherein the ciphertext key is obtained by encrypting a key of a target object by a first application program of the terminal according to a first preset encryption algorithm;
the step of decrypting the ciphertext key value to obtain the key value comprises the following steps:
and decrypting the ciphertext key value according to a first preset decryption algorithm corresponding to the first preset encryption algorithm to obtain the key value.
6. The method according to claim 4, wherein the ciphertext data is obtained by encrypting the target object according to a second preset encryption algorithm by a first application program of the terminal;
the step of decrypting the ciphertext data to obtain the target object includes:
and decrypting the ciphertext data according to a second preset decryption algorithm corresponding to the second preset encryption algorithm to obtain the target object.
7. The method of claim 4, wherein the step of monitoring a ciphertext key value newly added to a system clipboard of the terminal comprises:
and determining a newly added ciphertext key value when the key value corresponding to the preset tag in the system clipboard of the terminal is monitored to be updated.
8. A clipboard control apparatus applied to a first application, the apparatus comprising, in an IOS system:
the instruction receiving module is used for calling a preset clipboard compatible with a system clipboard of the terminal in the first application program when receiving a preset copying instruction carrying a target object;
the key value obtaining module is used for copying the target object into the preset clipboard and obtaining the key value of the target object in the preset clipboard;
and the writing module is used for writing the key value and the target object into the system clipboard after encrypting the key value and the target object respectively.
9. A clipboard control apparatus applied to a second application, the apparatus comprising, in an IOS system:
the monitoring module is used for decrypting the ciphertext key values to obtain key values when monitoring that the ciphertext key values are newly added in a system clipboard of the terminal;
the decryption module is used for searching ciphertext data according to the key value and decrypting the ciphertext data to obtain a target object;
and the calling module is used for calling a preset clipboard compatible with a system clipboard of the terminal in the second application program and writing the decrypted key value and the target object into the preset clipboard.
10. An electronic device comprising a memory, a processor, a bus and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the clipboard control method of any one of claims 1 to 7 when executing the program.
11. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that: the program, when executed by a processor, implements the steps in a clipboard control method of any one of claims 1 to 7.
CN201811646014.5A 2018-12-29 2018-12-29 Clipboard control method and device Active CN109857571B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811646014.5A CN109857571B (en) 2018-12-29 2018-12-29 Clipboard control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811646014.5A CN109857571B (en) 2018-12-29 2018-12-29 Clipboard control method and device

Publications (2)

Publication Number Publication Date
CN109857571A CN109857571A (en) 2019-06-07
CN109857571B true CN109857571B (en) 2021-03-12

Family

ID=66893463

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811646014.5A Active CN109857571B (en) 2018-12-29 2018-12-29 Clipboard control method and device

Country Status (1)

Country Link
CN (1) CN109857571B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110262908A (en) * 2019-06-21 2019-09-20 珠海格力电器股份有限公司 A kind of processing method and processing device of shear plate data
CN111539010B (en) * 2020-06-16 2023-09-01 北京明朝万达科技股份有限公司 Clipboard control method, device, electronic equipment and computer readable storage medium
CN111782424A (en) * 2020-07-03 2020-10-16 厦门美图之家科技有限公司 Data processing method and device, electronic equipment and storage medium
CN116484396B (en) * 2023-03-13 2023-10-31 数影星球(杭州)科技有限公司 Method and system for encrypting clipboard content based on browser

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783038A (en) * 2004-11-29 2006-06-07 富士通株式会社 Information leakage prevention method and apparatus and program for the same
CN101114319A (en) * 2006-07-28 2008-01-30 上海山丽信息安全有限公司 Shear plate information protecting equipment and method thereof
CN101441622A (en) * 2008-12-29 2009-05-27 成都市华为赛门铁克科技有限公司 Method and apparatus for controlling operation of document
CN102609642A (en) * 2012-01-09 2012-07-25 中标软件有限公司 Clipboard control method and clipboard control system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783038A (en) * 2004-11-29 2006-06-07 富士通株式会社 Information leakage prevention method and apparatus and program for the same
CN101114319A (en) * 2006-07-28 2008-01-30 上海山丽信息安全有限公司 Shear plate information protecting equipment and method thereof
CN101441622A (en) * 2008-12-29 2009-05-27 成都市华为赛门铁克科技有限公司 Method and apparatus for controlling operation of document
CN102609642A (en) * 2012-01-09 2012-07-25 中标软件有限公司 Clipboard control method and clipboard control system

Also Published As

Publication number Publication date
CN109857571A (en) 2019-06-07

Similar Documents

Publication Publication Date Title
CN109857571B (en) Clipboard control method and device
CN112287372B (en) Method and apparatus for protecting clipboard privacy
US9037870B1 (en) Method and system for providing a rotating key encrypted file system
CN106997439B (en) TrustZone-based data encryption and decryption method and device and terminal equipment
WO2018218953A1 (en) Data backup method and device, storage medium and server
CN107256362B (en) Application-level file system isolation method and device
EP3186943B1 (en) Device verification prior to registration
US9659189B2 (en) Systems and methods of safeguarding user information while interacting with online service providers
CN107277028B (en) Method, device, equipment and storage medium for transmitting chat emoticons among applications
CN111339543A (en) File processing method and device, equipment and storage medium
CN112231124B (en) Inter-application communication method and device based on privacy protection
CN110807205B (en) File security protection method and device
CN113642014A (en) Data access system based on hybrid cloud and public cloud server
CN104601820A (en) Mobile terminal information protection method based on TF password card
CN108985109B (en) Data storage method and device
CN112182518A (en) Software deployment method and device
CN109065077B (en) Method and device for manufacturing encrypted optical disk
CN109995534B (en) Method and device for carrying out security authentication on application program
CN111222151A (en) Mobile terminal application directory protection method and device
CN110768990A (en) Data transmission method, system, equipment and computer readable storage medium
CN105302617A (en) Method and sever for downloading application program
CN111931222B (en) Application data encryption method, device, terminal and storage medium
US9537842B2 (en) Secondary communications channel facilitating document security
WO2020052518A1 (en) Data processing method, terminal and computer readable storage medium
KR102368208B1 (en) File leakage prevention based on security file system and commonly used file access interface

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Room 332, 3 / F, Building 102, 28 xinjiekouwei street, Xicheng District, Beijing 100088

Applicant after: Qianxin Technology Group Co.,Ltd.

Address before: 100015 15, 17 floor 1701-26, 3 building, 10 Jiuxianqiao Road, Chaoyang District, Beijing.

Applicant before: Beijing Qi'anxin Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant