A data processing method, device, apparatus, storage medium, and program product

By simplifying the original decryption exponent and using the prime numbers of the first and second keys to simplify the decryption exponent respectively, the problem that exponentiation operation affects decryption efficiency in encryption and decryption algorithms based on composite residue class problems is solved, thereby improving the efficiency of decryption and data processing.

CN118784234BActive Publication Date: 2026-07-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2023-04-03
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Encryption and decryption algorithms based on the compound residue class problem involve exponentiation operations during decryption, which affects decryption efficiency and, consequently, data processing efficiency.

Method used

The original decryption exponent is simplified by using the first key prime number and the second key prime number respectively to obtain the first decryption exponent and the second decryption exponent. The data to be decrypted is decrypted by combining these two exponents, thereby reducing the computational cost of the exponentiation.

Benefits of technology

This improves decryption efficiency, thereby improving data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784234B_ABST
    Figure CN118784234B_ABST
Patent Text Reader

Abstract

The application provides a data processing method and device, equipment, a storage medium and a program product, which are applied to various data encryption and decryption scenes such as cloud technology, artificial intelligence and secure multi-party computation; the data processing method comprises the following steps: simplifying an original decryption index based on a first key prime number to obtain a first decryption index, and simplifying the original decryption index based on a second key prime number to obtain a second decryption index, wherein the first key prime number and the second key prime number are used to determine a modulus space of encryption and decryption; decrypting to-be-decrypted data based on the first decryption index to obtain first plaintext data, and decrypting the to-be-decrypted data based on the second decryption index to obtain second plaintext data, wherein the to-be-decrypted data is a result obtained by performing data calculation on to-be-calculated ciphertext by a calculation device; and the to-be-decrypted data is decrypted in combination with the first plaintext data and the second plaintext data to obtain target plaintext data. Through the application, the data processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to data processing technology in the field of computer networks, and more particularly to a data processing method, apparatus, device, storage medium, and program product. Background Technology

[0002] In data processing involving encryption and decryption, encryption and decryption algorithms based on compound residue class problems (such as the Paillier algorithm) are often used. However, decryption using these algorithms involves exponentiation, which affects decryption efficiency and consequently, data processing efficiency. Summary of the Invention

[0003] This application provides a data processing method, apparatus, device, storage medium, and program product that can improve decryption efficiency, thereby improving data processing efficiency.

[0004] The technical solution of this application embodiment is implemented as follows:

[0005] This application provides a data processing method, the method comprising:

[0006] The original decryption index is simplified based on the first key prime number to obtain the first decryption index, and the original decryption index is simplified based on the second key prime number to obtain the second decryption index. The first key prime number and the second key prime number are used to determine the modulus space of encryption and decryption, and the original decryption index refers to the initial index during decryption.

[0007] Based on the first decryption index, the data to be decrypted is decrypted to obtain the first plaintext data. Based on the second decryption index, the data to be decrypted is decrypted to obtain the second plaintext data. The data to be decrypted is the result obtained by the computing device from the data calculation of the ciphertext to be calculated.

[0008] By combining the first plaintext data and the second plaintext data, the data to be decrypted is decrypted to obtain the target plaintext data.

[0009] This application provides a data processing apparatus, the data processing apparatus comprising:

[0010] An index simplification module is used to simplify the original decryption index based on a first key prime number to obtain a first decryption index, and to simplify the original decryption index based on a second key prime number to obtain a second decryption index. The first key prime number and the second key prime number are used to determine the modulus space for encryption and decryption, and the original decryption index refers to the initial index during decryption.

[0011] The data decryption module is used to decrypt the data to be decrypted based on the first decryption index to obtain the first plaintext data, and to decrypt the data to be decrypted based on the second decryption index to obtain the second plaintext data, wherein the data to be decrypted is the result obtained by the computing device from the data calculation of the ciphertext to be calculated;

[0012] The data decryption module is further configured to combine the first plaintext data and the second plaintext data to decrypt the data to be decrypted, thereby obtaining the target plaintext data.

[0013] In this embodiment of the application, the index simplification module is further configured to obtain the first coprime number corresponding to the first key prime number; obtain the first greatest common divisor between the original decryption index and the first coprime number; and determine the ratio of the original decryption index to the first greatest common divisor as the first decryption index, wherein the ratio of the original decryption index to the first greatest common divisor is used to simplify the original decryption index.

[0014] In this embodiment of the application, the data decryption module is further configured to calculate a first exponential result of the data to be decrypted using the first decryption exponent as the exponent; obtain a first modulo exponent result corresponding to the first exponent result and the second key prime number; obtain a first equivalent parameter corresponding to the first decryption exponent; and perform decryption calculation by combining the first modulo exponent result, the first equivalent parameter, and the second key prime number to obtain the first plaintext data.

[0015] In this embodiment of the application, the data decryption module is further configured to calculate a second exponential result of the first encryption factor using the first decryption exponent as the exponent, wherein the first encryption factor is used to encrypt the ciphertext to be calculated; obtain a second modulo exponential result corresponding to the second exponential result and the second key prime number; and determine the modulo result of the second modulo exponential result with respect to the second key prime number as the first equivalent parameter.

[0016] In this embodiment of the application, the index simplification module is further configured to obtain the second coprime number corresponding to the second key prime number; obtain the second greatest common divisor between the original decryption index and the second coprime number; and determine the ratio of the original decryption index to the second greatest common divisor as the second decryption index, wherein the ratio of the original decryption index to the second greatest common divisor is used to simplify the original decryption index.

[0017] In this embodiment of the application, the data decryption module is further configured to combine the first plaintext data, the second plaintext data, the first modulo processing of the first key prime number, and the second modulo processing of the second key prime number to obtain the remaining general term; determine the replacement modulo processing of the second modulo processing based on the relationship between the second modulo processing and the first modulo processing; replace the second modulo processing in the remaining general term based on the replacement modulo processing to obtain the item to be decrypted; and calculate the item to be decrypted to obtain the target plaintext data.

[0018] In this embodiment of the application, the data processing device further includes an index acquisition module, used to determine a first decryption prime number and a second decryption prime number based on a specified number of bits; and to determine the product of the first decryption prime number and the second decryption prime number as the original decryption index, wherein the original decryption index is less than a target greatest common multiple, and the target greatest common multiple refers to the greatest common multiple corresponding to the first coprime number and the second coprime number.

[0019] In this embodiment of the application, the data processing device further includes a data encryption module, configured to: obtain the first key prime number and the second key prime number for the data to be calculated; determine the modulus exponent based on the product of the first key prime number and the second key prime number; determine the first encryption factor and the second encryption factor based on the modulus exponent; and perform homomorphic encryption on the data to be calculated based on the first encryption factor and the second encryption factor to obtain the ciphertext to be calculated.

[0020] In this embodiment of the application, the data processing device further includes a data acquisition module, configured to send the ciphertext to be calculated to the computing device, wherein the computing device is configured to perform data calculation on the ciphertext to be calculated, the data calculation including at least one of homomorphic addition and homomorphic scalar multiplication; and to receive the data to be decrypted sent by the computing device for the ciphertext to be calculated.

[0021] In this embodiment of the application, the data processing device further includes a model training module, used to perform gradient calculation based on the prediction results of the model to be trained and the label data to obtain the data to be calculated, wherein the model to be trained is a neural network model to be trained for information prediction; and is also used to adjust the model parameters of the model to be trained based on the target plaintext data to obtain a target prediction model, wherein the target prediction model is used to predict the information to be predicted.

[0022] In this embodiment, homomorphic encryption and decryption are encryption and decryption algorithms based on the compound residue class problem.

[0023] This application provides an electronic device for data processing, the electronic device comprising:

[0024] Memory is used to store executable instructions or computer programs.

[0025] The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the data processing method provided in the embodiments of this application.

[0026] This application provides a computer-readable storage medium storing computer-executable instructions or computer programs, which, when executed by a processor, implement the data processing method provided in this application.

[0027] This application provides a computer program product, including computer-executable instructions or a computer program, which, when executed by a processor, implements the data processing method provided in this application.

