CN116611078A - Sample information matching method and device, equipment and storage medium - Google Patents

Sample information matching method and device, equipment and storage medium Download PDF

Info

Publication number
CN116611078A
CN116611078A CN202210122900.8A CN202210122900A CN116611078A CN 116611078 A CN116611078 A CN 116611078A CN 202210122900 A CN202210122900 A CN 202210122900A CN 116611078 A CN116611078 A CN 116611078A
Authority
CN
China
Prior art keywords
sample information
client
private key
encrypted
public key
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.)
Pending
Application number
CN202210122900.8A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202210122900.8A priority Critical patent/CN116611078A/en
Publication of CN116611078A publication Critical patent/CN116611078A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the invention discloses a sample information matching method, a device, equipment and a storage medium, wherein the method comprises the following steps: the first client generates a private key and a public key, sends the public key to the second client, encrypts, noisy and hashes the second original sample information based on the public key, and then sends the second original sample information to the first client.

Description

Sample information matching method and device, equipment and storage medium
Technical Field
The present invention relates to the field of information security technologies, and in particular, to a method, an apparatus, a device, and a storage medium for sample information matching.
Background
The current sample information matching method is to match sample information of sample information IDs of two parties or hash values of the sample information IDs, wherein the hash values of the sample information IDs are obtained through an MD5 algorithm.
In the sample information matching process, sample information is directly matched with sample information IDs of both parties, and at this time, sample information IDs of both parties are exposed to each other, so that the privacy is revealed. And after the sample information ID is encrypted by the MD5 algorithm, the sample information ID cannot be restored by the MD5 value, but the MD5 value obtained by encrypting the sample information ID by the MD5 algorithm is fixed, so the sample information ID is encrypted by the MD5 algorithm and the sample information is matched, and the encrypted sample information ID is subjected to violent cracking attack, so that the problem of data privacy leakage is caused. Therefore, how to improve the security of data in the sample information matching process is a problem to be solved.
Disclosure of Invention
The embodiment of the invention provides a sample information matching method, a device, equipment and a storage medium, which can improve the safety of data in the sample information matching process and reduce the risk of privacy disclosure.
The technical scheme of the invention is realized as follows:
the embodiment of the invention provides a sample information matching method, which is applied to a first client and comprises the following steps:
sending a sample information matching request to a second client, wherein the sample information matching request carries a public key;
receiving second public key encrypted sample information sent by the second client in response to the sample information matching request; the second public key encrypted sample information represents second original sample information which is subjected to noise adding and encrypted by the public key in the second client;
decrypting and encrypting the second public key encryption sample information based on the public key and the private key to obtain corresponding second private key encryption sample information; wherein the private key is paired with the public key;
encrypting the first sample information based on the private key to obtain first sample information to be matched, and sending the first sample information to be matched and the second sample information encrypted by the private key to the second client;
and receiving a matching result sent by the second client, wherein the matching result is a response result of the sample information matching request, and the matching result is obtained based on the first sample information to be matched and the second private key encrypted sample information.
In the above scheme, the decrypting and encrypting the second public key encrypted sample information based on the public key and the private key to obtain corresponding second private key encrypted sample information includes:
decrypting the second public key encrypted sample information according to the public key to obtain second encrypted sample information;
and encrypting the second encrypted sample information according to the private key, thereby obtaining second private key encrypted sample information.
In the above scheme, the method further comprises:
and carrying out hash operation on the first original sample information to obtain the first sample information.
In the above scheme, encrypting the first sample information based on the private key to obtain first sample information to be matched, and sending the first sample information to be matched and the second sample information encrypted by the second private key to the second client, including:
according to the private key, carrying out private key encryption on the first sample information to obtain first private key sample information;
and carrying out hash encryption on the first private key sample information so as to obtain the first sample information to be matched.
In the above scheme, the method further comprises:
caching the first sample information to be matched and the second private key encrypted sample information into a first cache space;
When the first cache space is larger than or equal to a first threshold value, sending first cache information in the first cache space to the second client; the buffer information comprises the first sample information to be matched and the second private key encrypted sample information.
The embodiment of the invention provides a sample information matching method, which is applied to a second client and comprises the following steps:
receiving a sample information matching request sent by a first client, wherein the sample information matching request carries a public key;
in response to the sample information matching request, adding noise to the second sample information based on random noise to obtain second encrypted sample information;
encrypting the second encrypted sample information based on the public key, thereby obtaining second public key encrypted sample information, and sending the second public key encrypted sample information to the first client;
receiving first sample information to be matched and second private key encryption sample information sent by the first client; the first sample information to be matched characterizes first original sample information encrypted in the first client; the second private key encryption sample information is the second public key encryption sample information decrypted and encrypted by the public key and the private key in the first client;
Noise reduction and encryption are carried out on the second private key encrypted sample information so as to obtain second sample information to be matched;
sample information matching is carried out on the first sample information to be matched and the second sample information to be matched, so that a matching result is obtained and sent to the first client; the matching result is a response result of the sample information matching request.
In the above scheme, the method further comprises:
and carrying out hash encryption on the second original sample information to obtain the second sample information.
In the above scheme, the responding to the sample information matching request, adding noise to the second sample information based on random noise, and obtaining second encrypted sample information includes:
and adding the random noise to the second sample information, so as to finish the noise adding and obtain second encrypted sample information.
In the above scheme, the noise reduction and encryption of the second private key encrypted sample information to obtain the second sample information to be matched includes:
removing the random noise in the second private key encryption sample information, thereby completing noise reduction and obtaining second private key sample information;
and carrying out hash encryption on the second private key sample information to obtain the second sample information to be matched.
In the above scheme, the method further comprises:
caching the second public key encrypted sample information into a second cache space;
when the second cache space is larger than or equal to a second threshold value, sending second cache information in the second cache space to the second client; wherein the second cache information includes the second public key encrypted sample information.
The embodiment of the invention provides a sample information matching device, which comprises a first sending unit, a first receiving unit, a first encryption unit and a first decryption unit, wherein:
the first sending unit is configured to send a sample information matching request to the second client, where the sample information matching request carries a public key; sending first sample information to be matched and second private key encryption sample information to the second client;
the first receiving unit is used for receiving second public key encrypted sample information sent by the second client in response to the sample information matching request; the second public key encrypted sample information represents second original sample information which is subjected to noise adding and encrypted by the public key in the second client; receiving a matching result sent by the second client, wherein the matching result is a response result of the sample information matching request, and the matching result is obtained based on the first sample information to be matched and the second private key encrypted sample information;
The first decryption unit is used for decrypting the second public key encryption sample information based on the public key;
the first encryption unit is used for encrypting the decrypted second public key encryption sample information based on the private key to obtain corresponding second private key encryption sample information; wherein the private key is paired with the public key; and encrypting the first sample information based on the private key to obtain first sample information to be matched.
In the above scheme, the first decryption unit is further configured to decrypt the second public key encrypted sample information according to the public key to obtain second encrypted sample information;
the first encryption unit is further configured to encrypt the second encrypted sample information according to the private key, so as to obtain second private key encrypted sample information.
In the above scheme, the first encryption unit is further configured to perform hash operation on the first original sample information to obtain the first sample information.
In the above scheme, the first encryption unit is further configured to encrypt the first sample information with a private key according to the private key, so as to obtain first private key sample information; and carrying out hash encryption on the first private key sample information so as to obtain the first sample information to be matched.
In the above scheme, the device further includes a first buffer unit, where:
the first buffer unit is configured to buffer the first sample information to be matched and the second private key encrypted sample information to a first buffer space;
the first sending unit is further configured to send, when the first cache space is greater than or equal to a first threshold, first cache information in the first cache space to the second client; the buffer information comprises the first sample information to be matched and the second private key encrypted sample information.
The embodiment of the invention provides a sample information matching device, which comprises a second sending unit, a second receiving unit, a second encryption unit, a second decryption unit and a matching unit; wherein:
the second sending unit is used for sending the second public key encryption sample information to the first client; sending a matching result to the first client; the matching result is a response result of the sample information matching request;
the second receiving unit is used for receiving a sample information matching request sent by the first client, wherein the sample information matching request carries a public key; receiving first sample information to be matched and second private key encryption sample information sent by the first client; the first sample information to be matched characterizes first original sample information encrypted in the first client; the second private key encryption sample information is the second public key encryption sample information decrypted and encrypted by the public key and the private key in the first client;
The second encryption unit is used for responding to the sample information matching request, and adding noise to the second sample information based on random noise to obtain second encrypted sample information; encrypting the second encrypted sample information based on the public key, thereby obtaining second public key encrypted sample information; encrypting the noise-reduced second private key encrypted sample information to obtain second sample information to be matched;
the second decryption unit is used for reducing noise of the second private key encryption sample information;
the matching unit is used for performing sample information matching on the first sample information to be matched and the second sample information to be matched.
In the above scheme, the second encryption unit is further configured to perform hash operation on the second original sample information to obtain the second sample information.
In the above scheme, the second encryption unit is further configured to add the random noise to the second sample information, thereby completing noise adding and obtaining second encrypted sample information.
In the above scheme, the second decryption unit is further configured to remove the random noise in the second private key encrypted sample information, thereby completing noise reduction and obtaining second private key sample information;
The second encryption unit is further configured to perform hash encryption on the second private key sample information to obtain the second sample information to be matched.
In the above scheme, the device further includes a second buffer unit, where:
the second buffer unit is configured to buffer the second public key encrypted sample information to a second buffer space;
the second sending unit is further configured to send second cache information in the second cache space to the second client when the second cache space is greater than or equal to a second threshold; wherein the second cache information includes the second public key encrypted sample information.
The embodiment of the invention provides a first client, which comprises the following steps:
a first memory for storing executable data instructions;
and the first processor is used for realizing the sample information matching method applied to the first client when executing the executable instructions stored in the first memory.
The embodiment of the invention provides a second client, which comprises the following steps:
a second memory for storing executable data instructions;
and the second processor is used for realizing the sample information matching method applied to the second client when executing the executable instructions stored in the second memory.
The embodiment of the invention provides a computer readable storage medium, which stores executable instructions for causing a first processor to execute, so as to implement a sample information matching method applied to a first client according to the embodiment of the invention.
The embodiment of the invention provides a computer readable storage medium, which stores executable instructions for causing a second processor to execute, so as to implement the sample information matching method applied to a second client according to the embodiment of the invention.
The embodiment of the invention provides a sample information matching method, a device, equipment and a storage medium, wherein the method comprises the following steps: the first client generates a private key and a public key, sends the public key to the second client, encrypts, noisy and hashes the second original sample information based on the public key, and then sends the second original sample information to the first client, then the first client decrypts and encrypts the processed second original sample information based on the public key and the private key, encrypts and hashes the first original sample information based on the private key, finally the first client sends the second original sample information encrypted by the private key and the first original sample information to the second client, processes the processed first original sample information and the processed second original sample information to the same dimension through the second client, and performs sample information matching to obtain a matching result.
In the embodiment of the invention, in the process of data transmission, the first client and the second client encrypt the transmitted data by the public key or the private key, so that the difficulty of attacking the data in the process of data transmission is improved. And the second client can not acquire the second original sample information by adding noise, and the first client can not acquire the first original sample information by using the private key, so that the security of the data privacy is improved, and the risk of the data privacy being leaked is reduced.
Drawings
Fig. 1 is a schematic diagram of a sample information matching scenario provided in an embodiment of the present invention;
fig. 2 is a flowchart of a sample information matching method applied to a first client according to an embodiment of the present invention;
FIG. 3 is a functional architecture diagram of a sample information matching device according to an embodiment of the present invention;
fig. 4 is a second flowchart of a sample information matching method applied to a first client according to an embodiment of the present invention;
fig. 5 is a flowchart of a sample information matching method applied to a second client according to an embodiment of the present invention;
fig. 6 is a second flowchart of a sample information matching method applied to a second client according to an embodiment of the present invention;
Fig. 7 is a flowchart of a sample information matching method according to an embodiment of the present invention;
fig. 8 is a second flow chart of a sample information matching method according to an embodiment of the present invention;
FIG. 9 is a functional architecture diagram of another sample information matching device according to an embodiment of the present invention;
FIG. 10 is a functional architecture diagram of a sample information matching device according to an embodiment of the present invention;
fig. 11 is a functional architecture diagram of a first client according to an embodiment of the present invention;
fig. 12 is a functional architecture diagram of a second client according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Fig. 1 is a schematic diagram of a sample information matching scenario provided by an embodiment of the present invention, and as shown in fig. 1, the embodiment of the present invention provides a sample information matching scenario, including a first client 1 and a second client 2; data exchange is achieved between the first client 1 and the second client 2 through federal learning (Federated Learning). Wherein federal learning is used to assist multiple institutions in data usage and machine learning modeling under the satisfaction of user privacy protection, data security, and government regulations, i.e., through federal learning, the first client 1 and the second client 2 can implement data interaction on the basis of not sharing data.
In some embodiments of the present invention, the first client 1 is an enterprise a, and the relevant data of the user of the enterprise a is first data; the second client 2 is an enterprise B, and the related data of the user of the enterprise B is second data; when the enterprise a and the enterprise B need to train the machine learning model and the enterprise B has tag data that the machine learning model needs to predict, the enterprise a and the enterprise B can build a model by using the federal learning system, and the overlapping users in the first data and the second data are determined on the premise that the enterprise a and the enterprise B do not disclose the first data and the second data. Here, the process of determining overlapping users in the first data and the second data on the premise that the first data and the second data are not disclosed by the enterprise a and the enterprise B is a process of matching sample information. After the overlapping users are determined, the enterprise B can send the data related to the overlapping users in the tag data to the enterprise A as data to be exchanged according to the determined overlapping users, so that the enterprise A can train a learning model by utilizing the data to be exchanged.
In some embodiments of the invention, both the first client 1 and the second client 2 may be used to initiate a service request as well as to respond to a service request. I.e. the functional structure of the first client 1 and the second client 2 may be identical and provide corresponding services as required. In addition, the first client 1 may initiate a service request while responding to the service request, and the second client 2 may also initiate a service request while responding to the service request. Here, the service request may be request sample information matching.
Fig. 2 is a flowchart of a sample information matching method applied to a first client, as shown in fig. 2, provided in an embodiment of the present invention, and the sample information matching method applied to the first client includes:
s201, a sample information matching request is sent to a second client, wherein the sample information matching request carries a public key.
The embodiment of the invention is suitable for a scene that the first client initiates a sample information matching request to request sample information matching with the second client.
In the embodiment of the invention, a first client sends a sample information matching request to a second client so as to request the second client to match sample information with the first client; the sample information matching request carries a public key, and the public key is used for encrypting information sent by the second client in response to the sample information matching request through the second client.
In the embodiment of the invention, before the first client sends the sample information matching request to the second client, the first original sample information can be confirmed, namely, the validity of the first original sample information is confirmed, whether the first original sample information meets the preset requirement or not is confirmed, and the like. If the first original sample information is legal or meets the preset requirement, the first client executes S202. If the first original sample information is illegal or does not meet the preset requirement, the process is terminated, and prompt information is displayed. The preset requirements may be the format, length, etc. of the first original sample information, which is not specifically limited in this embodiment.
In the embodiment of the invention, when the first client determines that the first original sample information is legal or meets the preset requirement, the private key and the public key are generated. The first client can generate a private key through a random number generator, and then the first client processes the private key through an elliptic curve cryptography algorithm (Elliptic Curve Cryptography, ECC) to generate a public key. In practical applications, the private key and the public key are a string of characters encoded by Base 64. For example, table 1 is a sample information encryption parameter provided in the embodiment of the present invention, as shown in table 1, in the embodiment of the present invention, the private key and the public key are both strings with a length of n, the public key is (n, e), and the private key is (n, d). Wherein n is the product of two large prime numbers p and q, and the two large prime numbers p and q can be obtained by the first client side through the prime number theorem screening after the first client side randomly generates an odd number with a fixed bit degree through the random number generator.
TABLE 1
In the embodiment of the invention, the user can only decrypt the information obtained by encrypting the public key through the private key corresponding to the public key, but after one of the private key and the public key is revealed, the other key cannot be obtained through calculation of the leaked key. So that if one of a pair of keys is disclosed, the secret nature of the other is not compromised. Wherein, the public key is called public key; the secret key that is not public is a private key.
In the embodiment of the invention, the functional architecture of the first client and the second client can be the same, namely, the first client and the second client can both be used as the initiating terminal for initiating the sample information matching request; and the server can also be used as a server for responding to the sample information matching request to provide sample information matching service.
In the embodiment of the present invention, fig. 3 is a functional architecture diagram of a sample information matching device provided in the embodiment of the present invention, and as shown in fig. 3, the sample information matching device is a first client, where the first client may include an input module, a noise adding module, a sending module, a receiving module, a matching module and a storage module. When the first client is used as an initiating terminal, in practical application, the first client loads the first original sample information through the storage module, then inputs the first original sample information into the input module, and confirms the validity of the first original sample information after the input module receives the first original sample information. When the first original sample information is legal, the first client generates a public key and a private key by utilizing an RSA algorithm through the noise adding module, and then sends a sample information matching request and the public key to the second client through the sending module. The first client receives second public key encryption sample information sent by the second client through the receiving module. The first client encrypts the first original sample information by using a hash encryption mechanism and a private key through a noise adding module, decrypts and encrypts the second public key encrypted sample information by using a public key and a private key, so that the first sample information to be matched and the second private key encrypted sample information are encrypted, and the first sample information to be matched and the second private key encrypted sample information are sent to the second client. After the first client receives the matching result sent by the second client through the receiving module, if the matching result is that the matching is successful, the first client stores the first sample to be matched and the second sample to be matched into the storage module. When the first client is used as the server, the first client loads the first original sample information through the storage module, then inputs the first original sample information into the input module, and confirms the validity of the first original sample information after the input module receives the first original sample information. When the first original sample information is legal, the first client receives a sample information matching request and a public key sent by the second client through the receiving module, then the first client generates a random number through the noise adding module, and the random number, the hash encryption mechanism and the public key are utilized to noise and encrypt the first original sample information, so that a first public key encrypted sample is obtained, the first public key encrypted sample is sent to the second client through the sending module, and the second client processes the first public key encrypted sample. After the first client receives the first private key encryption sample and the second sample information to be matched through the receiving module, the first client performs noise reduction and encryption on the first private key encryption sample through the noise adding module by utilizing a random number and hash encryption mechanism, so that the first sample information to be matched is obtained. And finally, the first client finishes matching the first sample to be matched with the second sample to be matched through the matching module, obtains a corresponding matching result, and sends the matching result to the second client through the sending module. When the matching result is that the matching is successful, the first client stores the first sample to be matched and the second sample to be matched into the storage module. The Hash encryption mechanism in the above-mentioned noise adding module means that encryption is completed by Hash (Hash) in table 1, that is, hash function, and the random number generated in the noise adding module is r in table 1.
It can be appreciated that the first client sends the public key to the second client, so that the second client can encrypt the information sent to the first client in response to the sample information matching request by using the public key, and thus the first client can decrypt the original information sent by the second client by using the private key, and the possibility of leakage of the information sent by the second client can be reduced.
S202, receiving second public key encrypted sample information sent by a second client in response to a sample information matching request; the second public key encrypted sample information characterizes the second original sample information after noise addition in the second client and encryption by the public key.
The embodiment of the invention is suitable for a scene that the first client receives the second public key encryption sample information sent by the second client.
In the embodiment of the invention, a first client receives second public key encrypted sample information sent by a second client in response to a sample information matching request; the second public key encrypted sample information is second original sample information which is subjected to noise adding and is encrypted by the public key generated by the first client; the second original sample information is unencrypted sample information data stored in the second client.
In the embodiment of the invention, the first client receives the second public key encrypted sample information sent by the second client, which means that the first client successfully initiates sample information matching.
It can be appreciated that after the first client receives the second public key encrypted sample information sent by the second client, the second public key encrypted sample information can be subjected to subsequent processing. And the sample information is encrypted due to the second public key due to the noise addition and the encryption of the public key. Therefore, the second original sample information is not easy to leak in the transmission process, and the risk of data privacy disclosure is reduced.
S203, decrypting and encrypting the second public key encryption sample information based on the public key and the private key to obtain corresponding second private key encryption sample information; wherein the private key is paired with the public key.
The embodiment of the invention is suitable for a scene that the first client processes the second public key encryption sample information.
In the embodiment of the invention, after decrypting the second public key encrypted sample information by the first client to obtain the noisy second original sample information, encrypting the noisy second original sample information by the private key to obtain the second private key encrypted sample information.
It can be understood that, in the process of receiving the second public key encrypted sample information, the first client is not easy to crack after the second public key encrypted sample information is attacked; the first client decrypts the second public key encrypted sample information by using the private key to obtain the noisy second original sample information, and cannot acquire the real second original sample information. This reduces the probability of data privacy disclosure.
In some embodiments of the present invention, S203 may further include S2031 and S2032, as follows:
s2031, decrypting the second public key encrypted sample information according to the public key to obtain second encrypted sample information.
In some embodiments of the present invention, the first client decrypts the second public key encrypted sample information sent by the second client using the public key to obtain second encrypted sample information. The second encrypted sample information is the second original sample information after noise addition.
In some embodiments of the invention, since public key encryption is random, i.e., the same data is encrypted by the same public key, the resulting encrypted data will be different. The first data and the second data are the same data, and the first encrypted data and the second encrypted data are obtained by encrypting the first data and the second data by using the same public key, wherein the first encrypted data and the second encrypted data are not the same. Therefore, the first client needs to decrypt the second public key encrypted sample information by using the private key, so that subsequent sample information matching is facilitated.
It can be appreciated that the first client decrypts the second public key encrypted sample information by using the private key, so that the second public key encrypted sample information is recovered to be the second encrypted sample information, and data support is provided for subsequent sample information matching.
S2032, encrypting the second encrypted sample information according to the private key, thereby obtaining second private key encrypted sample information.
In some embodiments of the present invention, the first client encrypts the second encrypted sample information using the private key, thereby obtaining second private key encrypted sample information.
In some embodiments of the invention, the private key encryption has uniqueness, i.e., the same data, and the encrypted data obtained by encrypting with the same private key will be the same. The first data and the second data are illustratively identical data, and the first data and the second data are encrypted by using the same private key to obtain third encrypted data and fourth encrypted data, wherein the third encrypted data and the fourth encrypted data are identical.
It can be understood that the first client encrypts the second encrypted sample information by using the private key, so that the second encrypted sample information has non-falsifiability, and the security in the transmission process of the second encrypted sample information is ensured.
S204, encrypting the first sample information based on the private key to obtain first sample information to be matched, and sending the first sample information to be matched and the second sample information encrypted by the second private key to the second client.
The embodiment of the invention is suitable for the first client to process the first sample information so as to obtain the scene of the information which can be sent to the second client to match the sample information.
In the embodiment of the invention, the first client encrypts the first sample information based on the private key, and after obtaining the first sample information to be matched, the first client sends the first sample information to be matched and the second sample information encrypted by the second private key to the second client.
In the embodiment of the invention, the first client performs hash operation, private key encryption and hash encryption on the first original data, so as to obtain first sample information to be matched.
It can be understood that after the first client encrypts the first sample information based on the private key, the obtained first sample information to be matched has non-tamper-resistance, so that the security of the first sample information to be matched in the process of sending the first sample information to the second client is ensured.
In some embodiments of the present invention, the sample information matching method applied to the first client further includes: and carrying out hash operation on the first original sample information to obtain the first sample information.
In some embodiments of the present invention, the first client hashes the first original sample information, thereby obtaining the first sample information.
In some embodiments of the present invention, a hash operation is used to convert the first original sample information into an irreversible hash string of the same length. The MD5 information Digest Algorithm (MD 5 Message-Digest Algorithm) in the hash operation may convert the first original sample information into a 128-bit (16-byte) hash value, and by using the MD5 information Digest Algorithm in the hash operation, it may be ensured that the encrypted data obtained after the hash operation will be the same for the same two data.
It can be appreciated that the security of the first sample information to be matched is improved, and the probability of data privacy disclosure is reduced.
In some embodiments of the present invention, S204 may further include S2041 and S2042, as follows:
s2041, carrying out private key encryption on the first sample information according to the private key to obtain first private key sample information.
In some embodiments of the present invention, the method and the device are applicable to a scenario in which the first client performs private key encryption on the first sample information by using the private key.
In some embodiments of the present invention, the first client performs private key encryption on the first sample information by using a private key to obtain first private key sample information; here, the first private key sample information characterizes the first sample information that cannot be tampered with.
It can be understood that after the first client encrypts the first sample information with the private key, the obtained first private key sample information cannot be tampered in the transmission process, so that when the first private key sample information is attacked, a third party cannot crack the first private key sample information, and the risk of disclosure of the data privacy is reduced.
S2042, carrying out hash encryption on the first private key sample information, so as to obtain first sample information to be matched.
In some embodiments of the present invention, the method and the device are applicable to a scenario in which the first client hashes the first private key sample information.
In some embodiments of the present invention, the first client hashes the first private key sample information, thereby obtaining first sample information to be matched.
In some embodiments of the invention, the hash operation and hash encryption function are the same, both used to encrypt the information. Here, both the hash operation and the hash encryption may complete the encryption of the first original sample information and the first private key sample information by the MD5 information digest algorithm or by the hash function in table 1.
It can be understood that after the first client encrypts the first sample information with the private key, the obtained first private key sample information cannot be tampered in the transmission process, so that when the first private key sample information is attacked, a third party cannot crack the first private key sample information, and the risk of disclosure of the data privacy is reduced.
S205, receiving a matching result sent by the second client, wherein the matching result is a response result of the sample information matching request, and the matching result is obtained based on the first sample information to be matched and the second private key encrypted sample information.
The embodiment of the invention is suitable for a scene of a matching result generated by the second client in response to a sample information matching request after the first client sends the first sample information to be matched and the second private key encrypted sample information to the second client.
In the embodiment of the invention, a first client receives a matching result sent by a second client, wherein the matching result is obtained by processing the second client based on first sample information to be matched and second private key encryption sample information.
In the embodiment of the invention, if the matching result is successful, the first client and the second client prove that the overlapped sample information exists in the first client and the second client, and the first client and the second client can exchange data to train a machine learning model. If the matching result is successful, the matching result carries the first sample information to be matched and the second sample information to be matched; at this time, the first client may store the first sample information to be matched and the second sample information to be matched.
In the embodiment of the invention, the first sample information to be matched and the second sample information to be matched carried by the matching result can be exchange results obtained by the data exchange between the first client and the second client, namely, the first client can train a machine learning model through the second sample information to be matched; at this time, before the first client trains the machine learning model through the second sample information to be matched, the first client may decrypt the second sample information to be matched based on the private key.
In the embodiment of the invention, if the matching result is that the matching fails, the first client and the second client can end interaction or pop up prompt information for prompting the user that the matching fails.
It can be understood that the first client can determine the subsequent operation according to the matching result, and in the data transmission process of the first client and the second client, the transmitted data are encrypted by the public key or the private key, so that the difficulty of the data being attacked in the transmission process is improved, the first client cannot acquire the second original sample information of the second client, the security of the data privacy is improved, and the risk of the data privacy being revealed is reduced.
Fig. 4 is a second flowchart of a sample information matching method applied to a first client according to an embodiment of the present invention, as shown in fig. 4, in some embodiments of the present invention, the sample information matching method applied to a first client may further include:
s206, caching the first sample information to be matched and the second private key encrypted sample information into a first cache space.
The embodiment of the invention is suitable for the scene of data interaction between the first client and the second client.
In the embodiment of the invention, the first client caches the obtained first sample information to be matched and the second sample information to be encrypted by the second private key or part of the first sample information to be matched and part of the second sample information to be encrypted by the second private key into the first cache space in the process of processing the first original sample information to obtain the first sample information to be matched and processing the second sample information to obtain the second sample information to be encrypted by the second public key.
In the embodiment of the invention, the first client can process the first original sample information and buffer the obtained part of the first sample information to be matched into the first buffer space, or can process the second public key encrypted sample information and buffer the obtained part of the second private key encrypted sample information into the first buffer space. The first client may also process the first sample information and the second public key encrypted sample information at the same time, and cache the obtained part of the first sample information to be matched and the obtained part of the second private key encrypted sample information to the first cache space. Here, the buffer sequence of the first sample information to be matched and the second sample information encrypted by the second private key is not specifically limited in the embodiment of the present invention.
S207, when the first cache space is larger than or equal to a first threshold value, sending first cache information in the first cache space to a second client; the buffer memory information comprises first sample information to be matched and second private key encrypted sample information.
The embodiment of the invention is suitable for the scene of data interaction between the first client and the second client.
In the embodiment of the invention, when the first cache space is greater than or equal to the first threshold, the first client sends the first cache information in the first cache space to the second client. The first threshold is used for limiting the data size of the first cache space. The first threshold may be a buffer size in table 1.
In the embodiment of the invention, the cache information can be first sample information to be matched and/or second private key encrypted sample information which are cached in the first cache space; or all the information which is cached in the first cache space and contains the first sample information to be matched and/or the second private key encrypted sample information.
It can be appreciated that, in the data interaction between the first client and the second client, the first client needs to call the interface every time the first client sends the information to the second client, and frequently call the interface increases the network transmission overhead. Therefore, the first sample information to be matched and the second sample information encrypted by the private key are cached, the cached first sample information to be matched and the cached second sample information encrypted by the private key are transmitted after the transmission condition is met, the introduction of a caching mechanism is realized, the frequency of calling an interface in the information transmission process is reduced, and therefore the operation efficiency and the stability of the first client are improved, and the network transmission overhead is reduced.
Fig. 5 is a flowchart of a sample information matching method applied to a second client according to an embodiment of the present invention, as shown in fig. 5, where the sample information matching method is applied to the second client and includes:
s301, receiving a sample information matching request sent by a first client, wherein the sample information matching request carries a public key.
The embodiment of the invention is suitable for a scene that the second client receives the sample information matching request and performs sample information matching with the first client.
In the embodiment of the invention, the second client receives a sample information matching request sent by the first client, wherein the sample information matching request is used for requesting the second client to perform sample information matching with the first client.
In the embodiment of the invention, the sample information matching request carries the public key, the public key is generated by the first client, and the second client can encrypt the information sent to the first client by using the public key.
In the embodiment of the invention, after the second client receives the sample information matching request, the second client can confirm the second original sample information, namely confirm the validity of the second original sample information, and whether the second original sample information meets the preset requirements or not. If the second original sample information is legal or meets the preset requirement, the second client executes S302. If the second original sample information is illegal or does not meet the preset requirement, the process is terminated, and prompt information is displayed. The preset requirements may be used to make requirements on the format, length, etc. of the second original sample information, and the embodiment is not particularly limited.
In the embodiment of the present invention, as shown in fig. 3, the second client may include an input module, a noise adding module, a sending module, a receiving module, a matching module, and a storage module. When the second client is used as the initiating terminal, the second client generates a public key and a private key through a noise adding module by utilizing an RSA algorithm, then completes data interaction with the first client through a sending module and a receiving module, completes data processing through a hash encryption mechanism and the private key through the noise adding module, finally obtains a matching result sent by the first client, and completes initiation of a sample information matching request. When the first client is used as the service end, the second client responds to the sample information matching request initiated by the first client, generates a random number through the noise adding module while finishing data interaction with the first client through the sending module and the receiving module, and finishes processing of the data by utilizing the random number, the hash encryption mechanism and the public key. And finally, the second client finishes matching the first sample to be matched and the second sample to be matched through the matching module, obtains corresponding matching results, and sends the matching results to the first client through the sending module, thereby finishing response to the sample information matching request. The specific workflow when the second client is used as the initiator or the server, as described in the workflow when the first client is used as the initiator or the server in S201, will not be described herein.
It will be appreciated that encrypting the information sent to the first client by the second client public key in response to the sample information matching request may reduce the probability that the information sent to the first client by the second client is compromised.
S302, in response to the sample information matching request, the second sample information is noisy based on random noise, and second encrypted sample information is obtained.
The embodiment of the invention is suitable for a scene that the second client processes the second sample information.
In the embodiment of the invention, the second client responds to the sample information matching request, and noise is added to the second sample information based on random noise to obtain second encrypted sample information.
In the embodiment of the invention, the random noise is generated by the second client, and when the second sample information is a digital signal, the random noise can be a random number, and the random number can be r in table 1; when the second sample information is an analog signal, the random noise may be random audio. The second client may generate the random noise when receiving the sample information matching request, or may generate the random noise when adding noise to the second sample information. Here, the timing of generating random noise is not limited.
It can be understood that the second client-side adds noise to the second sample information based on random noise to obtain second encrypted sample information, so that if the second encrypted sample information is intercepted in the transmission process, an interceptor cannot know the real second sample information, thereby improving the safety of information transmission and reducing the risk of data privacy disclosure.
In some embodiments of the present invention, the second original sample information is hashed and encrypted to obtain second sample information.
In some embodiments of the present invention, the second client hashes the second original sample information, thereby obtaining second sample information.
In some embodiments of the present invention, hash encryption is used to hash the second original sample information, i.e., to convert the second original sample information into an irreversible hash string of the same length. The second client finishes encrypting the second original sample information through an MD5 information digest algorithm in hash encryption or through a hash function in table 1.
It can be appreciated that the security of the second encrypted sample information is improved, and the probability of data privacy disclosure is reduced.
In some embodiments of the present invention, S302 may include: and adding random noise into the second sample information, thereby completing the noise adding and obtaining second encrypted sample information.
In some embodiments of the present invention, the second client adds random noise generated by the second client to the second sample information, thereby completing the noise adding and obtaining second encrypted sample information.
It can be appreciated that the second client can noise the second sample information based on random noise to obtain second encrypted sample information, so that complexity of the second sample information can be improved, security in the transmission process of the second encrypted sample information can be improved, and the second client can remove the random noise from the second encrypted sample information, so that the second encrypted sample information is recovered to the second sample information, and the second encrypted sample information is reversible.
S303, encrypting the second encrypted sample information based on the public key, thereby obtaining second public key encrypted sample information, and sending the second public key encrypted sample information to the first client.
The embodiment of the invention is suitable for a scene that the second client encrypts the second encrypted sample information by using the public key.
In the embodiment of the invention, the second client encrypts the second encrypted sample information by using the public key sent by the first client, thereby obtaining the second public key encrypted sample information.
In the embodiment of the invention, the second public key encrypted sample information is the second original sample information added with random noise after hash encryption and public key encryption. The second client sends the second public key encrypted sample information to the first client, the first client decrypts the public key encryption in the second public key encrypted sample information by using the private key, and then the first client encrypts the second encrypted sample information by using the private key, so that the second encrypted sample information is non-tamper-proof and becomes the second private key encrypted sample information.
It can be understood that when the second client sends the second public key encrypted sample information to the first client, the risk that the second public key encrypted sample information is leaked can be reduced, and then the first client processes the second public key encrypted sample information to obtain the second private key encrypted sample information, so that the security of the second original sample information can be further improved, and the risk that the information sent by the second client is leaked can be reduced.
S304, receiving first sample information to be matched and second private key encrypted sample information sent by a first client; the first sample information to be matched characterizes first original sample information encrypted in a first client; the second private key encryption sample information is second public key encryption sample information decrypted and encrypted by the public key and the private key in the first client.
The embodiment of the invention is suitable for a scene that the second client receives the first sample information to be matched and the second private key encrypted sample information sent by the first client and provides data support for subsequent sample information matching.
In the embodiment of the invention, the second client receives the encrypted first original sample information and the processed second public key encrypted sample information sent by the first client, namely, the first sample information to be matched and the second private key encrypted sample information.
In the embodiment of the invention, after the second client receives the first sample information to be matched and the second sample information encrypted by the second private key, the second sample information encrypted by the second private key can be processed, so that the second sample information encrypted by the second private key and the first sample information to be matched are located in the same dimension, and the subsequent sample information matching is facilitated.
It is understood that the second client receives the first sample information to be matched and the second private key encrypted sample information for providing data support for subsequent sample information matching.
S305, noise reduction and encryption are carried out on the second private key encrypted sample information so as to obtain second sample information to be matched.
The embodiment of the invention is suitable for processing the second private key encrypted sample information to the scene which is in the same dimension with the first sample information to be matched by the second client.
In the embodiment of the invention, the second client performs noise reduction and encryption on the second private key encrypted sample information to obtain second sample information to be matched. The second sample information to be matched and the first sample information to be matched are in the same dimension.
In the embodiment of the present invention, the second client performs noise reduction on the second private key encrypted sample information, and is configured to remove random noise added to the second sample information by the second client in S302, so that the second private key encrypted sample information is converted into second private key sample information, and then the second private key sample information is encrypted, where the encryption method should be consistent with the encryption method of the first private key sample information by the first client in S2042.
It can be understood that in this embodiment, the second client processes the second private key encrypted sample information, so that the information to be matched obtained by processing the second client and the first client is in the same dimension, which is more convenient for matching the information to be matched later, and a matching result is obtained.
In some embodiments of the present invention, S305 may further include S3051 and S3052, as follows:
s3051, removing random noise in the second private key encryption sample information, and thus completing noise reduction and obtaining the second private key sample information.
In some embodiments of the present invention, the second client removes random noise in the second private key encrypted sample information, thereby completing noise reduction in S305, and obtaining second private key sample information.
In some embodiments of the present invention, since random noise is generated for the second client and added to the second sample information, only the second client may remove the random noise in the second private key encrypted sample information, so that the second private key encrypted sample information may be restored to the second sample information encrypted by the private key, that is, the second private key sample information.
S3052, carrying out hash encryption on the second private key sample information to obtain second sample information to be matched.
In some embodiments of the present invention, the method is applicable to obtaining a scene of sample information to be matched consistent with the first sample information dimension to be matched.
In some embodiments of the present invention, after the second client performs noise reduction on the second private key encrypted sample information, second private key sample information is obtained, and then hash encryption is performed on the second private key sample information, so that second sample information to be matched can be obtained. Here, the second sample information to be matched and the first sample information to be matched sent by the first client belong to the same dimension.
It can be appreciated that in this embodiment, since the obtained second sample information to be matched and the first sample information to be matched belong to the same dimension, and the second sample information to be matched and the first sample information to be matched are both encrypted, the second sample information to be matched and the first sample information to be matched are not easy to crack, and the security of data privacy is improved on the basis of matching the second sample information to be matched and the first sample information to be matched.
S306, sample information matching is carried out on the first sample information to be matched and the second sample information to be matched, and a matching result is obtained and sent to the first client; the matching result is a response result of the sample information matching request.
The embodiment of the invention is suitable for the second client to match the sample information and obtain the scene that the sample information matching result is sent to the first client.
In the embodiment of the invention, the second client responds to the sample information matching request sent by the first client, performs sample information matching on the first sample information to be matched and the second sample information to be matched, obtains a matching result and sends the matching result to the first client.
In the embodiment of the invention, if the obtained matching result is successful, the first client and the second client are proved to have overlapped sample information, and the first client and the second client can perform data exchange to train a machine learning model. At this time, the second client sends the first sample information to be matched and the second sample information to be matched to the first client together with the matching result. And the second client may store the first sample information to be matched and the second sample information to be matched.
In the embodiment of the invention, if the obtained matching result is that the matching is failed, the first client and the second client can end interaction or pop up prompt information for prompting the user that the matching is failed.
It will be appreciated that the second client may respond to the sample information matching request and obtain a matching result, thereby providing a sample information matching service. In the data transmission process of the first client and the second client, the transmitted data are encrypted by the public key or the private key, so that the difficulty of the data being attacked in the transmission process is improved, the second client can not acquire the second original sample information through noise adding, the safety of the data privacy is improved, and the risk of the data privacy being leaked is reduced.
Fig. 6 is a second flowchart of a sample information matching method applied to a second client according to an embodiment of the present invention, as shown in fig. 6, in some embodiments of the present invention, the sample information matching method applied to the second client may further include:
s307, the second public key encryption sample information is cached in a second cache space.
The embodiment of the invention is suitable for the scene of data interaction between the second client and the first client.
In the embodiment of the invention, the second client may cache the second public key encrypted sample information obtained after the processing or the second public key encrypted sample information partially processed to the second cache space in the process of processing the second original sample information to obtain the second public key encrypted sample information.
S308, when the second cache space is larger than or equal to a second threshold value, sending second cache information in the second cache space to a second client; wherein the second cache information includes second public key encrypted sample information.
The embodiment of the invention is suitable for the scene of data interaction between the second client and the first client.
In the embodiment of the invention, when the second cache space is greater than or equal to the second threshold, the second client sends the second cache information in the second cache space to the first client. The second threshold is used for limiting the data size of the second cache space. The second threshold may be a buffer size in table 1.
In the embodiment of the present invention, the cached information may be second public key encrypted sample information that has been cached in the second cache space; or may be all the information already cached in the second cache space including the second public key encrypted sample information.
It can be appreciated that, in the data interaction between the second client and the first client, the second client needs to call the interface every time the second client sends information to the first client, and frequently call the interface increases the network transmission overhead. Therefore, after the second public key encrypts the sample information until the transmission condition is met, the information cached in the second cache space is transmitted, so that the introduction of a cache mechanism is realized, the frequency of calling an interface in the information transmission process is reduced, the operation efficiency and stability of the second client are improved, and the network transmission overhead is reduced.
In some embodiments of the present invention, fig. 7 is a schematic flow chart of a sample information matching method provided in the embodiment of the present invention, as shown in fig. 7, where the sample information matching method includes:
s401, the first client sends a sample information matching request and a public key to the second client.
S402, the second client responds to the sample information matching request and carries out hash operation on the second original sample information to obtain second sample information.
S403, the second client-side adds noise to the second sample information based on random noise to obtain second encrypted sample information.
S404, the second client encrypts the second encrypted sample information based on the public key to obtain second public key encrypted sample information.
S405, the second client sends second public key encryption sample information to the first client.
S406, the first client decrypts and encrypts the second public key encrypted sample information based on the public key and the private key to obtain second private key encrypted sample information.
S407, the first client performs hash operation on the first original sample information to obtain first sample information.
S408, the first client encrypts the first sample information by the private key based on the private key and then hashes the first sample information to be matched to obtain first sample information to be matched.
S409, the first client sends the first sample information to be matched and the second private key encrypted sample information to the second client.
S410, the second client performs hash encryption after noise reduction on the second private key encryption sample information based on random noise, and obtains second sample information to be matched.
S411, the second client performs sample information matching on the first sample information to be matched and the second sample information to be matched, and a matching result is obtained.
And S412, the second client sends the matching result to the first client.
It will be appreciated that: in the process of data transmission, the first client and the second client encrypt the transmitted data by the public key or the private key, so that the difficulty of attacking the data in the transmission process is improved. And the second client can not acquire the second original sample information by adding noise, and the first client can not acquire the first original sample information by using the private key, so that the security of the data privacy is improved, and the risk of the data privacy being leaked is reduced.
In some embodiments of the present invention, fig. 8 is a second flowchart of a sample information matching method provided in the embodiment of the present invention, and as shown in fig. 8, the sample information matching method includes:
s501, partner a (first client) and partner B (second client) confirm sample information a (first original sample information) and sample information B (second original sample information) participating in sample information matching.
In some embodiments of the invention, sample information a and sample information B characterize ID information of corresponding sample information.
It can be understood that, before sample information matching is performed, the sample information A and the sample information B are confirmed, so that normal execution of a subsequent flow can be ensured, and sample information matching efficiency is improved.
S502, the partner A generates a public key and a private key, and sends a public key and sample information matching request to the partner B.
In some embodiments of the present invention, partner a generates the public and private keys through the RSA algorithm.
It can be understood that the sample information A and the sample information B are encrypted through the public key and the private key, so that the safety of the sample information A and the sample information B in the transmission process can be improved, and the risk of data privacy disclosure is reduced.
S503, the partner B carries out hash operation and noise adding on the sample information B through the public key; and encrypts with the public key to obtain Y (B) (second public key encrypted sample information), and then sends to partner a.
In some embodiments of the present invention, partner B noise-adds the sample information B by the generated random number r.
In some embodiments of the present invention, before sending Y (B) to partner a, partner B caches Y (B) in the cache module, and when Y (B) is cached to be greater than or equal to a preset cache size, partner B sends Y (B) in the cache module to partner a.
It can be understood that Y (B) is encrypted by a public key, and only the partner a and the partner B have the public key, so that Y (B) is not easy to crack in the transmission process, and the risk of disclosure of data privacy is reduced.
S504, decrypting the Y (B) by using the public key by the partner A, and encrypting the decrypted Y (B) by using the private key to obtain Z (B); the partner A carries out hash operation on the sample information A, encrypts by using a private key and obtains Z (A) after hash encryption; z (A) and Z (B) are sent to partner B.
In some embodiments of the present invention, Z (B) is noisy, hashed and private-key-encrypted sample information B, and Z (a) is hashed, hashed and private-key-encrypted sample information a. Here, both hash encryption and hash operation are used to convert the sample information a and the sample information B into hash values by a hash algorithm.
In some embodiments of the present invention, before sending Z (a) and Z (B) to partner B, partner a caches Z (a) and Z (B) in the cache module, and when Z (a) and Z (B) are cached to be greater than or equal to a preset cache size, partner a sends Z (a) and Z (B) in the cache module to partner B.
It can be understood that Y (B) is noisy, and partner a does not know what the random noise generated when partner B is noisy is, so that partner a cannot obtain sample information B after decrypting Y (B) by the public key, and Z (B) and Z (a) are both encrypted by the private key, and the private key is owned by partner a only, so that Z (B) and Z (a) are not easily cracked and cannot be tampered in the transmission process. Thereby reducing the risk of disclosure of data privacy.
S505, removing noise of Z (B) by the partner B and carrying out hash encryption to obtain D (B).
In some embodiments of the present invention, D (B) is sample information B after hash operation, hash encryption, and private key encryption, and Z (a) is sample information a after hash operation, hash encryption, and private key encryption. At this time, D (B) and Z (A) are in the same dimension.
It can be understood that the partner B processes Z (B) to obtain D (B), so that the sample information a and the sample information B are in the same dimension after being processed, which is more convenient for subsequent matching.
S506, the partner B matches the D (B) with the Z (A), and a matching result is obtained and sent to the partner A.
In some embodiments of the present invention, in the process of transmitting data, the partner a and the partner B increase the difficulty of the data being attacked in the transmission process because the transmitted data is encrypted by the public key or the private key. And the partner B can not acquire the sample information B through adding noise, and the partner A can not acquire the sample information A through a private key, so that the security of the data privacy is improved, and the risk of the data privacy being revealed is reduced.
Fig. 9 is a functional architecture diagram of another sample information matching device according to an embodiment of the present invention, as shown in fig. 9, an embodiment of the present invention provides a sample information matching device 8, which is suitable for a sample information matching method applied to a first client, and the device includes a first sending unit 81, a first receiving unit 82, a first encrypting unit 83, and a first decrypting unit 84, where:
The first sending unit 81 is configured to send a sample information matching request to the second client, where the sample information matching request carries a public key; sending first sample information to be matched and second private key encryption sample information to the second client;
the first receiving unit 82 is configured to receive second public key encrypted sample information sent by the second client in response to the sample information matching request; the second public key encrypted sample information represents second original sample information which is subjected to noise adding and encrypted by the public key in the second client; receiving a matching result sent by the second client, wherein the matching result is a response result of the sample information matching request, and the matching result is obtained based on the first sample information to be matched and the second private key encrypted sample information;
the first decryption unit 84 is configured to decrypt the second public key encrypted sample information based on the public key;
the first encryption unit 83 is configured to encrypt the decrypted second public key encrypted sample information based on the private key, to obtain corresponding second private key encrypted sample information; wherein the private key is paired with the public key. And encrypting the first sample information based on the private key to obtain first sample information to be matched.
In some embodiments of the present invention, the first decryption unit 84 is further configured to decrypt the second public key encrypted sample information according to the public key, to obtain second encrypted sample information;
the first encryption unit 83 is further configured to encrypt the second encrypted sample information according to the private key, thereby obtaining second private key encrypted sample information.
In some embodiments of the present invention, the first encryption unit 83 is further configured to perform a hash operation on the first original sample information to obtain the first sample information.
In some embodiments of the present invention, the first encryption unit 83 is further configured to perform private key encryption on the first sample information according to the private key to obtain first private key sample information; and carrying out hash encryption on the first private key sample information so as to obtain the first sample information to be matched.
In some embodiments of the present invention, the apparatus further comprises a first buffering unit 85, wherein:
the first buffer unit 85 is configured to buffer the first sample information to be matched and the second private key encrypted sample information into a first buffer space;
the first sending unit 81 is further configured to send, when the first cache space is greater than or equal to a first threshold, first cache information in the first cache space to the second client; the buffer information comprises the first sample information to be matched and the second private key encrypted sample information.
Fig. 10 is a functional architecture diagram of a sample information matching device according to an embodiment of the present invention, and as shown in fig. 10, an embodiment of the present invention provides a sample information matching device 9, which is suitable for a sample information matching method applied to a second client, and the device includes a second sending unit 91, a second receiving unit 92, a second encrypting unit 93, a second decrypting unit 94, and a matching unit 95; wherein:
the second receiving unit 92 is configured to receive a sample information matching request sent by the first client, where the sample information matching request carries a public key; receiving the first sample information to be matched and second private key encryption sample information sent by the first client; the first sample information to be matched characterizes first original sample information encrypted in the first client; the second private key encryption sample information is the second public key encryption sample information decrypted and encrypted by the public key and the private key in the first client;
the second sending unit 91 is configured to send second public key encrypted sample information to the first client; sending a matching result to the first client; the matching result is a response result of the sample information matching request;
The second encryption unit 93 is configured to, in response to the sample information matching request, noise the second sample information based on random noise, and obtain second encrypted sample information; encrypting the second encrypted sample information based on the public key, thereby obtaining second public key encrypted sample information; and encrypting the noise-reduced second private key encrypted sample information to obtain the second sample information to be matched.
The second decryption unit 94 is configured to reduce noise of the second private key encrypted sample information;
the matching unit 96 is configured to perform sample information matching on the first sample information to be matched and the second sample information to be matched.
In some embodiments of the present invention, the second encryption unit 93 is further configured to hash the second original sample information to obtain the second sample information.
In some embodiments of the present invention, the second encryption unit 93 is further configured to add the random noise to the second sample information, thereby completing the noise adding, and obtaining second encrypted sample information.
In some embodiments of the present invention, the second decryption unit 94 is further configured to remove the random noise in the second private key encrypted sample information, thereby completing noise reduction and obtaining second private key sample information;
The second encryption unit 93 is further configured to hash-encrypt the second private key sample information to obtain the second sample information to be matched.
In some embodiments of the present invention, the apparatus further comprises a second buffering unit 95, wherein:
the second buffer unit 95 is configured to buffer the second public key encrypted sample information to a second buffer space;
the second sending unit 91 is further configured to send second cache information in the second cache space to the second client when the second cache space is greater than or equal to a second threshold; wherein the second cache information includes the second public key encrypted sample information.
Fig. 11 is a functional architecture diagram of a first client provided in an embodiment of the present invention, as shown in fig. 11, the embodiment of the present invention provides a first client 11, which is suitable for a sample information matching method applied to the first client, including a first processor 1101, a first memory 1102, and a first communication bus 1104, where the first memory 1102 communicates with the first processor 1101 through the first communication bus 1104, the first memory 1102 stores one or more programs executable by the first processor 1101, and when the one or more programs are executed, the first processor 1101 executes the sample information matching method applied to the first client 11 according to the embodiment of the present invention, and the first client 11 further includes a first communication component 1103 for performing data transmission, where the first processor 1101 is at least provided with one.
In an embodiment of the present invention, the various components in the first client 11 are coupled together by a first communication bus 1104. It is to be appreciated that the first communication bus 1104 is used to enable connection communications between these components. The first communication bus 1104 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled as first communication bus 1104 in fig. 11.
Fig. 12 is a functional architecture diagram of a second client provided in an embodiment of the present invention, as shown in fig. 12, an embodiment of the present invention provides a second client 2, which is suitable for a sample information matching method applied to the second client, including a second processor 1201, a second memory 1202, and a second communication bus 1204, where the second memory 1202 communicates with the second processor 1201 through the second communication bus 1204, the second memory 1202 stores one or more programs executable by the second processor 1201, and when the one or more programs are executed, the second processor 1201 executes the sample information matching method applied to the second client 12 according to the embodiment of the present invention, and the second client 12 further includes a second communication component 1203 for performing data transmission, where the second processor 1201 is at least provided with one.
In an embodiment of the present invention, the various components in the second client 12 are coupled together by a second communication bus 1204. It is appreciated that the second communication bus 1204 is used to enable connected communications between these components. The second communication bus 1204 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled as the second communication bus 1204 in fig. 12.
The embodiment of the invention provides a computer readable storage medium, which stores executable instructions for causing a first processor to execute, so as to implement a sample information matching method applied to a first client according to the embodiment of the invention.
The embodiment of the invention provides a computer readable storage medium, which stores executable instructions for causing a second processor to execute, so as to implement the sample information matching method applied to a second client according to the embodiment of the invention.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing description of the preferred embodiments of the present invention is not intended to limit the scope of the present invention.

