Data processing method, device and system
Through the collaborative encryption mechanism of the client and server, the data is encrypted twice using the re-encryption key, which solves the problem of cloud data being unable to be shared, realizes end-to-end encryption protection, and improves data security.
Patent Information
- Application Number
- CN202110452051.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-25
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2041-04-25
AI Technical Summary
In the prior art, after the user's personal data stored in the cloud device of the smart terminal is encrypted, third-party applications cannot decrypt it, resulting in the inability to use it normally and the inability to achieve secure data sharing.
The first client generates a re-encryption key, uses its own private key and the second client's public key to re-encrypt the data, and the server encrypts the data twice to ensure that the data is always in a ciphertext state during the sharing process and can only be decrypted by the sharing party and the shared party.
It achieves end-to-end encryption protection, improves the security of users' personal data, ensures that data is not decrypted by relay devices during transmission, and realizes secure dynamic sharing of ciphertext.
Smart Images

Figure CN115242416B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data processing method, device, and system. Background Art
[0002] With the rapid development of the Internet and Internet of Things technologies, smart terminals (such as smart watches, smart bracelets, mobile phones, etc.) are becoming more and more popular and their functions are becoming more and more abundant. Among them, smart terminals can collect users' personal data, and encrypt the users' personal data and store it in cloud devices. For example, when the smart terminal is a smart watch, the smart watch can detect the user's heart rate, blood oxygen and other health data, and encrypt and upload the health data to the cloud device. At the same time, the smart watch can also detect the user's step count, exercise duration, triathlon and other sports data, and encrypt and upload the sports data to the cloud device. However, at present, when the user's personal data stored in the cloud device needs to be shared with a third-party application, since the personal data stored in the cloud device is encrypted, after the third-party application obtains the encrypted personal data from the cloud device, the third-party application often cannot decrypt the data it obtains, which leads to the problem that the third-party application cannot be used normally. Summary of the Invention
[0003] The embodiments of the present application provide a data processing method, device and system that can achieve end-to-end encryption protection, thereby realizing secure dynamic sharing of ciphertext and improving the security of users' personal data.
[0004] In a first aspect, an embodiment of the present application provides a data processing method that can be applied to a system including a first client and a server, wherein the server stores at least one ciphertext, which can be obtained by the first client by encrypting user data based on the first client's public key.
[0005] The method may include: a first client obtaining a public key of a second client; the first client determining a re-encryption key based on the first client's private key and the second client's public key; the first client sending the re-encryption key to a server; the server receiving the re-encryption key and encrypting a first ciphertext based on the re-encryption key to obtain a second ciphertext, wherein at least one of the ciphertexts includes the first ciphertext; and the server sending the second ciphertext to the second client.
[0006] In this solution, when the first client shares the user's personal data with the second client, the first client can use its own private key and the public key of the second client to generate a re-encryption key. Then, the first client can send the re-encryption key to the server. Next, the server uses the re-encryption key to re-encrypt the ciphertext corresponding to the data to be shared, obtains the second encrypted ciphertext, and sends the encrypted ciphertext to the second client. As a result, the second client can directly obtain the data shared by the first client from the server and use the data, and the data to be shared during the data sharing process is always in a ciphertext state, which means that only the sharing party and the shared party can know the shared data, that is, the relay device between the sharing party and the shared party (such as a server, etc.) will not decrypt the data shared by the sharing party, thereby achieving end-to-end encryption protection, and then achieving secure dynamic sharing of ciphertext, thereby improving the security of the user's personal data.
[0007] In one possible implementation, the system may further include a second client that can receive the second ciphertext sent by the server and decrypt the second ciphertext based on the second client's private key. Thus, the second client can obtain the data shared by the first client.
[0008] In one possible implementation, the private key of the first client is a, and the public key of the second client is g. b , the re-encryption key is g jb / a , where j≠0. Thus, the second client can use its private key to decrypt the ciphertext encrypted by the re-encryption key.
[0009] In one possible implementation, before the server encrypts the first ciphertext using the re-encryption key, the first client can send the server the conditions that the data to be shared meets. The server can then receive the conditions and, based on the conditions met by the data to be shared, determine the first ciphertext from at least one ciphertext. This allows the server to filter the first ciphertext from among the numerous ciphertexts it stores, thereby preventing data mistransmission.
[0010] In a possible implementation, the conditions satisfied by the data to be shared may include the type of data to be shared and / or the time period in which the data to be shared is located, thereby sharing data of a specific type and / or data within a specific time period with the second client.
[0011] In a possible implementation, each ciphertext may include at least two parts, a first part of the at least two parts is used to represent the public key of the first client, and a second part of the at least two parts is used to represent the user data after the first processing.
[0012] The server can perform statistical operations on the user data in the second part of the N sub-ciphertexts to obtain a third ciphertext, where the N sub-ciphertexts are ciphertexts stored by the server within the first time period; and send the third ciphertext to the first client. The first client can receive the third ciphertext and decrypt the third ciphertext to obtain the statistical result. Thus, through the specific ciphertext structure, the server can calculate the ciphertext corresponding to the data it needs, and the first client can obtain the statistical result by directly decrypting the received ciphertext, thereby reducing the data processing workload of the first client and improving data processing efficiency.
[0013] In a possible implementation, the ciphertext obtained by encrypting the user data by the first client may be (g ak ,mZ k ), where g a is the public key of the first client, mZ k is the user data after the first processing, m is the user data without the first processing, k is a random number, and Z is a global parameter.
[0014] In one possible implementation, the server performs a statistical operation on the user data in the second part of the N sub-ciphertexts to obtain a third ciphertext, specifically including: the server determines M first random numbers, and based on the M first random numbers, determines P second random numbers for operating on the user data in the second part of the N sub-ciphertexts, where P>M; the server performs a statistical operation on the user data in the second part of the N sub-ciphertexts based on each second random number to obtain P third ciphertexts.
[0015] The server sends the third ciphertext to the first client, which specifically includes: the server sends P third ciphertexts and M first random numbers to the first client.
[0016] Furthermore, the first client decrypts the third ciphertext to obtain a statistical result, which specifically includes: the first client randomly determines a second random number based on the M first random numbers; and, based on the randomly determined second random number and the first parameter in the first client for performing a first processing on the user data, decrypts the third ciphertext corresponding to the randomly determined second random number to obtain a statistical result.
[0017] As a result, the first client can receive multiple third ciphertexts, so that the first client can randomly select a third ciphertext for decryption, and the server cannot know the ciphertext selected for decryption by the first client, thereby improving data security.
[0018] In one possible implementation, after the first client obtains the statistical results, the first client may send the statistical results to the server. The server may then receive the statistical results. This allows the server to obtain the statistical results and then store or publish the statistical results.
[0019] In the second aspect, an embodiment of the present application provides a data processing method that can be applied to a first client, the method including: the first client obtains the public key of the second client; determines a re-encryption key based on the private key of the first client and the public key of the second client; and sends the re-encryption key to the server so that the server encrypts the first ciphertext based on the re-encryption key to obtain a second ciphertext, wherein at least one ciphertext is stored in the server, and the ciphertext is obtained by the first client encrypting user data based on the public key of the first client, and the at least one ciphertext includes the first ciphertext.
[0020] In a possible implementation, the first client may further send the conditions satisfied by the data to be shared to the server, so that the server determines the first ciphertext from at least one ciphertext based on the conditions satisfied by the data to be shared.
[0021] In a possible implementation, each ciphertext includes at least two parts, a first part of the at least two parts is used to represent the public key of the first client, and a second part of the at least two parts is used to represent the user data after the first processing.
[0022] Among them, the first client can receive the third ciphertext sent by the server, and the third ciphertext is obtained by the server performing statistical operations on the user data in the second part of N sub-ciphertexts, and the N sub-ciphertexts are the ciphertexts stored by the server in the first time period; and decrypt the third ciphertext in the third message to obtain the statistical results.
[0023] In one possible implementation, the first client receives the third ciphertext sent by the server, specifically including: the first client receives P third ciphertexts and M first random numbers sent by the server, wherein the P third ciphertexts are obtained by performing statistical operations on user data in the second part of N sub-ciphertexts based on P second random numbers determined by the server based on the M first random numbers.
[0024] The first client decrypts the third ciphertext in the third message to obtain a statistical result, specifically including: the first client randomly determines a second random number based on the M first random numbers; and decrypts the third ciphertext corresponding to the randomly determined second random number based on the randomly determined second random number and a first parameter in the first client for performing a first processing on the user data to obtain a statistical result.
[0025] In a third aspect, an embodiment of the present application provides a data processing method that can be applied to a server, in which at least one ciphertext is stored. The ciphertext is obtained by encrypting user data by a first client based on the public key of the first client.
[0026] The method may include: a server receiving a re-encryption key sent by a first client, where the re-encryption key is determined by the first client based on a private key of the first client and a public key of the second client; encrypting a first ciphertext based on the re-encryption key to obtain a second ciphertext, wherein at least one ciphertext includes the first ciphertext; and sending the second ciphertext to a second client.
[0027] In one possible implementation, before the server encrypts the first ciphertext based on the re-encryption key, the server may receive conditions satisfied by the data to be shared sent by the first client; and determine the first ciphertext from at least one ciphertext based on the conditions satisfied by the data to be shared.
[0028] In a possible implementation, each ciphertext includes at least two parts, a first part of the at least two parts is used to represent the public key of the first client, and a second part of the at least two parts is used to represent the user data after the first processing.
[0029] The server may perform statistical operations on the user data in the second part of the N sub-ciphertexts to obtain a third ciphertext, wherein the N sub-ciphertexts are ciphertexts stored by the server within the first time period; and send the third ciphertext to the first client so that the first client decrypts the third ciphertext to obtain a statistical result.
[0030] In one possible implementation, the server performs a statistical operation on the user data in the second part of the N sub-ciphertexts to obtain a third ciphertext, specifically including: the server determines M first random numbers, and based on the M first random numbers, determines P second random numbers for operating on the user data in the second part of the N sub-ciphertexts, where P>M; the server performs a statistical operation on the user data in the second part of the N sub-ciphertexts based on each second random number to obtain P third ciphertexts.
[0031] The server sends the third ciphertext to the first client, which specifically includes: the server sends P ciphertexts and M first random numbers to the first client.
[0032] In a fourth aspect, an embodiment of the present application provides a data processing system, which may include a first client and a server, wherein the system is used to execute the method provided in the first aspect.
[0033] In a possible implementation, the system may further include a second client.
[0034] In the fifth aspect, an embodiment of the present application provides a data processing device, comprising: at least one memory for storing programs; at least one processor for executing the programs stored in the memory, when the program stored in the memory is executed, the processor is used to execute the method provided in the second aspect, or execute the method provided in the third aspect.
[0035] In a sixth aspect, an embodiment of the present application provides a data processing device, characterized in that the device runs computer program instructions to execute the method provided in the second aspect, or execute the method provided in the third aspect. Exemplarily, the device can be a chip or a processor.
[0036] In one example, the apparatus may include a processor, which may be coupled to a memory, read instructions from the memory, and execute the method provided in the second aspect or the method provided in the third aspect according to the instructions. The memory may be integrated into a chip or processor, or may be independent of the chip or processor.
[0037] In the seventh aspect, an embodiment of the present application provides a computer storage medium, which stores instructions. When the instructions are executed on a computer, the computer executes the method provided in the second aspect, or executes the method provided in the third aspect.
[0038] In an eighth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method provided in the second aspect, or to execute the method provided in the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a system architecture diagram of a data processing system provided by an embodiment of the present application;
[0040] Figure 2a This is a schematic diagram of an interface display of an electronic device provided in an embodiment of the present application;
[0041] Figure 2b This is a schematic diagram of an interface display of an electronic device provided in an embodiment of the present application;
[0042] Figure 3 This is a schematic diagram of communication between two electronic devices provided in an embodiment of the present application;
[0043] Figure 4 This is a schematic diagram of the structure of a server provided in an embodiment of the present application;
[0044] Figure 5 This is a communication diagram of a data processing method provided in an embodiment of the present application;
[0045] Figure 6 This is a communication diagram of another data processing method provided in an embodiment of the present application;
[0046] Figure 7 This is a communication diagram of another data processing method provided in an embodiment of the present application;
[0047] Figure 8 It is a flowchart of a data processing method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0049] In the description of the embodiments of the present application, words such as "exemplary," "for example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "for example," or "for example" in the embodiments of the present application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.
[0050] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "plurality" means two or more. For example, "multiple systems" refers to two or more systems, and "multiple terminals" refers to two or more terminals.
[0051] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly identifying the technical features being referred to. Thus, features specified as "first" or "second" may explicitly or implicitly include one or more of such features. The terms "include," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.
[0052] Figure 1 This is a system architecture diagram of a data processing system provided by an embodiment of the present application. Figure 1As shown, the system includes: a client 11, a client 12, and a server 13. The communication method between the client 11 and the server 13 can be an HTTPS secure transmission channel. The communication method between the client 12 and the server 13 can be an HTTPS secure transmission channel. The client 11 can encrypt the user's personal data and upload the encrypted personal data to the server 13 for storage in the server 13, thereby avoiding the storage of a large amount of data on the electronic device where the client 11 is located. The client 11 can actively share the user's personal data with the client 12. The client 12 can also actively request the client 11 to share the user's personal data. In one example, the user's personal data can include the user's sports data, health data, location data, weather data, etc. In one example, the user's personal data can also include file data, audio and video data, image data, etc.
[0053] In this solution, when client 11 shares a user's personal data with client 12, client 11 can use its own key (such as a private key) and client 12's key (such as a public key) to generate a re-encryption key. Then, client 11 can use server 13's key (such as a public key) to encrypt the re-encryption key, and send the encrypted re-encryption key and the data type of the data to be shared to server 13. Next, server 13 can decrypt the encrypted re-encryption key and use the decrypted re-encryption key to encrypt the ciphertext corresponding to the data to be shared to obtain a secondary encrypted ciphertext (i.e., the original ciphertext is encrypted a second time), and send the encrypted ciphertext to client 12. Finally, client 12 receives the secondary encrypted ciphertext and decrypts it to obtain the data shared by client 11. As a result, the client 12 can directly obtain the data shared by the client 11 from the server 13 and use the data, and the data to be shared during the data sharing process is always in an encrypted state, so that only the sharing party and the shared party can know the shared data, that is, the relay device between the sharing party and the shared party (such as the server 13, etc.) will not decrypt the data shared by the sharing party, thereby realizing end-to-end (E2E) encryption protection, and then realizing secure dynamic sharing of ciphertext, thereby improving the security of users' personal data.
[0054] It is understandable that, in this solution, the client 11 and the client 12 can be installed on the same electronic device or on different electronic devices. Figure 2a As shown, both the client 11 and the client 12 can be installed on the electronic device 21. Figure 2b As shown, the client 11 can be installed on the electronic device 22 , and the client 12 can be installed on the electronic device 23 .
[0055] In addition, in this solution, the personal data encrypted by the client 11 can be collected by the electronic device where the client 11 is located, or can be received by the electronic device where the client 11 is located from other electronic devices. For example, Figure 3 As shown, the electronic device 32 can collect the user's personal data, and the electronic device 31 where the client 11 is located can receive the user's personal data sent by the electronic device 32. Among them, the electronic devices 31 and 32 can be connected through a network such as a wired network or a wireless network to exchange data. For example, the network can be a local area network (LAN) or a wide area network (WAN) (such as the Internet). In addition, the electronic devices 31 and 32 can also interact through short-range wireless communication technology, such as Bluetooth interaction. It can be understood that the network between the electronic device 31 and the electronic device 32 can be implemented using any known network communication protocol, and the above-mentioned network communication protocol can be various wired or wireless communication protocols, such as Ethernet, universal serial bus (USB), Firewire, global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division code division multiple access (TD-SCDMA), long term evolution (LTE), new radio (NR), Bluetooth, wireless fidelity (Wi-Fi) and other communication protocols.
[0056] It is understood that in this solution, the electronic device where the client 11 is located and the electronic device where the client 12 is located can be connected to the server 13 via the wired network or wireless network described above to exchange data. See the above description for details, and will not be repeated here.
[0057] In one example, the electronic device involved in this solution may be a mobile phone, a tablet computer, a wearable device, a smart TV, a Huawei smart screen, a smart speaker, a car machine, etc. Exemplary embodiments of the terminal device involved in this solution include but are not limited to electronic devices equipped with iOS, Android, Windows, Harmony OS or other operating systems. The embodiments of this application do not specifically limit the type of electronic device. In one example, the electronic device may have a sensor for collecting data. Exemplarily, the sensor may be a sensor for monitoring user health or exercise, such as a speed sensor, an optical heart rate sensor, a position sensor, etc.
[0058] In one example, the server involved in this solution can be used to provide cloud services. It can be a server or a hyperterminal that can establish a communication connection with an electronic device and provide data processing, computing, and / or storage functions for the electronic device. The server involved in this solution can be a hardware server or embedded in a virtualized environment. For example, the server involved in this solution can be a virtual machine executed on a hardware server that includes one or more other virtual machines.
[0059] The above is an introduction to the data processing system involved in this solution. Next, the various components of the above data processing system will be introduced.
[0060] First, let's introduce client 11 and client 12. In this solution, both client 11 and client 12 refer to programs that correspond to server 13 and provide local services to clients. Among them, client 11 can at least have the functions of encrypting data, decrypting data, interacting with client 12, and communicating with server 13. Client 12 can at least have the functions of decrypting data, interacting with client 11, and communicating with server 13. Exemplarily, client 11 can be Huawei's sports health application (application, APP), and client 12 can be a heart health research APP or a motion status research APP.
[0061] Next, we will introduce the server 13. Figure 4 , Figure 4 This is a schematic diagram of the structure of a server provided in an embodiment of the present application. Figure 4As shown, server 13 includes a processor 401, a network interface 402, and a memory 403. Processor 401, network interface 402, and memory 403 can be connected via a bus or other means. In this embodiment, processor 401 (also known as a central processing unit (CPU)) is the computing and control core of server 11. In one example, processor 401 can decrypt the re-encryption key encrypted by client 11 and use the decrypted re-encryption key to encrypt the ciphertext corresponding to the data to be shared, generating a second encrypted ciphertext (i.e., a second encryption of the original ciphertext). Network interface 402 can optionally include a standard wired interface or a wireless interface (such as Wi-Fi or a mobile communication interface). It is controlled by processor 401 to send and receive data, for example, receiving encrypted personal data sent by client 11 and sending data encrypted using the re-encryption key to client 12. Memory 403 is the server's memory device, used to store programs and data, such as encrypted data sent by client 11. It is understood that the memory 403 can be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage; optionally, it can be at least one storage device located remote from the aforementioned processor 401. The memory 403 provides storage space that stores the server's operating system and executable program code, including but not limited to: Windows system (an operating system), Linux system (an operating system), Hongmeng system (an operating system), etc., which are not limited here.
[0062] Finally, the electronic device where the client 11 and / or client 12 is located is introduced. Figure 5 , Figure 5 Schematic diagram of an electronic device provided in an embodiment of the present application. Figure 5As shown, the electronic device may include: a processor 501, a network interface 502, and a memory 503. The processor 501, network interface 502, and memory 503 may be connected via a bus or other means. In this embodiment, the processor 501 (also known as a central processing unit (CPU)) is the computing and control core of the electronic device. In one example, the processor 501 can assist the client 11 in decrypting and encrypting data, or assist the client 11 in decrypting data, etc. The network interface 502 may optionally include a standard wired interface or a wireless interface (such as Wi-Fi, a mobile communication interface, etc.), and is controlled by the processor 501 to transmit and receive data. In one example, the network interface 502 can assist the client 11 in receiving or transmitting data, or assist the client 12 in receiving or transmitting data, etc. The memory 503 is a storage device of the electronic device, used to store programs and data, such as personal data of the user collected by the electronic device. It is understandable that the memory 503 this time can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one storage device located away from the aforementioned processor 501. The memory 503 provides a storage space that stores the server's operating system and executable program code, which may include but is not limited to: Windows system (an operating system), Linux system (an operating system), etc., which are not limited here. Optionally, the electronic device may also have a sensor for collecting data. Exemplarily, the sensor can be a sensor for monitoring user health or exercise, such as a speed sensor, an optical heart rate sensor, a position sensor, etc.
[0063] The above is an introduction to the data processing system involved in this solution and the various components of the data processing system. Figure 1 The data processing system described in Figure 6 The data processing process shown in FIG2 is a detailed introduction to the data processing scheme involved in this scheme. It should be noted that this data processing scheme mainly introduces the process of client 11 sharing data with client 12. See the following description for details.
[0064] (1) The electronic device where the client 11 is located collects the user's personal data
[0065] In this solution, the electronic device where the client 11 is located can use its own sensors to collect the user's personal data, such as sports data, health data, location data, etc.
[0066] In addition, the electronic device where the client 11 is located can also receive the user's personal data sent by other electronic devices. Figure 3 The electronic device 31 where the client 11 is located can be a mobile phone, and the other electronic device 32 can be a smart watch. The smart watch can send the health data such as heart rate collected by it to the mobile phone through short-range communication methods such as Bluetooth.
[0067] (2) The client 11 obtains the user's personal data from the electronic device where it is located
[0068] In this solution, after the electronic device where client 11 is located collects the user's personal data, client 11 can receive the user's personal data sent by the electronic device via the Bluetooth transmission channel on the electronic device. In one example, the electronic device where client 11 is located can encrypt and transmit the user's personal data via the Bluetooth channel.
[0069] Furthermore, after the client 11 obtains the user's personal data, it can be displayed on its display interface. For example, assuming that the user's personal data is the number of steps, the display interface of the client 11 can display the number of steps as 10,000.
[0070] (3) Client 11 uploads the user's personal data to server 13
[0071] In this solution, after obtaining the user's personal data, the client 11 may encrypt the user's personal data and send the encrypted data to the server 13 so that the user's personal data is stored in the server 13 .
[0072] In one example, the client 11 can use its own public key to encrypt the user's personal data. Then, the encrypted data is sent to the server 13. For example, assuming that the public key of the client 11 is PKa and the user's personal data is m, the encrypted data can be C = (m, PKa) = Enc PKa (m), where Enc can be understood as encryption. In one example, an asymmetric encryption algorithm such as RSA, Elgamal, Rabin, or Elliptic Curve Cryptography (ECC) can be used for encryption.
[0073] In one example, the client 11 can generate different public-private key pairs for different types of user personal data, and use different public keys to encrypt different types of user personal data to improve the security of the user's personal data. For example, if the data types of the user's personal data include: sports, health, and location, a public-private key pair (PKa, SKa) can be generated for sports data, a public-private key pair (PKb, SKb) can be generated for health data, and a public-private key pair (PKc, SKc) can be generated for location data. Among them, PKa, PKb, PKc are all public keys, and SKa, SKb, SKc are all private keys.
[0074] As a possible implementation, the client 11 can generate a public-private key pair based on a bilinear mapping. For example, bilinear mapping parameters can be preset, such as two multiplication cyclic groups G and G with order p being a prime number. T Then, the client 11 calculates the multiplication cycle groups G and G T , generate a bilinear mapping pair e: GxG→G T . Among them, the bilinear mapping pair e: GxG→G T is a mapping with the following properties:
[0075] 1) Bilinear: for all P, Q∈G, a, b∈Z p * , there is e(P a , Q b ) = e(P, Q) ab .
[0076] 2) Non-degeneracy: If there exist P, Q∈G and P=Q, then e(P, Q)≠1.
[0077] 3) Computability: For any P, Q∈G, there exists an efficient algorithm to compute e(P, Q) in polynomial time.
[0078] Among them, Z p is the set of all non-negative integers less than the order p of the multiplicative cyclic group. p * Represents the set Z p The dual space of .
[0079] When generating a public-private key pair, the client 11 can first determine the set Z according to the order p of the multiplication cyclic group in the bilinear mapping parameter. p Then, client 11 selects from set Z p The dual space Z p *A value a is randomly selected from the ciphertext as the private key. Finally, the client 11 generates the element g according to the multiplication cyclic group, and determines the public key based on the element g and the selected value a. When the private key is a, the public key can be g. a .
[0080] Furthermore, after the client 11 determines the public-private key pair, it can use the determined public key to encrypt the user's personal data that needs to be uploaded to the server 13. For example, assuming that the public key is g a , the user's personal data is m, then the encrypted personal data can be C = (m, g a )=Enc ga (m).
[0081] In addition, when encrypting the user's personal data, the public key can be processed with random numbers to enhance the randomness of the encryption algorithm, thereby improving the security of data transmission. For example, the public key can be g a , the user's personal data can be m, then a random number k can be generated based on the multiplication cyclic group, and then the random number k is used to calculate the public key g a Do the operation and get g ak Finally, use the calculated public key g ak Encrypt the user's personal data, where the encrypted data can be (m, g ak In one example, the user's personal data can be processed using pre-set basic parameters, and then encrypted using the public key to further improve the security of data transmission. For example, the encrypted data C3 = (C2, C1), where C1 = g ak , C2=mZ k , g ak To utilize the public key after the random number change, m is the user's personal data, k is a random number, and Z is a pre-set public parameter.
[0082] (4) Client 11 determines the re-encryption key based on its own private key and client 12's public key
[0083] In this solution, when client 11 needs to share data with client 12, client 11 can determine the re-encryption key based on its own private key and the public key of client 12. For example, if the private key of client 11 is a and the public key of client 12 is g b , then the re-encryption key Rk can be g jb / a , that is, Rk=g jb / a , where j≠0.
[0084] It is understood that in this solution, client 11 can proactively share data with client 12. Client 12 can also proactively request data sharing from client 11. For example, client 11 can periodically proactively share data with client 12; client 12 can also periodically proactively request data sharing from client 11.
[0085] When client 11 actively shares data, client 11 can obtain the public key of client 12 based on the public key of client 12 previously broadcast by client 12. In addition, when the public key of client 12 is pre-stored in server 13, client 11 can also actively request the public key of client 12 from server 13.
[0086] When the client 12 actively requests to share data, the client 12 may actively send a request message to the client 11 , and carry the public key of the client 12 in the request message.
[0087] In one example, client 11 and client 12 can be pre-associated to pre-calibrate the type of data that can be shared between the two. For example, if client 11 is the Huawei Sports Health app and client 12 is the Heart Health Research app, since the Heart Health Research app often needs to study the user's heart health based on the user's heart rate, the user can pre-associate the Huawei Sports Health app and the Heart Health Research app and calibrate the type of data shared between the two to be heart rate data.
[0088] Furthermore, when client 11 and client 12 are not pre-associated, client 12 may include the type of data it requires in the request message it sends. For example, if client 12 is a heart health research app, client 12 may include the type of heart rate data it requires and its own public key in the request message it sends to client 11.
[0089] In one example, when client 11 generates different public-private key pairs for different types of data, client 11 determines that its own private key required for the re-encryption key can be the private key corresponding to the data it needs to share. For example, assuming that client 11 generates a public-private key pair (PKa, SKa) for sports data and a public-private key pair (PKb, SKb) for health data, where PKa and PKb are both public keys and SKa and SKb are both private keys, then when client 11 needs to share health data with client 12, client 11 can determine the re-encryption key based on the private key SKb corresponding to the health data and the public key of client 12.
[0090] (5) The client 11 sends the type of data to be shared and the re-encryption key based on the public key encryption of the server 13 to the server 13
[0091] In this solution, after determining the re-encryption key, the client 11 can use the public key of the server 13 to encrypt the re-encryption key to obtain the encryption key information. For example, the encryption key information C = (RK, PKc) = Enc PKc (RK), where RK is the re-encryption key and PKc is the public key of the server 13.
[0092] Then, the client 11 sends the encryption key information and the type of data to be shared (ie, the type of data to be shared) to the server 13 .
[0093] (6) Server 13 sends the data to be shared to client 12
[0094] In this solution, after receiving the encryption key information and the type of data to be shared from client 11, server 13 can filter the ciphertext corresponding to the type of data to be shared from its stored ciphertexts. Server 13 can also decrypt the encryption key information using its own private key to obtain a re-encryption key.
[0095] Furthermore, the server 13 may use the re-encryption key to perform a second encryption on the selected ciphertext (i.e., the ciphertext corresponding to the type of data to be shared) to obtain a ciphertext r, wherein the ciphertext r can be understood as a new ciphertext that includes the ciphertext corresponding to the type of data to be shared. It is understood that the ciphertext corresponding to the type of data to be shared includes the data to be shared.
[0096] For example, the ciphertext filtered by the server 13 is C4, and the re-encryption key is Rk, where C4 = (C2, C1), C1 = g ak , C2=mZ k , g ak The public key of the client 11 after the random number change is used, m is the user's personal data, k is a random number, Z is a pre-set public parameter, Rk = g b / a ; Then the new ciphertext obtained by encrypting C4 with RK is C5=(e(C1,Rk),C2)=(e(g ak , g b / a ), mZ k )=(e(g,g) kb ,mZ k )=(C6, C2) where e is the bilinear mapping pair described above.
[0097] Furthermore, the server 13 may send the determined ciphertext r to the client 12 .
[0098] In this solution, after receiving the ciphertext r sent by the server 13, the client 12 can decrypt the ciphertext r based on its own private key to obtain the data to be shared. For example, if the ciphertext r is C5 described above and the private key of the client 12 is SKb, then the decrypted m = C2 / C6 SKb(-1) . This completes data sharing.
[0099] Therefore, in this solution, when client 11 shares data with client 12, client 12 can directly obtain the data shared by client 11 from server 13 and use the data. In addition, the data to be shared is always in an encrypted state during the data sharing process. This allows only the sharing party and the shared party to know the shared data, that is, the relay device between the sharing party and the shared party (such as server 13, etc.) will not decrypt the data shared by the sharing party, thereby achieving end-to-end encryption protection, and then achieving secure dynamic sharing of encrypted text, thereby improving the security of users' personal data.
[0100] The above is an introduction to a data processing solution provided in this solution. Figure 7 The data processing process shown in FIG. 1 is another data processing solution provided in this solution. It should be noted that this data processing solution mainly introduces the process of securely operating the user's personal data stored in the server 13. See the following description for details.
[0101] (1) Server 13 determines the ciphertext corresponding to the data to be counted
[0102] In this solution, server 13 stores the ciphertext sent by client 11. This ciphertext is obtained by encrypting the user's personal data using client 11's own public key. When server 13 needs to collect statistics on a certain data, server 13 can filter out the ciphertext corresponding to the data it needs to collect statistics from the stored ciphertext.
[0103] For example, the ciphertexts stored in the server 13 may include ciphertext 1 corresponding to the user's step count, ciphertext 2 corresponding to the user's running distance, ciphertext 3 corresponding to the user's heart rate, and so on. When the server 13 needs to count the user's average step count over a period of time, the server 13 can determine all ciphertexts 1 corresponding to the user's step count over that period of time. These ciphertexts 1 are the ciphertexts corresponding to the data to be counted.
[0104] (2) The server 13 sends the ciphertext corresponding to the data to be counted to the client 11
[0105] In one example, the server 13 may use the public key of the client 11 to encrypt the ciphertext corresponding to the data to be counted, to obtain the ciphertext s. The server 13 then sends the ciphertext s to the client 11.
[0106] In one example, each ciphertext stored in the server 13 may include at least two parts, one of which may represent the public key of the client 11 and the other may represent the user data. Optionally, in order to improve security, the user data may be specially processed. For example, the ciphertext C stored in the server 13 is C = (C1, C2) = (g ak ,mZ k ), g a is the public key of the client 11, m is the user's personal data in plain text, Z is a global parameter (or a pre-set public parameter), and k is a random number; where g ak It can be understood as the public key of client 11 after the random number is changed, mZ k It can be understood as user data obtained by processing the user's personal data using global parameters and random numbers.
[0107] At this point, server 13 can generate multiple similar random numbers based on the multiplication cycle group described above. These random numbers are then used to generate random numbers for calculation. Finally, the transport random numbers are used to perform calculations on the data corresponding to the data to be counted, which is obtained by processing the user data using the global parameters and random numbers, to obtain the ciphertext s.
[0108] For example, server 13 can generate three random numbers, namely r1, r2, and r3, based on the multiplication cycle group described above. Using these three random numbers, server 13 can generate nine random numbers for calculation. These nine random numbers R are: r1*r1, r1*r2, r1*r3, r2*r1, r2*r2, r2*r3, r3*r1, r3*r2, and r3*r3. If the user data to be statistically analyzed, obtained by processing the user's personal data using global parameters and random numbers, is: C3_1, C3_2, ..., C3_n, where C3_1 to C3_n are of the same type and C3_n can be understood as the user data uploaded n times using global parameters and random numbers, then the ciphertext s obtained by calculating these data is (C3_1+C3_2+...+C3_n)R. Since R has nine possible values, there are also nine possible ciphertexts.
[0109] It is understood that when server 13 obtains multiple ciphertexts s, server 13 can send the generated random numbers and ciphertexts s to client 11 in their respective order; the order can include the order of the generated random numbers and the order of R generated for the calculation. Client 11 then randomly selects a ciphertext s. This prevents server 13 from knowing the ciphertext s selected by client 11, further improving security.
[0110] (3) Client 11 performs statistics on the data in the ciphertext s
[0111] In one example, after receiving ciphertext s from server 13, client 11 can use its own private key to decrypt the ciphertexts included in ciphertext s. Client 11 then uses its own private key to decrypt the ciphertexts again, obtaining the data to be counted. It is understood that the private keys required for the two decryption operations by client 11 can be the same or different, and this is not a limitation here.
[0112] Furthermore, after obtaining the data to be counted, the client 11 may perform statistics on the data, such as performing a mean operation, to obtain statistical results.
[0113] In one example, if each ciphertext stored in the server 13 can include at least two parts, one of which can represent the public key of the client 11 and the other can represent the user data, and the user data has been processed using global parameters and random numbers, then after the client 11 receives the ciphertext s sent by the server 13, the client 11 can use the global parameters and random numbers to decrypt the ciphertext s to obtain statistical results. When the ciphertext s is obtained based on the random number generated by the server 13, the client 11 can randomly select a random number R, and use the random number R, the global parameters and the random number to decrypt the ciphertext s corresponding to the random number R to obtain the statistical results required by the server 13. For example, if the ciphertext s is C = (C3_1 + C3_2 + ... + C3_n) R = (m1 + m2 + ... + mn) RZ k , then the client 11 decrypts the ciphertext s to obtain the data M=C / (RZ k ), where C3_1, C3_2, ..., C3_n are the user data to be counted using global parameters and random numbers, m1, m2, ..., mn are the plaintext data in the user data to be counted, R is the random number used for the calculation described above, Z is a global parameter, and k is a random number.
[0114] In one example, after receiving the ciphertext s sent by the server 13, the client 11 may ask the user whether to authorize data statistics. If the user authorizes data statistics, the client 11 performs data statistics. In this way, secure operation and statistics of the user's personal data are achieved with the user's authorization.
[0115] (4) Client 11 sends statistical results to server 13
[0116] In this solution, after the client 11 determines the statistical result, it can encrypt the statistical result using the public key of the server 13. Then, the encrypted statistical result is sent to the server 13. For example, if the public key of the server 13 is PKc, and the statistical result is the data M obtained by decrypting the ciphertext s by the client 11, the encrypted statistical result can be Enc PKc (M), where Enc can be understood as encryption.
[0117] (5) Server 13 saves and / or publishes statistical results
[0118] In this solution, after the server 13 receives the encrypted statistical result sent by the client 11, the server 13 can use its own private key to decrypt the encrypted statistical result to obtain the statistical result. After the server 13 obtains the statistical result, it can save the statistical result and / or publish the statistical result, etc. At this point, the server 13 has obtained the statistical data it needs. For example, if the encrypted statistical result received by the server 13 is Enc PKc (M), the private key of the server 13 is SKc, then the statistical data after decryption by the server 13 can be M==Dec SKc (Enc PKc (M)), where Dec can be understood as decryption.
[0119] In summary, in the process of obtaining statistical data, since the ciphertext stored in the server 13 is obtained by encrypting the public key of the client 11, only the client 11 can decrypt the ciphertext stored in the server 13, and the server 13 cannot decrypt the ciphertext it stores, which means that only the client 11 can obtain the user's personal data, while the server 13 will not obtain the user's personal data. In this way, the security of the user's personal data in the data statistics process is achieved, thereby achieving the safe operation and statistics of the user's personal data. It is understandable that since the cloud devices (such as server 13, etc.) in the related technology store the data encrypted by the client, and the cloud devices cannot decrypt this data, this makes it difficult for the cloud devices in the related technology to operate the encrypted data they store. In this solution, the cloud devices can achieve the safe operation and statistics of the user's personal data with the user's authorization.
[0120] Next, based on the data processing scheme described above, a data processing method provided by an embodiment of the present application is introduced. It can be understood that this method is another way of expressing the data processing scheme described above, and the two are combined. This method is proposed based on the data processing scheme described above, and some or all of the content of this method can be found in the description of the data processing scheme above.
[0121] See also Figure 8 , Figure 8 It is a flow chart of a data processing method provided by an embodiment of the present application. It can be understood that the method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. The method can be applied to a system comprising a first client and a server, wherein the server can store at least one ciphertext, and the ciphertext can be obtained by the first client encrypting user data based on the public key of the first client. Exemplarily, the first client can be the client 11 described above, and the server can be the server 13 described above. Figure 8 As shown, the data processing method includes:
[0122] Step 101: A first client obtains a public key of a second client.
[0123] In this solution, the first client can proactively share data with the second client. The second client can also proactively request data sharing from the first client. For example, the first client can be the client 11 described above, and the second client can be the client 12 described above.
[0124] Step 102: The first client determines a re-encryption key based on the first client's private key and the second client's public key.
[0125] In this solution, the first client can determine the re-encryption key based on its own private key and the public key of the second client. For example, if the private key of the first client is a and the public key of the second client is g b , then the re-encryption key Rk can be g jb / a , that is, Rk=g jb / a , where j≠0.
[0126] Step 103: The first client sends the re-encryption key to the server.
[0127] In this solution, after determining the re-encryption key, the first client may send the re-encryption key to the server. For example, the server may be the server 13 described above.
[0128] Furthermore, to facilitate the server in determining what data to share with the second client, the first client may also send the server conditions that the data to be shared must meet. For example, the conditions that the data to be shared must meet may include the type of data to be shared and / or the time period in which the data to be shared falls. The type of data to be shared allows the server to determine what type of data to share, and the time period in which the data to be shared falls allows the server to determine which time period's data to share.
[0129] Step 104: The server receives the re-encryption key, and encrypts the first ciphertext based on the re-encryption key to obtain a second ciphertext, wherein at least one ciphertext includes the first ciphertext.
[0130] In this scheme, after receiving the re-encryption key, the server can use the re-encryption key to re-encrypt the first ciphertext corresponding to the shared data to obtain the second ciphertext. For example, the ciphertext selected by the server is C4, and the re-encryption key is Rk, where C4 = (C2, C1), C1 = g ak , C2=mZ k , g ak The public key of the client 11 after the random number change is used, m is the user's personal data, k is a random number, Z is a pre-set public parameter, Rk = g b / a ; Then the new ciphertext obtained by encrypting C4 with RK is C5=(e(C1,Rk),C2)=(e(g ak , g b / a ), mZ k )=(e(g,g) kb ,mZ k )=(C6, C2) where e is the bilinear mapping pair described above.
[0131] In addition, when the server receives the conditions satisfied by the data to be shared sent by the first client, the server can determine the first ciphertext from at least one ciphertext based on the conditions satisfied by the data to be shared, thereby obtaining the first ciphertext corresponding to the user data that the first client wants to share.
[0132] Step 105: The server sends a second ciphertext to the second client.
[0133] In this solution, after the server obtains the second ciphertext, it can send the second ciphertext to the second client, so that the second client can receive the second ciphertext sent by the server and decrypt the second ciphertext based on the private key of the second client.
[0134] Therefore, in this solution, when the first client shares the user's personal data with the second client, the first client can use its own private key and the public key of the second client to generate a re-encryption key. Then, the first client can send the re-encryption key to the server. Next, the server uses the re-encryption key to re-encrypt the ciphertext corresponding to the data to be shared, obtains the re-encrypted ciphertext, and sends the encrypted ciphertext to the second client. As a result, the second client can directly obtain the data shared by the first client from the server and use the data, and the data to be shared during the data sharing process is always in a ciphertext state, which means that only the sharing party and the shared party can know the shared data, that is, the relay device (such as a server, etc.) between the sharing party and the shared party will not decrypt the data shared by the sharing party, thereby achieving end-to-end encryption protection, and then achieving secure dynamic sharing of ciphertext, thereby improving the security of the user's personal data.
[0135] In one example, each ciphertext stored in the server may include at least two parts, a first part of the at least two parts is used to represent the public key of the first client, and a second part of the at least two parts is used to represent the user data after the first processing. ak ,mZ k ), where g a is the public key of the first client, mZ k is the user data after the first processing, m is the user data without the first processing, k is a random number, and Z is a global parameter.
[0136] At this point, when the server needs to collect user data, it can perform a statistical operation on the user data in the second part of the N sub-ciphertexts to obtain a third ciphertext, where the N sub-ciphertexts are the ciphertexts stored by the server within the first time period. The server then sends the third ciphertext to the first client. Finally, the first client receives the third ciphertext and can decrypt it to obtain the statistical result. For example, the third ciphertext can be the ciphertext s described above.
[0137] Furthermore, to enhance data security, the server performs a statistical operation on the user data in the second portion of the N sub-ciphertexts to obtain a third ciphertext. Specifically, the server first determines M first random numbers, and based on the M first random numbers, determines P second random numbers for use in performing operations on the user data in the second portion of the N sub-ciphertexts, where P > M; then, the server performs a statistical operation on the user data in the second portion of the N sub-ciphertexts based on each second random number to obtain P third ciphertexts. For example, the first random numbers may be the random numbers r1, r2, and r3 described above, and the second random number may be the random number R described above.
[0138] Furthermore, the server sending the third ciphertext to the first client may specifically include: the server sending P third ciphertexts and M first random numbers to the first client. In other words, the server may send each ciphertext and random number determined by the server to the first client.
[0139] Furthermore, the first client decrypts the third ciphertext to obtain a statistical result, which may specifically include: the first client randomly determines a second random number based on the M first random numbers; and, based on the randomly determined second random number and the first parameter used in the first client for performing the first processing on the user data, decrypts the third ciphertext corresponding to the randomly determined second random number to obtain a statistical result. For example, the statistical result may be the data M=C / (RZ) obtained by the client 11 decrypting the ciphertext s described above. k ).
[0140] In addition, after the first client obtains the statistical results, the first client may send the statistical results to the server. The server may then receive the statistical results. In addition, the server may store and / or publish the received statistical results.
[0141] It is understandable that in this solution, when the server obtains statistical data, the ciphertext stored on the server is encrypted using the first client's public key. Therefore, only the first client can decrypt the ciphertext stored on the server, while the server cannot decrypt the ciphertext stored on the server. This means that only the first client can obtain the user's personal data, while the server does not. This ensures the security of the user's personal data during the data collection process, thereby achieving secure operation and statistics of the user's personal data.
[0142] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0143] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0144] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).
[0145] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended to limit the scope of the embodiments of the present application.
Claims
1. A data processing method, characterized in that: Applied to a system comprising a first client and a server, wherein the server stores at least one ciphertext obtained by encrypting user data by the first client based on the first client's public key; The method comprises: The first client obtains the public key of the second client; The first client determines a re-encryption key based on the private key of the first client and the public key of the second client; The first client sends the re-encryption key to the server; The server receives the re-encryption key, and encrypts the first ciphertext based on the re-encryption key to obtain a second ciphertext, wherein the at least one ciphertext includes the first ciphertext; The server sends the second ciphertext to the second client; Each of the ciphertexts includes at least two parts, a first part of the at least two parts is used to represent the public key of the first client, and a second part of the at least two parts is used to represent user data after first processing, where the first processing indicates that the user data is encrypted using a random number and a global parameter; The method further comprises: The server performs a statistical operation on the user data in the second part of the N sub-ciphertexts to obtain a third ciphertext, wherein the N sub-ciphertexts are ciphertexts stored by the server within the first time period; The server sends the third ciphertext to the first client; The first client receives the third ciphertext, decrypts the third ciphertext, and obtains a statistical result.
2. The method according to claim 1, characterized in that The system further includes the second client, and the method further includes: The second client receives the second ciphertext, and decrypts the second ciphertext based on a private key of the second client.
3. The method according to claim 1 or 2, characterized in that The private key of the first client is a, and the public key of the second client is g b , the re-encryption key is g jb / a , where j≠0.
4. The method according to any one of claims 1 or 2, characterized in that Before the server encrypts the first ciphertext based on the re-encryption key, the method further includes: The first client sends the conditions satisfied by the data to be shared to the server; The server receives the conditions satisfied by the data to be shared, and determines the first ciphertext from at least one of the ciphertexts based on the conditions satisfied by the data to be shared.
5. The method according to claim 4, characterized in that The conditions satisfied by the data to be shared include the type of the data to be shared and / or the time period of the data to be shared.
6. The method according to claim 1 or 2, characterized in that The ciphertext is (g ak ,mZ k ), where g a is the public key of the first client, mZ k is the user data after the first processing, m is the user data without the first processing, k is a random number, and Z is a global parameter.
7. The method according to claim 1 or 2, characterized in that The server performs statistical operations on the user data in the second part of the N sub-ciphertexts to obtain a third ciphertext, specifically including: The server determines M first random numbers, and based on the M first random numbers, determines P second random numbers for operating on user data in the second part of the N sub-ciphertexts, where P>M; The server performs a statistical operation on the user data in the second parts of the N sub-ciphertexts based on each of the second random numbers to obtain P third ciphertexts; The server sending the third ciphertext to the first client specifically includes: The server sends P third ciphertexts and M first random numbers to the first client.
8. The method according to claim 7, characterized in that The first client decrypts the third ciphertext to obtain statistical results, which specifically include: The first client randomly determines a second random number based on the M first random numbers; and, based on the randomly determined second random number and the first parameter in the first client used to perform the first processing on the user data, decrypts the third ciphertext corresponding to the randomly determined second random number to obtain the statistical result.
9. The method according to any one of claims 1 or 2, characterized in that: After the first client obtains the statistical results, the method further includes: The first client sends the statistical result to the server; The server receives the statistical result.
10. A data processing method, characterized in that: Applied to a first client, the method includes: The first client obtains the public key of the second client; The first client determines a re-encryption key based on the private key of the first client and the public key of the second client; The first client sends the re-encryption key to the server, so that the server encrypts the first ciphertext based on the re-encryption key to obtain a second ciphertext, wherein the server stores at least one ciphertext obtained by encrypting user data by the first client based on the public key of the first client, and the at least one ciphertext includes the first ciphertext; Each of the ciphertexts includes at least two parts, a first part of the at least two parts is used to represent the public key of the first client, and a second part of the at least two parts is used to represent user data after first processing, where the first processing indicates that the user data is encrypted using a random number and a global parameter; The method further comprises: The first client receives a third ciphertext sent by the server, where the third ciphertext is obtained by the server performing a statistical operation on user data in the second part of N sub-ciphertexts, where the N sub-ciphertexts are ciphertexts stored by the server within the first time period; The first client decrypts the third ciphertext to obtain a statistical result.
11. The method according to claim 10, characterized in that The method further comprises: The first client sends the conditions satisfied by the data to be shared to the server, so that the server determines the first ciphertext from at least one of the ciphertexts based on the conditions satisfied by the data to be shared.
12. The method according to claim 10 or 11, characterized in that The first client receives the third ciphertext sent by the server, specifically including: The first client receives the P third ciphertexts and M first random numbers sent by the server, where the P third ciphertexts are obtained by performing a statistical operation on user data in the second part of the N sub-ciphertexts using P second random numbers determined by the server based on the M first random numbers; The first client decrypts the third ciphertext to obtain statistical results, which specifically include: The first client randomly determines a second random number based on the M first random numbers; and, based on the randomly determined second random number and the first parameter in the first client used to perform the first processing on the user data, decrypts the third ciphertext corresponding to the randomly determined second random number to obtain the statistical result.
13. A data processing method, characterized in that: Applied to a server, the server storing at least one ciphertext, the ciphertext being obtained by encrypting user data by a first client based on a public key of the first client; The method comprises: The server receives a re-encryption key sent by the first client, where the re-encryption key is determined by the first client based on the private key of the first client and the public key of the second client; The server encrypts the first ciphertext based on the re-encryption key to obtain a second ciphertext, wherein at least one of the ciphertexts includes the first ciphertext; The server sends the second ciphertext to the second client; Each of the ciphertexts includes at least two parts, a first part of the at least two parts is used to represent the public key of the first client, and a second part of the at least two parts is used to represent the user data after the first processing; The method further comprises: The server performs a statistical operation on the user data in the second part of the N sub-ciphertexts to obtain a third ciphertext, wherein the N sub-ciphertexts are ciphertexts stored by the server within the first time period; The server sends the third ciphertext to the first client, so that the first client decrypts the third ciphertext to obtain a statistical result.
14. The method according to claim 13, characterized in that Before the server encrypts the first ciphertext based on the re-encryption key, the server further includes: The server receives the conditions satisfied by the data to be shared sent by the first client; The server determines the first ciphertext from at least one of the ciphertexts based on a condition satisfied by the data to be shared.
15. The method according to claim 13 or 14, characterized in that The server performs statistical operations on the user data in the second part of the N sub-ciphertexts to obtain a third ciphertext, specifically including: The server determines M first random numbers, and based on the M first random numbers, determines P second random numbers for operating on user data in the second part of the N sub-ciphertexts, where P>M; The server performs a statistical operation on the user data in the second parts of the N sub-ciphertexts based on each of the second random numbers to obtain P third ciphertexts; The server sending the third ciphertext to the first client specifically includes: The server sends P third ciphertexts and M first random numbers to the first client.
16. A data processing system, characterized in that: The system includes a first client and a server, wherein the system is configured to execute the method according to any one of claims 1 to 9.
17. The system according to claim 16, wherein: The system also includes a second client.
18. A data processing device, characterized in that: include: at least one memory for storing a program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 10 to 12, or execute the method according to any one of claims 13 to 15.
19. A data processing device, characterized in that: The device runs computer program instructions to perform the method according to any one of claims 10 to 12, or the method according to any one of claims 13 to 15.
20. A computer storage medium storing instructions, wherein when the instructions are executed on a computer, the computer executes the method according to any one of claims 10 to 12, or the method according to any one of claims 13 to 15.
21. A computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the method according to any one of claims 10 to 12, or the method according to any one of claims 13 to 15.
Citation Information
Patent Citations
Key migration method and device
CN109903047A