[0028] The embodiments of this application have at least the following beneficial effects: by simplifying the original decryption exponent by using the first key prime number and the second key prime number respectively, the simplified first decryption exponent and the second decryption exponent are both smaller than the original decryption exponent; thus, by decrypting the data to be decrypted by using the first decryption exponent and the second decryption exponent respectively, and then combining the decrypted first plaintext data and the second plaintext data to achieve decryption of the data to be decrypted, the amount of exponent calculation in the decryption process can be reduced, thereby improving decryption efficiency and thus improving data processing efficiency. Attached Figure Description

[0029] Figure 1 This is a schematic diagram of the architecture of the data processing system provided in the embodiments of this application;

[0030] Figure 2 This is one of the embodiments provided in this application. Figure 1 A schematic diagram of the terminal structure in the diagram;

[0031] Figure 3 This is a flowchart illustrating the data processing method provided in the embodiments of this application. Figure 1 ;

[0032] Figure 4 This is a schematic diagram illustrating an exemplary simplified original decryption index provided in an embodiment of this application;

[0033] Figure 5 This is a simplified flowchart illustrating the original decryption index provided in an embodiment of this application;

[0034] Figure 6 This is a schematic diagram of the process for decrypting data to be decrypted provided in an embodiment of this application;

[0035] Figure 7This is a flowchart illustrating the data processing method provided in the embodiments of this application. Figure 2 ;

[0036] Figure 8a This is a flowchart illustrating the data processing method provided in the embodiments of this application. Figure 3 ;

[0037] Figure 8b An interactive diagram of an exemplary decryption application provided in an embodiment of this application;

[0038] Figure 9 This is a schematic diagram of decryption comparison provided in the embodiments of this application;

[0039] Figure 10 This is a schematic diagram illustrating the encryption / decryption comparison provided in an embodiment of this application;

[0040] Figure 11 This is an exemplary encryption / decryption application diagram provided in an embodiment of this application. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0042] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0043] In the following description, the terms “first, second, third”, etc., are used to distinguish similar objects and do not represent a specific ordering of objects. It is understood that “first, second, third”, etc., may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0044] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.

[0045] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0046] 1) Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0047] 2) Machine Learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It is used to study how computers simulate or implement human learning behavior to acquire new knowledge or skills; and to reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence. Its applications are widespread across all areas of artificial intelligence. Machine learning typically includes techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, and inductive learning.

[0048] 3) Artificial neural networks are mathematical models that mimic the structure and function of biological neural networks. Exemplary structures of artificial neural networks in this application include Graph Convolutional Networks (GCNs, a type of neural network for processing graph-structured data), Deep Neural Networks (DNNs), Convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), Neural State Machines (NSMs), and Phase-Functioned Neural Networks (PFNNs). The training models and target prediction models involved in this application are all models corresponding to artificial neural networks.

[0049] 4) Homomorphic encryption (HE) refers to encrypting data, performing computational operations on the encrypted data, and then decrypting the result. The decrypted result is equivalent to the result obtained by performing the same computational operations on the unencrypted data. Homomorphic encryption is a cryptographic technique based on the computational complexity theory of mathematical problems. After homomorphically encrypting multiple plaintext data, performing several logical calculations (such as addition and multiplication) in the ciphertext space to obtain the ciphertext output, and then decrypting this output, the decrypted result is the same as the output obtained by performing the same logical calculations on the unencrypted original data.

[0050] 5) Homomorphic addition, a logical computation that can be implemented in homomorphic encryption; refers to any two elements u and v in the plaintext space, the encryption result of u is [[u]], and the encryption result of v is [[v]]. Homomorphic addition can be described by formula (1), as shown below.

[0051] D sk ([[u]]+[[v]])=D sk ([[u+v]])=u+v(1);

[0052] Among them, D sk () indicates decryption processing based on the private key sk. In the embodiments of this application, the data computation of the ciphertext to be computed can be an addition operation based on homomorphic addition.

[0053] 6) Homomorphic scalar multiplication, another logical computation that can be implemented in homomorphic encryption; refers to the encryption result of u for any element u and scalar k in plaintext space as [[u]]. Homomorphic scalar multiplication can be described by formula (2), which is shown below.

[0054] D sk ([[u]]×k)=D sk ([[u×k]])=u×k(2);

[0055] In the embodiments of this application, the data computation of the ciphertext to be computed can be a scalar multiplication operation based on homomorphic scalar multiplication.

[0056] 7) Fully Homomorphic Encryption (FHE) refers to encryption that can perform any number of addition and multiplication homomorphic operations during the encryption process; FHE requires noise removal after calculating a finite number of multiplications.

[0057] 8) Somewhat Homomorphic Encryption (SWHE) refers to encryption that allows for a finite number of addition and multiplication homomorphic operations (e.g., BGN) during the encryption process.

[0058] 9) Partially Homomorphic Encryption (PHE) refers to encryption processes that can perform either additive homomorphic operations or multiplicative homomorphic operations. The encryption process that can perform additive homomorphic operations is also called Additive Homomorphic Encryption (AHE) (e.g., RSA, GM, Elgamal, Paillier).

[0059] 10) Secure Multi-party Computation (MPC) refers to multiple participating parties collaborating to complete a common computational task according to an agreed-upon secure computation protocol without disclosing their individual data. The data processing method provided in this application embodiment can be applied to secure multi-party computation.

[0060] 11) Paillier encryption algorithm, a semi-homomorphic encryption algorithm based on the compound residue class problem, is used to assist in completing various privacy computing tasks. For example, in the field of federated learning, Paillier encryption algorithm can be used to achieve joint training of models (exemplarily, in the training of neural network models such as Gradient Boosting Decision Tree (GBDT), Reinforcement Learning (LR), and DNN in federated learning).

[0061] It should be noted that in data processing involving encryption and decryption, encryption and decryption algorithms based on the compound residue class problem are often used. However, when using encryption and decryption algorithms based on the compound residue class problem for decryption, exponentiation calculations are involved, which affects decryption efficiency and thus data processing efficiency.

[0062] Based on this, embodiments of this application provide a data processing method, apparatus, device, computer-readable storage medium, and computer program product, which can improve decryption efficiency, thereby improving data processing efficiency. The following describes exemplary applications of the data processing device provided in embodiments of this application. The data processing device and computing device provided in embodiments of this application can be implemented as various types of terminals such as smartphones, smartwatches, laptops, tablets, desktop computers, smart home appliances, set-top boxes, smart in-vehicle devices, portable music players, personal digital assistants, dedicated messaging devices, intelligent voice interaction devices, portable gaming devices, and smart speakers. They can also be implemented as servers, or a combination of both. The following will describe exemplary applications when both the data processing device and computing device are implemented as terminals.

[0063] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the data processing system provided in the embodiments of this application; as shown Figure 1As shown, to support a data processing application, in the data processing system 100, terminal 400 connects to server 200 via network 300, terminal 600 connects to server 500 via network 300, and terminal 400 connects to terminal 600 via network 300; network 300 can be a wide area network or a local area network, or a combination of both; server 200 is used to provide computing services to terminal 400 via network 300, and server 500 is used to provide computing services to terminal 600 via network 300.

[0064] Terminal 400 is used to send ciphertext to be calculated to terminal 600 via network 300 and to receive data to be decrypted sent by terminal 600 via network 300. It is also used to simplify the original decryption exponent based on a first key prime number to obtain a first decryption exponent, and to simplify the original decryption exponent based on a second key prime number to obtain a second decryption exponent, wherein the first and second key prime numbers are used to determine the modulus space for encryption and decryption, and the original decryption exponent refers to the initial exponent during decryption; decrypting the data to be decrypted based on the first decryption exponent to obtain first plaintext data, and decrypting the data to be decrypted based on the second decryption exponent to obtain second plaintext data, wherein the data to be decrypted is the result obtained by the computing device from the ciphertext to be calculated; combining the first and second plaintext data, decrypting the data to be decrypted to obtain target plaintext data; and training a model based on the target plaintext data (the model training process shown in the graphical interface 410-1 is illustrated).