Claims (15)

1. The sample information matching method is characterized by being applied to a first client and comprising the following steps of:
sending a sample information matching request to a second client, wherein the sample information matching request carries a public key;
receiving second public key encrypted sample information sent by the second client in response to the sample information matching request; the second public key encrypted sample information represents second original sample information which is subjected to noise adding and encrypted by the public key in the second client;
decrypting and encrypting the second public key encryption sample information based on the public key and the private key to obtain corresponding second private key encryption sample information; wherein the private key is paired with the public key;
Encrypting the first sample information based on the private key to obtain first sample information to be matched, and sending the first sample information to be matched and the second sample information encrypted by the private key to the second client;
and receiving a matching result sent by the second client, wherein the matching result is a response result of the sample information matching request, and the matching result is obtained based on the first sample information to be matched and the second private key encrypted sample information.
2. The method according to claim 1, wherein decrypting and encrypting the second public key encrypted sample information based on the public key and a private key to obtain corresponding second private key encrypted sample information comprises:
decrypting the second public key encrypted sample information according to the public key to obtain second encrypted sample information;
and encrypting the second encrypted sample information according to the private key, thereby obtaining second private key encrypted sample information.
3. The method according to claim 1, wherein the method further comprises:
and carrying out hash operation on the first original sample information to obtain the first sample information.
4. A method according to claim 1 or 3, wherein encrypting the first sample information based on the private key to obtain first sample information to be matched, and transmitting the first sample information to be matched and the second private key encrypted sample information to the second client, comprises:
according to the private key, carrying out private key encryption on the first sample information to obtain first private key sample information;
and carrying out hash encryption on the first private key sample information so as to obtain the first sample information to be matched.
5. The method according to claim 1, wherein the method further comprises:
caching the first sample information to be matched and the second private key encrypted sample information into a first cache space;
when the first cache space is larger than or equal to a first threshold value, sending first cache information in the first cache space to the second client; the buffer information comprises the first sample information to be matched and the second private key encrypted sample information.
6. The sample information matching method is characterized by being applied to a second client and comprising the following steps of:
receiving a sample information matching request sent by a first client, wherein the sample information matching request carries a public key;
In response to the sample information matching request, adding noise to the second sample information based on random noise to obtain second encrypted sample information;
encrypting the second encrypted sample information based on the public key, thereby obtaining second public key encrypted sample information, and sending the second public key encrypted sample information to the first client;
receiving first sample information to be matched and second private key encryption sample information sent by the first client; the first sample information to be matched characterizes first original sample information encrypted in the first client; the second private key encryption sample information is the second public key encryption sample information decrypted and encrypted by the public key and the private key in the first client;
noise reduction and encryption are carried out on the second private key encrypted sample information so as to obtain second sample information to be matched;
sample information matching is carried out on the first sample information to be matched and the second sample information to be matched, so that a matching result is obtained and sent to the first client; the matching result is a response result of the sample information matching request.
7. The method of claim 6, wherein the method further comprises:
And carrying out hash operation on the second original sample information to obtain the second sample information.
8. The method according to claim 6 or 7, wherein said noise-adding the second sample information based on the random noise in response to the sample information matching request, to obtain second encrypted sample information, comprises:
and adding the random noise to the second sample information, so as to finish the noise adding and obtain second encrypted sample information.
9. The method of claim 8, wherein said denoising and encrypting the second private key encrypted sample information to obtain the second sample information to be matched comprises:
removing the random noise in the second private key encryption sample information, thereby completing noise reduction and obtaining second private key sample information;
and carrying out hash encryption on the second private key sample information to obtain the second sample information to be matched.
10. The method of claim 6, wherein the method further comprises:
caching the second public key encrypted sample information into a second cache space;
when the second cache space is larger than or equal to a second threshold value, sending second cache information in the second cache space to the second client; wherein the second cache information includes the second public key encrypted sample information.
11. A sample information matching apparatus, comprising a first transmitting unit, a first receiving unit, a first encrypting unit, and a first decrypting unit, wherein:
the first sending unit is configured to send a sample information matching request to the second client, where the sample information matching request carries a public key; sending first sample information to be matched and second private key encryption sample information to the second client;
the first receiving unit is used for receiving second public key encrypted sample information sent by the second client in response to the sample information matching request; the second public key encrypted sample information represents second original sample information which is subjected to noise adding and encrypted by the public key in the second client; receiving a matching result sent by the second client, wherein the matching result is a response result of the sample information matching request, and the matching result is obtained based on the first sample information to be matched and the second private key encrypted sample information;
the first decryption unit is used for decrypting the second public key encryption sample information based on the public key;
the first encryption unit is used for encrypting the decrypted second public key encryption sample information based on the private key to obtain corresponding second private key encryption sample information; wherein the private key is paired with the public key; and encrypting the first sample information based on the private key to obtain first sample information to be matched.
12. A sample information matching device, which is characterized by comprising a second sending unit, a second receiving unit, a second encrypting unit, a second decrypting unit and a matching unit; wherein:
the second sending unit is used for sending the second public key encryption sample information to the first client; sending a matching result to the first client; the matching result is a response result of the sample information matching request;
the second receiving unit is used for receiving a sample information matching request sent by the first client, wherein the sample information matching request carries a public key; receiving first sample information to be matched and second private key encryption sample information sent by the first client; the first sample information to be matched characterizes first original sample information encrypted in the first client; the second private key encryption sample information is the second public key encryption sample information decrypted and encrypted by the public key and the private key in the first client;
the second encryption unit is used for responding to the sample information matching request, and adding noise to the second sample information based on random noise to obtain second encrypted sample information; encrypting the second encrypted sample information based on the public key, thereby obtaining second public key encrypted sample information; encrypting the noise-reduced second private key encrypted sample information to obtain second sample information to be matched;
The second decryption unit is used for reducing noise of the second private key encryption sample information;
the matching unit is used for performing sample information matching on the first sample information to be matched and the second sample information to be matched.
13. A first client, comprising:
a first memory for storing executable data instructions;
a first processor for implementing the method of any one of claims 1 to 5 when executing executable instructions stored in said first memory.
14. A second client, comprising:
a second memory for storing executable data instructions;
a second processor for implementing the method of any of claims 6 to 10 when executing executable instructions stored in said second memory.
15. A computer readable storage medium storing executable instructions for causing a first processor to perform the method of any one of claims 1 to 5; and is further configured to cause the second processor to perform the method of any one of claims 6 to 10.
CN202210122900.8A 2022-02-09 2022-02-09 Sample information matching method and device, equipment and storage medium Pending CN116611078A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210122900.8A CN116611078A (en) 2022-02-09 2022-02-09 Sample information matching method and device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210122900.8A CN116611078A (en) 2022-02-09 2022-02-09 Sample information matching method and device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116611078A true CN116611078A (en) 2023-08-18