[0065] Terminal 600 is used to receive ciphertext to be computed sent by terminal 400 through network 300, perform homomorphic encryption operation on the ciphertext to be computed to obtain data to be decrypted, and send the data to be decrypted to terminal 400 through network 300. Similarly, terminal 600 can also perform its own model training similar to terminal 400 (the model training process shown in graphical interface 610-1 is illustrated).

[0066] In some embodiments, server 200 and server 500 can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals and servers can be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment.

[0067] See Figure 2 , Figure 2 This is one of the embodiments provided in this application. Figure 1 A schematic diagram of the terminal structure in the diagram; such as Figure 2 As shown, terminal 400 includes at least one processor 410, memory 450, at least one network interface 420, and user interface 430. The various components in terminal 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to implement communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 2 The general labeled all buses as Bus System 440.

[0068] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0069] User interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0070] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices physically located away from the processor 410.

[0071] The memory 450 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 450 described in this application embodiment is intended to include any suitable type of memory.

[0072] In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0073] Operating system 451 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0074] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: Bluetooth, Wi-Fi, and Universal Serial Bus (USB), etc.

[0075] Presentation module 453 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 (e.g., a display screen, a speaker, etc.) associated with user interface 430;

[0076] The input processing module 454 is used to detect and translate one or more user inputs or interactions from one or more input devices 432.

[0077] In some embodiments, the data processing apparatus provided in this application can be implemented in software. Figure 2 A data processing device 455 stored in memory 450 is shown. This device can be software in the form of programs and plug-ins, and includes the following software modules: an exponent simplification module 4551, a data decryption module 4552, an exponent acquisition module 4553, a data encryption module 4554, a data acquisition module 4555, and a model training module 4556. These modules are logically connected and can therefore be arbitrarily combined or further divided according to their implemented functions. The functions of each module will be described below.

[0078] In some embodiments, the data processing apparatus provided in this application can be implemented in hardware. As an example, the data processing apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the data processing method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0079] In some embodiments, the terminal or server can implement the data processing method provided in this application by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be microprogram-level commands, machine instructions, or software instructions. Computer programs can be native programs or software modules in an operating system; they can be native applications (APPs), i.e., programs that need to be installed in the operating system to run; they can also be applets, i.e., programs that only need to be downloaded to a browser environment to run; or they can be applets that can be embedded in any APP. In summary, the aforementioned computer-executable instructions can be any form of instruction, and the aforementioned computer programs can be any form of application, module, or plugin.

[0080] The data processing method provided in this application will be described below with reference to exemplary applications and implementations of the data processing device provided in the embodiments of this application. Furthermore, the data processing method provided in the embodiments of this application is applicable to various data encryption and decryption scenarios such as cloud technology, artificial intelligence, and secure multi-party computation.

[0081] See Figure 3 , Figure 3 This is a flowchart illustrating the data processing method provided in the embodiments of this application. Figure 1 ,in, Figure 3 The main body executing each step is the data processing equipment; the following will combine... Figure 3 The steps shown are explained.

[0082] Step 101: Simplify the original decryption index based on the first key prime number to obtain the first decryption index; simplify the original decryption index based on the second key prime number to obtain the second decryption index.

[0083] In this embodiment, the data processing device obtains a private key for decryption, and this private key includes an original decryption index. Additionally, the data processing device also obtains a first key prime number and a second key prime number for determining the encryption / decryption modulus space. Here, before decrypting based on the original decryption index, the data processing device first simplifies the original decryption index based on the first key prime number and the second key prime number, and then performs decryption based on the simplification results. Both the first and second decryption indices are smaller than the original decryption index.

[0084] It should be noted that the original decryption index refers to the initial index used during decryption. The data processing device reduces the original decryption index based on the relationship between the first key prime number and the original decryption index, thus simplifying the original decryption index based on the first key prime number. For example, it simplifies the original decryption index based on the greatest common divisor of the original decryption index and a number less than 1 of the first key prime number. Here, the first decryption index refers to the simplified original decryption index obtained by simplifying the original decryption index based on the first key prime number. The data processing device also reduces the original decryption index based on the relationship between the second key prime number and the original decryption index, thus simplifying the original decryption index based on the second key prime number. For example, it simplifies the original decryption index based on the greatest common divisor of the original decryption index and a number less than 1 of the second key prime number. Here, the second decryption index refers to the simplified original decryption index obtained by simplifying the original decryption index based on the second key prime number. Additionally, the encryption / decryption modulus space can be determined by the square of the product of the first key prime number and the second key prime number. The first key prime number and the second key prime number are different, and both the first key prime number and the second key prime number are greater than a specified threshold. The lengths of the first key prime number and the second key prime number are equal. Furthermore, the greatest common multiple of the product of the first key prime number and the product of a number that is 1 less than the first key prime number and a number that is 1 less than the second key prime number is 1.

[0085] Step 102: Decrypt the data to be decrypted based on the first decryption index to obtain the first plaintext data, and decrypt the data to be decrypted based on the second decryption index to obtain the second plaintext data.

[0086] In this embodiment, the data processing device uses a first decryption index as the index for decrypting the data to be decrypted, and the resulting decryption is the first plaintext data, which refers to the decryption result of the data to be decrypted in the space corresponding to the first decryption index. The data processing device also uses a second decryption index as the index for decrypting the data to be decrypted, and the resulting decryption is the second plaintext data, which refers to the decryption result of the data to be decrypted in the space corresponding to the second decryption index.

[0087] It should be noted that the data to be decrypted is the result obtained by the computing device from the data calculation of the ciphertext to be calculated. The data calculation can be at least one of homomorphic addition and homomorphic scalar multiplication.

[0088] Step 103: Combine the first plaintext data and the second plaintext data to decrypt the data to be decrypted, and obtain the target plaintext data.

[0089] In this embodiment of the application, the data processing device aggregates the first plaintext data and the second plaintext data into the space corresponding to the original decryption index based on the congruence equation of the residual theorem, so as to combine the first plaintext data and the second plaintext data to decrypt the data to be decrypted, thereby decrypting the plaintext of the data to be decrypted; here the plaintext of the data to be decrypted is referred to as the target plaintext data.

[0090] For example, see Figure 4 , Figure 4 This is an exemplary simplified diagram of the original decryption index provided in an embodiment of this application; as shown... Figure 4 As shown, the original decryption operation space 4-1 is the operation space with the original decryption index as the exponent, and the current decryption operation space 4-2 is the operation space with the first decryption index as the exponent and the operation space with the second decryption index as the exponent.

[0091] It is understandable that simplifying the original decryption exponent by using the first and second key prime numbers respectively results in both the simplified first and second decryption exponents being smaller than the original decryption exponents. Therefore, decrypting the data to be decrypted using the first and second decryption exponents respectively, and then combining the decrypted first and second plaintext data to achieve decryption, can reduce the amount of exponent calculation in the decryption process, thereby reducing decryption time, improving decryption efficiency, and ultimately improving data processing efficiency.

[0092] See Figure 5 , Figure 5 This is a simplified flowchart illustrating the original decryption index provided in an embodiment of this application, wherein, Figure 5 The main entity executing each step is the data processing equipment; such as... Figure 5 As shown in the embodiment of this application, the step of obtaining the first decryption index in step 101 can be implemented by steps 1011 to 1013; that is, the data processing device simplifies the original decryption index based on the first key prime number to obtain the first decryption index, including steps 1011 to 1013. Each step is described below.

[0093] Step 1011: Obtain the number of coprime numbers corresponding to the first key prime number.

[0094] It should be noted that, based on Euler's theorem, the data processing device can obtain the number of positive integers that are not greater than the first key prime number and are coprime to the first key prime number by obtaining a number that is 1 less than the first key prime number; the number of positive integers that are not greater than the first key prime number and are coprime to the first key prime number is the first coprime number.

[0095] Step 1012: Obtain the first greatest common divisor between the original decryption index and the first coprime quantity.

[0096] It should be noted that the data processing device obtains the greatest common divisor (GCD) between the original decryption index and the first coprime number, which is equivalent to obtaining the first GCD; that is, the first GCD refers to the greatest common divisor corresponding to the original decryption index and the first coprime number. The first GCD is used to represent the relationship between the first key prime number and the original decryption index as described above.

[0097] Step 1013: Determine the ratio of the original decryption index to the first greatest common divisor as the first decryption index.

[0098] It should be noted that the data processing device determines the original decryption index as the numerator and the first greatest common divisor as the denominator, calculates the ratio to obtain the ratio of the original decryption index to the first greatest common divisor, and then determines the calculated ratio as the first decryption index. Here, the ratio of the original decryption index to the first greatest common divisor is used to simplify the original decryption index.

[0099] In this embodiment of the application, the step of obtaining the first decryption index in step 101 is similar to the process of obtaining the second decryption index. Thus, the data processing device simplifies the original decryption index based on the second key prime number to obtain the second decryption index, including: the data processing device first obtains the second coprime number corresponding to the second key prime number; then obtains the second greatest common divisor between the original decryption index and the second coprime number; finally, the ratio of the original decryption index to the second greatest common divisor is determined as the second decryption index.

[0100] It should be noted that, based on Euler's theorem, the data processing device can obtain the number of positive integers that are no greater than the second key prime number and are coprime to it by obtaining a number that is 1 less than the second key prime number; this number of positive integers that are no greater than the second key prime number and are coprime to it is the second coprime quantity. Furthermore, the data processing device obtains the greatest common divisor (GCD) between the original decryption exponent and the second coprime quantity, thus obtaining the second GCD; that is, the second GCD refers to the GCD corresponding to the original decryption exponent and the second coprime quantity; where the second GCD is used to represent the relationship between the second key prime number and the original decryption exponent described above. In addition, the data processing device determines the original decryption exponent as the numerator and the second GCD as the denominator, calculates the ratio to obtain the ratio of the original decryption exponent to the second GCD; and determines the calculated ratio as the second decryption exponent. Here, the ratio of the original decryption exponent to the second GCD is used to simplify the original decryption exponent.

[0101] See Figure 6 , Figure 6 This is a schematic diagram of the process for decrypting data to be decrypted provided in an embodiment of this application, wherein, Figure 6 The main entity executing each step is the data processing equipment; such as... Figure 6 As shown in the embodiment of this application, in step 102, the data processing device decrypts the data to be decrypted based on the first decryption index to obtain the first plaintext data, including steps 1021 to 1024. Each step is described below.

[0102] Step 1021: Calculate the first index result of the data to be decrypted using the first decryption index as the index.

[0103] In this embodiment of the application, the data processing device uses the first decryption index as the exponent and the data to be decoded as the base to perform exponentiation calculation, and the obtained calculation result is the first exponent result.

[0104] Step 1022: Obtain the first modulo exponent result corresponding to the first exponent result and the second key prime number.

[0105] In this embodiment of the application, the data processing device calculates the square of the second key prime number and calculates the result of the first exponent modulo the square of the second key prime number, thus obtaining the first modulo exponent result.

[0106] Step 1023: Obtain the first equivalent parameter corresponding to the first decryption index.

[0107] In this embodiment, the first equivalent parameter is used to combine the first modulo exponent result to form the equivalent space of the original decryption exponent. Here, the data processing device first calculates the second exponent result of the first encryption factor using the first decryption exponent as the exponent; then obtains the second modulo exponent result corresponding to the second key prime number; finally, the modulo result of the second modulo exponent result divided by the second key prime number is determined as the first equivalent parameter.

[0108] It should be noted that the data processing device uses the first decryption exponent as the exponent and the first encryption factor as the base for calculation, and the result obtained is the second exponent result. The data processing device calculates the second exponent result modulo the square of the second key prime number, which is the second modulo exponent result. The data processing device obtains the reciprocal of the ratio of a number less than 1 of the second modulo exponent result to the second decryption exponent, and then modulo the obtained reciprocal onto the second key prime number. The result obtained is the modulo result of the second modulo exponent result modulo the second key prime number. In addition, the first encryption factor is used to encrypt the ciphertext to be calculated. The data processing device can determine the first encryption factor as a number that is 1 greater than the product of the first key prime number and the second key prime number; and the first encryption factor is obtained before encryption.

[0109] Step 1024: Combine the first modulus exponent result, the first equivalent parameter, and the second key prime number to perform decryption calculation and obtain the first plaintext data.

[0110] In this embodiment, the data processing device first obtains a number that is one less than the first modulo exponent result, and then obtains the product of the number that is one less than the first modulo exponent result and the first equivalent parameter; next, it obtains the ratio of the obtained product to the second key prime number; finally, it modulo the obtained ratio to the second key prime number, and the obtained modulo result is the first plaintext data. The process of obtaining the number that is one less than the first modulo exponent result, the product, the ratio, and the modulo operation constitutes the process of performing decryption calculations by combining the first modulo exponent result, the first equivalent parameter, and the second key prime number.

[0111] In this embodiment of the application, the process of obtaining the second plaintext data in step 102 is similar to the process of obtaining the first plaintext data; thus, the data processing device decrypts the data to be decrypted based on the second decryption index to obtain the second plaintext data, including: the data processing device first calculates the third exponent result of the data to be decrypted using the second decryption index as the exponent, then obtains the third modulo exponent result corresponding to the third exponent result and the first key prime number, and obtains the second equivalent parameter corresponding to the second decryption index, and finally, combines the third modulo exponent result, the second equivalent parameter, and the first key prime number to perform decryption calculation to obtain the second plaintext data.

[0112] It should be noted that the data processing device uses the second decryption exponent as the exponent and the data to be decoded as the base to perform exponential calculation, and the result obtained is the third exponent result. The data processing device calculates the square of the first key prime number and calculates the result of the third exponent modulo the square of the first key prime number, which yields the third modulo exponent result. The second equivalent parameter is used to combine the third modulo exponent result to form the equivalent space of the original decryption exponent. Here, the data processing device first calculates the fourth exponent result of the first encryption factor using the second decryption exponent as the exponent; then it obtains the fourth modulo exponent result corresponding to the first key prime number; finally, it takes the modulo result of the fourth modulo exponent result modulo the first key prime number, and determines it as the second equivalent parameter. Afterwards, the data processing device first obtains a number that is 1 less than the third modulo exponent result, and then obtains the product of this number and the second equivalent parameter; next, it obtains the ratio of the obtained product to the first key prime number; finally, it takes the modulo of the obtained ratio modulo the first key prime number, and the resulting modulo is the second plaintext data. The process of obtaining the number, product, ratio, and modulo that are 1 less than the third modulo exponent result is the process of performing decryption calculation by combining the third modulo exponent result, the second equivalent parameter, and the first key prime number.

[0113] It should also be noted that the data processing device uses the second decryption exponent as the exponent and the first encryption factor as the base for calculation, and the result obtained is the fourth exponent result. The data processing device calculates the fourth exponent result modulo the square of the first key prime number, which is the fourth modulo exponent result. The data processing device obtains the reciprocal of the ratio of a number that is 1 less than the fourth modulo exponent result to the first decryption exponent, and then modulo the obtained reciprocal onto the first key prime number. The result obtained is the modulo result of the fourth modulo exponent result modulo the first key prime number.

[0114] See Figure 7 , Figure 7 This is a flowchart illustrating the data processing method provided in the embodiments of this application. Figure 2 ,in, Figure 7 The main entity executing each step is the data processing equipment; such as... Figure 7 As shown, step 103 can be implemented through steps 1031 to 1034; that is, the data processing device combines the first plaintext data and the second plaintext data to decrypt the data to be decrypted and obtain the target plaintext data, including steps 1031 to 1034. Each step is explained below.

[0115] Step 1031: Combine the first plaintext data, the second plaintext data, the first modulo operation on the first key prime number, and the second modulo operation on the second key prime number to obtain the remaining general term.

[0116] It should be noted that the first modulo processing of the first key prime number refers to the process of multiplying the reciprocal of the second key prime number by the first key prime number and then multiplying it by the second key prime number; the second modulo processing of the second key prime number refers to the process of multiplying the reciprocal of the first key prime number by the second key prime number and then multiplying it by the first key prime number. Here, based on the general term formula of the remainder theorem, the data processing device obtains the first product representation of the first plaintext data and the representation of the second modulo processing, and obtains the second product representation of the second plaintext data and the representation of the first modulo processing. Then, the sum of the first product representation and the second product representation is determined as the remainder general term.