Family

ID=87675179

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210122900.8A Pending CN116611078A (en) 2022-02-09 2022-02-09 Sample information matching method and device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116611078A (en)

Similar Documents

Publication Publication Date Title
US8687800B2 (en) Encryption method for message authentication
US10951595B2 (en) Method, system and apparatus for storing website private key plaintext
CN109728914B (en) Digital signature verification method, system, device and computer readable storage medium
WO2018166356A1 (en) Method, device, and system for encrypting secret key
CN110690956B (en) Bidirectional authentication method and system, server and terminal
CN109067517B (en) Encryption and decryption device, encryption and decryption method and communication method of hidden key
CN112115461B (en) Equipment authentication method and device, computer equipment and storage medium
CN113726725A (en) Data encryption and decryption method and device, electronic equipment and storage medium
CN111555880B (en) Data collision method and device, storage medium and electronic equipment
JP2022540653A (en) Data protection and recovery system and method
US10122755B2 (en) Method and apparatus for detecting that an attacker has sent one or more messages to a receiver node
CN115150821A (en) Offline package transmission and storage method and device
CN113300842B (en) Method for improving security of symmetric encryption algorithm
GB2488753A (en) Encrypted communication
CN114117406A (en) Data processing method, device, equipment and storage medium
CN109120621B (en) Data processor
Barukab et al. Secure communication using symmetric and asymmetric cryptographic techniques
WO2023116266A1 (en) Communication encryption method, system, and device
CN112398818B (en) Software activation method and related device thereof
KR102539418B1 (en) Apparatus and method for mutual authentication based on physical unclonable function
CN116611078A (en) Sample information matching method and device, equipment and storage medium
CN111431846B (en) Data transmission method, device and system
CN112565156B (en) Information registration method, device and system
CN116032509A (en) Mail encryption and decryption method and device
CN112069472A (en) User login authentication method and system

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