[0117] Step 1032: Based on the relationship between the second module processing and the first module processing, determine the replacement module processing for the second module processing.

[0118] In this embodiment, since the prime numbers of the first and second keys are coprime, the sum of the representations of the first and second modular processing is 1, based on Bézout's theorem. Here, the relationship between the second and first modular processing is that the sum of their representations is 1. Therefore, to calculate the remaining general term, the data processing device either replaces the second modular processing with the first modular processing, or replaces the first modular processing with the second modular processing. Here, the example of replacing the second modular processing with the first modular processing is used. Here, "replacing the modular processing" refers to obtaining a processing equivalent to the second modular processing based on the first modular processing.

[0119] Step 1033: Based on the replacement modulus processing, replace the second modulus processing in the remaining general terms to obtain the term to be decrypted.

[0120] In this embodiment, since the replacement modulus processing is equivalent to the second modulus processing, the data processing device replaces the second modulus processing in the remaining general terms with the replacement modulus processing based on the first modulus processing representation, thereby achieving rapid calculation of the remaining general terms. The term to be decrypted is the remaining general term after the second modulus processing replacement.

[0121] Step 1034: Calculate the item to be decrypted to obtain the target plaintext data.

[0122] In this embodiment of the application, the data processing device performs calculations on the item to be decrypted, and the obtained calculation result is the target-sensory plaintext data.

[0123] In this embodiment of the application, before the data processing in step 101 simplifies the original decryption index based on the first key prime number to obtain the first decryption index, the data processing method further includes the process of obtaining the original decryption index. The process of obtaining the original decryption index includes: the data processing device determines the first decryption prime number and the second decryption prime number based on a specified number of bits (e.g., two bits, three bits, etc.); and the product of the first decryption prime number and the second decryption prime number is determined as the original decryption index; wherein, the original decryption index is less than the target greatest common multiple, and the target greatest common multiple refers to the greatest common multiple corresponding to the first coprime number and the second coprime number.

[0124] In this embodiment of the application, before the data processing in step 101 simplifies the original decryption index based on the first key prime number to obtain the first decryption index, the data processing method further includes a process of encrypting the ciphertext to be calculated. The process of encrypting the ciphertext to be calculated includes: the data processing device obtains the first key prime number and the second key prime number for the data to be calculated; and determines the modulus exponent based on the product of the first key prime number and the second key prime number; then determines the first encryption factor and the second encryption factor based on the modulus exponent; and finally, performs homomorphic encryption on the data to be calculated based on the first encryption factor and the second encryption factor to obtain the ciphertext to be calculated.

[0125] It should be noted that the data processing device determines the modulo exponent by multiplying the first key prime number and the second key prime number. The first encryption factor and the second encryption factor belong to the data space determined based on the modulo exponent. For example, when the modulo exponent is n, the first encryption factor and the second encryption factor belong to... Here, the data processing device calculates a first result using the data to be calculated as the exponent and a first encryption factor as the base, and calculates a second result using the product of the modulo exponent and a random number as the exponent and a second encryption factor as the base. Then, it performs modulo operation on the product of the first and second results (for example, the modulo object is the square of the modulo exponent) to achieve homomorphic encryption. The homomorphically encrypted data to be calculated is the ciphertext to be calculated. For example, the homomorphic encryption process is shown in the following formula (9).

[0126] In this embodiment, homomorphic encryption and decryption are encryption and decryption algorithms based on the compound residue class problem.

[0127] See Figure 8a , Figure 8a This is a flowchart illustrating the data processing method provided in the embodiments of this application. Figure 3 ,in, Figure 8a The main entity executing each step is the data processing equipment; such as... Figure 8a As shown in the embodiment of this application, steps 104 and 105 are included before step 101. Each step will be described below.

[0128] Step 104: Send the ciphertext to be calculated to the computing device.

[0129] It should be noted that after the data processing device sends the ciphertext to be calculated to the computing device, the computing device performs data calculations on the ciphertext, and the result of the data calculation is the data to be decrypted.

[0130] Step 105: Receive the data to be decrypted sent by the computing device for the ciphertext to be computed.

[0131] It should be noted that the computing device sends the calculated data to be decrypted to the data processing device, and the data processing device receives the data to be decrypted.

[0132] See also Figure 8a Step 103 is followed by step 106; that is, after the data processing device decrypts the data to be decrypted based on the first plaintext data and the second plaintext data to obtain the target plaintext data, the data processing method further includes step 106, which will be explained below.

[0133] Step 106: Adjust the model parameters of the model to be trained based on the target plaintext data to obtain the target prediction model.

[0134] In this application, the data to be calculated can be the result of gradient calculation, that is, the data to be calculated can be a gradient; thus, before the data processing device simplifies the original decryption index based on the first key prime number to obtain the first decryption index, the data processing method further includes: the data processing device performs gradient calculation based on the prediction result of the model to be trained and the label data to obtain the data to be calculated.

[0135] It should be noted that the model to be trained is a neural network model to be trained for information prediction; the target prediction model is a pre-trained model to be trained, used to predict the information to be predicted, such as prediction of delivery accuracy, prediction based on affinity, etc. The ciphertext to be computed is the encrypted result of the data to be computed.

[0136] For example, participate Figure 8b , Figure 8b An interactive diagram of an exemplary decryption application provided in this application embodiment; such as Figure 8b As shown, the interaction diagram of this exemplary decryption application includes steps 801 to 809, and each step is described below.

[0137] Step 801: The data processing device performs gradient calculation based on the prediction results of the model to be trained and the label data to obtain the data to be calculated.

[0138] It should be noted that the process of obtaining the data to be calculated described in step 801 is similar to the process of obtaining the data to be calculated described above, and will not be described again in this embodiment of the application.

[0139] Step 802: The data processing device performs homomorphic encryption on the data to be calculated to obtain the ciphertext to be calculated.

[0140] It should be noted that the process of obtaining the ciphertext to be calculated described in step 802 is similar to the process of obtaining the ciphertext to be calculated described above, and will not be repeated here in the embodiments of this application.

[0141] Step 803: The data processing device sends the encrypted text to be calculated to the computing device.

[0142] Step 804: The computing device performs data calculations on the ciphertext to be calculated to obtain the data to be decrypted.

[0143] Step 805: The computing device sends the data to be decrypted to the data processing device.

[0144] Step 806: The data processing device simplifies the original decryption index based on the first key prime number to obtain the first decryption index, and simplifies the original decryption index based on the second key prime number to obtain the second decryption index.

[0145] Step 807: The data processing device decrypts the data to be decrypted based on the first decryption index to obtain the first plaintext data.

[0146] Step 808: The data processing device combines the first plaintext data and the second plaintext data to decrypt the data to be decrypted, thereby obtaining the target plaintext data.

[0147] It should be noted that the processes described in steps 806 to 808 are similar to those described in steps 101 to 103, and this application embodiment does not limit them.

[0148] Step 809: The data processing device adjusts the model parameters of the model to be trained based on the target plaintext data to obtain the target prediction model.

[0149] It should be noted that the process described in step 809 is similar to the process described in step 106, and this application embodiment does not limit it.

[0150] It is understandable that in federated learning model training scenarios, using the data processing method provided in the embodiments of this application to decrypt the data to be decrypted can quickly decrypt the target plaintext data; thereby improving the training efficiency of the model when training the model based on the target plaintext data.

[0151] The following describes an exemplary application of the embodiments of this application in a practical application scenario. This exemplary application describes the process of improving the decryption efficiency of the Paillier encryption and decryption algorithm.

[0152] It should be noted that the Paillier encryption and decryption algorithm is a probabilistic public-key encryption algorithm based on the Decisional Composite Residuos Assumption (DCRA) problem. It is a homomorphic encryption used to implement homomorphic addition and scalar multiplication, and can be applied in various fields such as encrypted signal processing, third-party data processing, and federated learning. Specifically, if there exists a number... Therefore, it conforms to the formula z≡y a (moda 2 The number z of y is called the modulus of y. 2 The problem of finding the modulus a of a composite number is called the problem of finding the modulus a of a composite number. 2 The question is whether an a-order residue exists; here, This represents the data space, and mod indicates modulo operations.

[0153] The Paiilier encryption and decryption algorithm is based on number theory and can complete steps such as key pair generation, public key encryption, private key decryption, and ciphertext computation (referred to as data computation on the ciphertext to be computed). Based on mathematical derivation, it can guarantee the security and correctness of the algorithm. The steps involved in the Paiilier encryption and decryption algorithm are explained below.

[0154] First, key pair generation. The key pair generation steps are as follows.

[0155] The first step is to randomly select two independent prime numbers p (called the second key prime number) and q (called the first key prime number) that are greater than the threshold, and satisfy gcd(pq,(p-1)(q-1))=1, where gcd() represents the process of calculating the greatest common divisor.

[0156] The second step is to calculate n (called the modulus exponent), where n = pq and λ = lcm(p-1, q-1), where lcm() represents the process of calculating the least common multiple and λ is called the target greatest common multiple.

[0157] The third step is to randomly select an integer g (called the first encryption factor), where, g = n + 1.

[0158] Fourth step, calculate μ, where μ = (L(g) λ mod n 2 )) -1 ,

[0159] Thus, a key pair consisting of public key pk = (n, g) and private key sk = (λ, μ) can be obtained.

[0160] Second, public key encryption. The steps for public key encryption are as follows.

[0161] For plaintext m (referred to as the data to be calculated), a random number r is selected, and the plaintext m is encrypted based on the public key pk to obtain ciphertext c (referred to as the ciphertext to be calculated), as shown in formula (3); where 0≤|m|≤|n|, |m| represents the bit length of the plaintext, |n| represents the bit length of n, 0≤r≤n, Formula (3) is shown below.

[0162]

[0163] Where E() represents Pailier encryption processing, and Represents different dimensional spaces.

[0164] Then, the private key is used for decryption.

[0165]

[0166] Where D() represents Pailier decryption processing.

[0167] Next, ciphertext computation occurs. This includes homomorphic addition and homomorphic scalar multiplication. Homomorphic encryption refers to calculating the homomorphic addition result for ciphertext c1 and ciphertext c2, obtaining ciphertext c3 = c1·c2 mod n. 2 Then m3 = D(c3) = m1 + m2, where m1 is the plaintext of ciphertext c1, m2 is the plaintext of ciphertext c2, and m3 is the plaintext of ciphertext c3. Homomorphic scalar multiplication refers to calculating the homomorphic scalar multiplication result of ciphertext c1 and scalar β to obtain the ciphertext. Then m4 = D(c4) = βm1, where m4 is the plaintext of ciphertext c4.

[0168] The following explains the security and correctness of the Pailier encryption and decryption algorithm.

[0169] Since k1 = (p-1)|λ and k2 = (q-1)|λ, then λ = k1·(p-1) = k2·(q-1); therefore, based on Fermat's Little Theorem, we can obtain... Similarly, we can obtain Therefore, g can be obtained λ ≡1(mod pq)=1(mod n); therefore g λ =1+k3n, Therefore, g can be obtained λ (mod n 2 )=1+k4n≡1(mod pq)=1(mod n), That is, g λ (mod n 2 )=n·k g +1,k g <n, so L(g λ (mod n 2 ))=k g According to the binomial theorem, as shown in formula (5).

[0170]

[0171] Thus, as shown in formula (6).

[0172]

[0173] To improve the efficiency of Paillier encryption and decryption, the product of two prime numbers of fixed bit length can be determined as α during the key generation stage. And Paillier encryption is shown in formula (7).

[0174]

[0175] Here, E1() represents Paillier encryption.

[0176] Accordingly, Paillier decryption is shown in formula (8).

[0177]

[0178] Here, D1() represents Paillier decryption processing.

[0179] In addition, the Paillier encryption and decryption efficiency can be improved by simplifying the residual system. In this case, the Paillier encryption is as shown in formula (9).

[0180]

[0181] Here, E2() represents Paillier encryption, and h (called the second encryption factor) is a random number selected from the data space where g is located.

[0182] Accordingly, Paillier decryption is shown in formula (10).

[0183]

[0184] Here, D2() represents Paillier decryption processing.

[0185] In this embodiment, decryption efficiency can be improved by reducing α (called the original decryption index). The corresponding decryption process is described below.

[0186] First, simplify α based on q to obtain α p (referred to as the first decryption key), as shown in formula (11).

[0187] α p =α / gcd(α, q-1) (11);

[0188] Here, q-1 is called the first coprime quantity, and gcd(α, q-1) is called the first greatest common divisor.

[0189] Simplifying α based on p, we get α q (referred to as the second decryption index), as shown in formula (12).

[0190] α q =α / gcd(α, p-1)(12);

[0191] Among them, p-1 is called the second coprime quantity, and gcd(α, p-1) is called the second greatest common divisor.

[0192] Based on the congruence theorem, we obtain the relationship with α. p The corresponding h p (referred to as the first equivalent parameter), as shown in formula (13); and obtain the result with α q The corresponding h q (referred to as the second equivalent parameter), as shown in formula (14).

[0193]

[0194]

[0195] in, This is called the second index result. This is called the second modulus exponent result; This is called the fourth index result. This is called the fourth modulus index result.

[0196] Next, obtain the ciphertext c based on α. p and h p The decryption result m p (referred to as the first plaintext data), as shown in formula (15); and the ciphertext c is obtained based on α. q The corresponding h p The decryption result m q (referred to as the second plaintext data), as shown in formula (16).

[0197]

[0198]

[0199] in, This is called the first index result. This is called the first modulus exponent result; This is called the second index result. This is called the second modulus index result.

[0200] Based on the Remainder Theorem, Paillier's decryption is shown in Equation (17).

[0201]

[0202] Among them, p·p -1 ≡1 mod q, CRT() represents the general term of the Remainder Theorem (called the Remainder General Term).

[0203] The following describes the efficiency improvement of the Paillier encryption / decryption algorithm provided in the embodiments of this application.

[0204] See Figure 9 , Figure 9This is a decryption comparison diagram provided in the embodiments of this application; as shown Figure 9 As shown, when testing the decryption efficiency improvement based on 10 million data points, in order to reduce the impact of parallelization, in a single-threaded environment, the average decryption time of the decryption algorithm 9-1 provided in this application based on formula (17) for batch decryption is 0.131000, while the average decryption time of the baseline decryption algorithm 9-2 based on formula (10) for batch decryption is 0.315000. The average decryption time based on formula (17) is 1 / 3 of the average decryption time based on formula (10).

[0205] See Figure 10 , Figure 10 This is a schematic diagram illustrating the encryption / decryption comparison provided in an embodiment of this application; as shown below. Figure 10 As shown, when the encryption and decryption efficiency improvement tests were conducted based on 10 million, 1 million, and 100,000 data points respectively, in a single-threaded environment, the average encryption and decryption time of the encryption and decryption algorithm 10-1 provided in this application embodiment based on formulas (9) and (17) for batch encryption and decryption was less than the average encryption and decryption time of the baseline encryption and decryption algorithm 10-2 based on formulas (9) and (10) for batch encryption and decryption; and, under tests with different data scales (10 million, 1 million, and 100,000), the average efficiency was improved by 20%.

[0206] Furthermore, when the encryption and decryption algorithm provided in this application is applied to data samples in the financial field, the performance can be improved by 2 times compared to using the baseline encryption and decryption algorithm, as shown in Table 1.

[0207] Table 1

[0208]

[0209] The following describes the application of Paillier decryption provided in the embodiments of this application in the field of federated learning.

[0210] See Figure 11 , Figure 11 This is an exemplary encryption / decryption application diagram provided in an embodiment of this application; as shown... Figure 11As shown, during the process of training the prediction model through federated learning, the data 11-11 of the first party 11-1 and the data 11-21 of the second party 11-2 are aligned. Then, the first party 11-1 trains the model based on the alignment result to obtain gradient 11-12, and the second party 11-2 trains the model based on the alignment result to obtain gradient 11-22. Here, the first party 11-1 and the second party 11-2 implement homomorphic encryption operations on gradients 11-12 and 11-22 based on the Paillier encryption and decryption algorithm (i.e., formula (9) and formula (17)) provided in the embodiments of this application to achieve gradient exchange. Finally, the model parameters are adjusted based on the decrypted calculation results to achieve prediction for different tasks. Prediction tasks 11-13 and 11-14 of the first party 11-1 and prediction tasks 11-23 and 11-24 of the second party 11-2 are shown exemplarily. In this process, both the first party 11-1 and the second party 11-2 use formulas (11) to (17) to decrypt the encryption result of gradient exchange, so that the first party 11-1 trains its own model based on its own decryption result, and the second party 11-2 trains its own model based on its own decryption result.

[0211] Understandably, due to α p and α q Replacing α with the power calculation reduces the computational load of the decryption process, thereby improving decryption efficiency. Furthermore, when the Paillier decryption algorithm provided in this application's embodiments is used for model training in federated learning, it can improve model training efficiency.

[0212] The following description continues to illustrate the exemplary structure of the data processing apparatus 455 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2 As shown, the software modules stored in the data processing device 455 of the memory 450 may include:

[0213] The index simplification module 4551 is used to simplify the original decryption index based on the first key prime number to obtain the first decryption index, and to simplify the original decryption index based on the second key prime number to obtain the second decryption index. The first key prime number and the second key prime number are used to determine the modulus space of encryption and decryption, and the original decryption index refers to the initial index during decryption.

[0214] The data decryption module 4552 is used to decrypt the data to be decrypted based on the first decryption index to obtain first plaintext data, and to decrypt the data to be decrypted based on the second decryption index to obtain second plaintext data, wherein the data to be decrypted is the result obtained by the computing device from the data calculation of the ciphertext to be calculated;

[0215] The data decryption module 4552 is further configured to combine the first plaintext data and the second plaintext data to decrypt the data to be decrypted, thereby obtaining the target plaintext data.

[0216] In this embodiment of the application, the index simplification module 4551 is further configured to obtain the first coprime number corresponding to the first key prime number; obtain the first greatest common divisor between the original decryption index and the first coprime number; and determine the ratio of the original decryption index to the first greatest common divisor as the first decryption index, wherein the ratio of the original decryption index to the first greatest common divisor is used to simplify the original decryption index.

[0217] In this embodiment of the application, the data decryption module 4552 is further configured to calculate the first exponent result of the data to be decrypted using the first decryption exponent as the exponent; obtain the first modulo exponent result corresponding to the first exponent result and the second key prime number; obtain the first equivalent parameter corresponding to the first decryption exponent; and perform decryption calculation by combining the first modulo exponent result, the first equivalent parameter, and the second key prime number to obtain the first plaintext data.

[0218] In this embodiment of the application, the data decryption module 4552 is further configured to calculate a second exponential result of the first encryption factor using the first decryption exponent as the exponent, wherein the first encryption factor is used to encrypt the ciphertext to be calculated; obtain a second modulo exponential result corresponding to the second exponential result and the second key prime number; and determine the modulo result of the second modulo exponential result with respect to the second key prime number as the first equivalent parameter.

[0219] In this embodiment of the application, the index simplification module 4551 is further configured to obtain the second coprime number corresponding to the second key prime number; obtain the second greatest common divisor between the original decryption index and the second coprime number; and determine the ratio of the original decryption index to the second greatest common divisor as the second decryption index, wherein the ratio of the original decryption index to the second greatest common divisor is used to simplify the original decryption index.

[0220] In this embodiment of the application, the data decryption module 4552 is further configured to combine the first plaintext data, the second plaintext data, the first modulo processing of the first key prime number, and the second modulo processing of the second key prime number to obtain the remaining general term; determine the replacement modulo processing of the second modulo processing based on the relationship between the second modulo processing and the first modulo processing; replace the second modulo processing in the remaining general term based on the replacement modulo processing to obtain the item to be decrypted; and calculate the item to be decrypted to obtain the target plaintext data.

[0221] In this embodiment of the application, the data processing device 455 further includes an exponent acquisition module 4553, which is used to determine a first decryption prime number and a second decryption prime number based on a specified number of bits; and to determine the product of the first decryption prime number and the second decryption prime number as the original decryption exponent, wherein the original decryption exponent is less than a target greatest common multiple, and the target greatest common multiple refers to the greatest common multiple corresponding to the first coprime number and the second coprime number.

[0222] In this embodiment of the application, the data processing device 455 further includes a data encryption module 4554, which is used to obtain the first key prime number and the second key prime number for the data to be calculated; determine the modulus exponent based on the product of the first key prime number and the second key prime number; determine the first encryption factor and the second encryption factor based on the modulus exponent; and perform homomorphic encryption on the data to be calculated based on the first encryption factor and the second encryption factor to obtain the ciphertext to be calculated.

[0223] In this embodiment of the application, the data processing device 455 further includes a data acquisition module 4555, which is used to send the ciphertext to be calculated to the computing device, wherein the computing device is used to perform data calculation on the ciphertext to be calculated, the data calculation including at least one of homomorphic addition and homomorphic scalar multiplication; and to receive the data to be decrypted sent by the computing device for the ciphertext to be calculated.

[0224] In this embodiment of the application, the data processing device 455 further includes a model training module 4556, which is used to perform gradient calculation based on the prediction results of the model to be trained and the label data to obtain the data to be calculated, wherein the model to be trained is a neural network model to be trained for information prediction; and is also used to adjust the model parameters of the model to be trained based on the target plaintext data to obtain a target prediction model, wherein the target prediction model is used to predict the information to be predicted.

[0225] In this embodiment, homomorphic encryption and decryption are encryption and decryption algorithms based on the compound residue class problem.

[0226] This application provides a computer program product, which includes computer-executable instructions or a computer program stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions or computer program from the computer-readable storage medium and executes the computer-executable instructions or computer program, causing the electronic device to perform the data processing method described in this application.

[0227] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the data processing method provided in this application. For example, ... Figure 3 The data processing method is shown.

[0228] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0229] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0230] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0231] As an example, computer-executable instructions can be deployed to execute on a single electronic device (in which case, this single electronic device is a data processing device), or to execute on multiple electronic devices located at one location (in which case, the multiple electronic devices located at one location are data processing devices), or to execute on multiple electronic devices distributed across multiple locations and interconnected via a communication network (in which case, the multiple electronic devices distributed across multiple locations and interconnected via a communication network are data processing devices).

[0232] It is understood that in the embodiments of this application, data such as data to be encrypted is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0233] In summary, the embodiments of this application simplify the original decryption exponent by using the first key prime number and the second key prime number respectively, so that the simplified first decryption exponent and the second decryption exponent are both smaller than the original decryption exponent. Therefore, the data to be decrypted is decrypted by using the first decryption exponent and the second decryption exponent respectively, and then the decrypted first plaintext data and the second plaintext data are combined to achieve decryption of the data to be decrypted. This can reduce the amount of exponent calculation in the decryption process, thereby reducing the decryption time, improving decryption efficiency, and further improving data processing efficiency and model training efficiency.

[0234] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A data processing method, characterized in that, The method includes: Obtain the first coprime number corresponding to the first key prime number; obtain the first greatest common divisor between the original decryption exponent and the first coprime number; determine the ratio of the original decryption exponent to the first greatest common divisor as the first decryption exponent; Obtain the second coprime number corresponding to the second key prime number; obtain the second greatest common divisor between the original decryption exponent and the second coprime number; determine the ratio of the original decryption exponent to the second greatest common divisor as the second decryption exponent, wherein the first key prime number and the second key prime number are used to determine the modulus space of encryption and decryption, and the original decryption exponent refers to the initial exponent during decryption; The process involves: calculating a first exponent result of the data to be decrypted using the first decryption exponent; obtaining a first modulo exponent result corresponding to the first exponent result and the second key prime number, wherein the first modulo exponent result is the result of the first exponent result modulo the square of the second key prime number; calculating a second exponent result of the first encryption factor using the first decryption exponent; obtaining a second modulo exponent result corresponding to the second key prime number; determining the modulo result of the second modulo exponent result modulo the second key prime number as a first equivalent parameter; and performing decryption calculations by combining the first modulo exponent result, the first equivalent parameter, and the second key prime number to obtain the first plaintext data. The process involves: calculating a third exponent result of the data to be decrypted using the second decryption exponent; obtaining a third modulo exponent result corresponding to the third exponent result and the first key prime number, wherein the third modulo exponent result is the result of the third exponent result modulo the square of the first key prime number; calculating a fourth exponent result of the first encryption factor using the second decryption exponent; obtaining a fourth modulo exponent result corresponding to the first key prime number; determining the modulo result of the fourth modulo exponent result modulo the first key prime number as a second equivalent parameter; and performing decryption calculations by combining the third modulo exponent result, the second equivalent parameter, and the first key prime number to obtain second plaintext data, wherein the data to be decrypted is the result obtained by the computing device from data calculations on the ciphertext to be calculated. Combine the first plaintext data, the second plaintext data, the first modulo operation on the first key prime number, and the second modulo operation on the second key prime number to obtain the remaining general term; based on the fact that the sum of the representation of the first modulo operation and the representation of the second modulo operation is 1, determine the replacement modulo operation of the second modulo operation; based on the replacement modulo operation, replace the second modulo operation in the remaining general term to obtain the item to be decrypted; perform calculations on the item to be decrypted to obtain the target plaintext data.

2. The method according to claim 1, characterized in that, The first encryption factor is used to encrypt the ciphertext to be calculated.

3. The method according to claim 1, characterized in that, Before obtaining the number of coprime numbers corresponding to the first key prime number, the method further includes: Determine the first and second decrypted prime numbers based on a specified number of bits. The product of the first decrypted prime number and the second decrypted prime number is determined as the original decryption index, wherein the original decryption index is less than the target greatest common multiple, and the target greatest common multiple refers to the greatest common multiple corresponding to the first coprime number and the second coprime number.

4. The method according to claim 1, characterized in that, Before obtaining the number of coprime numbers corresponding to the first key prime number, the method further includes: For the data to be calculated, obtain the first key prime number and the second key prime number; The modulus exponent is determined based on the product of the first key prime number and the second key prime number; Based on the modulus index, the first encryption factor and the second encryption factor are determined; Based on the first encryption factor and the second encryption factor, the data to be calculated is homomorphically encrypted to obtain the ciphertext to be calculated.

5. The method according to claim 1, characterized in that, Before obtaining the number of coprime numbers corresponding to the first key prime number, the method further includes: The ciphertext to be computed is sent to the computing device, wherein the computing device is used to perform data computation on the ciphertext to be computed, and the data computation includes at least one of homomorphic addition and homomorphic scalar multiplication. Receive the data to be decrypted sent by the computing device in relation to the ciphertext to be computed.

6. The method according to claim 1, characterized in that, Before obtaining the number of coprime numbers corresponding to the first key prime number, the method further includes: Gradient calculation is performed based on the prediction results of the model to be trained and the label data to obtain the data to be calculated. The model to be trained is a neural network model to be trained for information prediction. After calculating the item to be decrypted to obtain the target plaintext data, the method further includes: The model parameters of the model to be trained are adjusted based on the target plaintext data to obtain the target prediction model, wherein the target prediction model is used to predict the information to be predicted.

7. The method according to claim 1, characterized in that, The decryption is based on a homomorphic encryption / decryption algorithm for the compound residue class problem.

8. A data processing apparatus, characterized in that, The data processing device includes: An exponent simplification module is used to obtain the first coprime number corresponding to the first key prime number; obtain the first greatest common divisor between the original decryption exponent and the first coprime number; determine the ratio of the original decryption exponent to the first greatest common divisor as the first decryption exponent; obtain the second coprime number corresponding to the second key prime number; obtain the second greatest common divisor between the original decryption exponent and the second coprime number; determine the ratio of the original decryption exponent to the second greatest common divisor as the second decryption exponent, wherein the first key prime number and the second key prime number are used to determine the modulus space for encryption and decryption, and the original decryption exponent refers to the initial exponent during decryption; The data decryption module is used to calculate a first exponential result of the data to be decrypted using the first decryption exponent as the exponent; obtain a first modulo exponent result corresponding to the first exponent result and the second key prime number, wherein the first modulo exponent result is the result of the first exponent result modulo the square of the second key prime number; calculate a second exponent result of the first encryption factor using the first decryption exponent as the exponent; obtain a second modulo exponent result corresponding to the second key prime number; determine the modulo result of the second modulo exponent result modulo the second key prime number as a first equivalent parameter; and perform decryption calculation by combining the first modulo exponent result, the first equivalent parameter, and the second key prime number to obtain the first plaintext data, and calculate using the second decryption exponent as the exponent. The third exponent result of the data to be decrypted; obtaining the third modulo exponent result corresponding to the third exponent result and the first key prime number, wherein the third modulo exponent result is the result of the third exponent result modulo the square of the first key prime number; calculating the fourth exponent result of the first encryption factor using the second decryption exponent as the exponent; obtaining the fourth modulo exponent result corresponding to the first key prime number; determining the modulo result of the fourth modulo exponent result modulo the first key prime number as the second equivalent parameter; performing decryption calculation by combining the third modulo exponent result, the second equivalent parameter, and the first key prime number to obtain the second plaintext data, wherein the data to be decrypted is the result obtained by the computing device from the data calculation of the ciphertext to be calculated; The data decryption module is further configured to combine the first plaintext data, the second plaintext data, the first modulo processing of the first key prime number, and the second modulo processing of the second key prime number to obtain the remaining general term; determine the replacement modulo processing of the second modulo processing based on the sum of the representation of the first modulo processing and the representation of the second modulo processing being 1; replace the second modulo processing in the remaining general term based on the replacement modulo processing to obtain the item to be decrypted; and calculate the item to be decrypted to obtain the target plaintext data.

9. The apparatus according to claim 8, characterized in that, The first encryption factor is used to encrypt the ciphertext to be calculated.

10. The apparatus according to claim 8, characterized in that, The data processing device further includes: The index acquisition module is used to determine the first decryption prime and the second decryption prime based on a specified number of bits; the product of the first decryption prime and the second decryption prime is determined as the original decryption index, wherein the original decryption index is less than the target greatest common multiple, and the target greatest common multiple refers to the greatest common multiple corresponding to the first coprime quantity and the second coprime quantity.

11. The apparatus according to claim 8, characterized in that, The data processing device further includes: The data encryption module is used to obtain the first key prime number and the second key prime number for the data to be calculated; determine the modulus exponent based on the product of the first key prime number and the second key prime number; determine the first encryption factor and the second encryption factor based on the modulus exponent; and perform homomorphic encryption on the data to be calculated based on the first encryption factor and the second encryption factor to obtain the ciphertext to be calculated.

12. The apparatus according to claim 8, characterized in that, The data processing device further includes: The data acquisition module is used to send the ciphertext to be calculated to the computing device, wherein the computing device is used to perform data calculation on the ciphertext to be calculated, the data calculation including at least one of homomorphic addition and homomorphic scalar multiplication; and to receive the data to be decrypted sent by the computing device for the ciphertext to be calculated.

13. The apparatus according to claim 8, characterized in that, The data processing device further includes: The model training module is used to perform gradient calculation based on the prediction results and label data of the model to be trained to obtain the data to be calculated, wherein the model to be trained is a neural network model to be trained for information prediction; it is also used to adjust the model parameters of the model to be trained based on the target plaintext data to obtain a target prediction model, wherein the target prediction model is used to predict the information to be predicted.

14. An electronic device for data processing, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the data processing method according to any one of claims 1 to 7.

15. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, the data processing method according to any one of claims 1 to 7 is implemented.

16. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, the data processing method according to any one of claims 1 to 7 is implemented.