CN111404943A - Data processing method and device, electronic equipment and computer readable storage medium - Google Patents

Data processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN111404943A
CN111404943A CN202010192637.0A CN202010192637A CN111404943A CN 111404943 A CN111404943 A CN 111404943A CN 202010192637 A CN202010192637 A CN 202010192637A CN 111404943 A CN111404943 A CN 111404943A
Authority
CN
China
Prior art keywords
data
ciphertext
affine
key
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010192637.0A
Other languages
Chinese (zh)
Other versions
CN111404943B (en
Inventor
刘洋
张�雄
秦姝琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010192637.0A priority Critical patent/CN111404943B/en
Publication of CN111404943A publication Critical patent/CN111404943A/en
Application granted granted Critical
Publication of CN111404943B publication Critical patent/CN111404943B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/008Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols involving homomorphic encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

The application provides a data processing method and device, electronic equipment and a computer readable storage medium, and relates to the field of internet. The method comprises the following steps: for original data to be encrypted, encrypting the original data by the terminal by adopting a secret key of an affine password after the homogenization treatment to obtain ciphertext data; sending a service request containing the ciphertext data to a server to obtain a ciphertext processing result of the server after the ciphertext data is processed; and receiving the ciphertext processing result, and decrypting the ciphertext processing result by adopting the key to obtain decrypted data. Compared with the traditional homomorphic operation of affine passwords, the operation efficiency of the homomorphic operation of the affine passwords is greatly improved, and the safety is greatly enhanced.

Description

Data processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a data processing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
Nowadays, the internet has completed the transition from the IT era to the DT era, and data has become the core competitiveness of DT era enterprises. And the data can only generate value when flowing as a new energy source. However, most enterprises are very careful about data sharing in consideration of data security and personal privacy. In real life, we often suffer from the following problems:
1) hospitals need to share medical information, but do not want to reveal the privacy of individual patients;
2) government agencies need to count election data, but do not want to disclose election records of voters;
3) one manufacturer would like to check product levels on an industry standard, but would not want competitors to know their actual production data.
Aiming at the phenomenon of data island, a solution is provided for Secure multi-party computing (Secure Muti-part computing) based on cloud technology, and great contribution is made to controllable sharing of data.
In the field of secure multiparty computing, homomorphic encryption techniques include partial homomorphism. Partial homomorphism is only homomorphism under certain operators, such as addition and multiplication. Cryptographic systems that satisfy partial homomorphism can be divided into two types according to their key types:
1) asymmetric partially homomorphic cryptosystems: the key of the cryptosystem is divided into a public key and a private key, wherein the public key is used for encryption, and the private key is used for decryption. Partial homomorphism of the asymmetric type is widely applied, such as RSA and Paillier.
2) Symmetric partially homomorphic cryptosystems: the cryptographic system has only one key, and the key owner can encrypt and decrypt the key. The application of partial homologies of the symmetric type is relatively narrow, such as affine cryptography.
The two systems respectively have the following defects:
1) asymmetric type: the security is higher, but compared with the symmetric cipher, the asymmetric cipher has higher computational complexity and lower computational efficiency.
2) Symmetrical type: the principle is simple, the calculation complexity is low, but the safety is low. For example, affine cryptography, if it is known that the key n has a length of l bits, then n has a length of 2l-1A possible value ofThere are phi (n) possible values and b has approximately n-1 possible values, so the available key (a, b, n) has a total of 2l-1(n-1)φ(n)≤2l-1(n-1)2≤2l-1(2l-1)2And (4) respectively. That is, when the key length l is fixed, the key space size is limited to 2l-1(2l-1)2Therefore, when an affine ciphertext which is homomorphic operated is decrypted, the homomorphic operated times need to be provided, and after others know the homomorphic operated times, the affine ciphertext can be decrypted, so that the privacy of a user is leaked.
Disclosure of Invention
The application provides a data processing method and device, electronic equipment and a computer readable storage medium, which can solve the problems of low homomorphic operation efficiency and poor safety of the conventional affine password. The technical scheme is as follows:
in a first aspect, a method for processing data is provided, and the method includes:
for original data to be encrypted, encrypting the original data by the terminal by adopting a secret key of an affine password after the homogenization treatment to obtain ciphertext data;
sending a service request containing the ciphertext data to a server to obtain a ciphertext processing result of the server after the ciphertext data is processed;
and the terminal receives the ciphertext processing result and decrypts the ciphertext processing result by adopting the key to obtain decrypted data.
Preferably, the mode of the homogenization treatment comprises the following steps:
setting the parameter value of the displacement size in the original key of the affine password as 0, and setting the number of letters in the original key and the co-prime parameter a of the n as m-dimensional vectors to obtain m groups of keys (a)i,ni) (ii) a Wherein, aiIs the ith component of a, niIs the ith component of n, 0<i≤m,
Figure BDA0002416458170000021
n1<…<nmAnd i, m and n are positive integers.
Preferably, the step of encrypting the original data by the terminal using the secret key of the affine password after the homogeneous processing to obtain the ciphertext data includes:
calculating by adopting a preset affine encryption algorithm based on the ith group of keys to obtain first ciphertext data corresponding to the ith group of keys; wherein the ith group key is (a)i,ni),0<i≤m;
Calculating to obtain second ciphertext data corresponding to the (i + 1) th group key based on the first ciphertext data, the (i + 1) th group key and the affine encryption algorithm;
and taking the second ciphertext data as current first ciphertext data, and repeatedly executing the step of calculating to obtain second ciphertext data corresponding to the i +1 group key based on the first ciphertext data, the i +1 group key and the affine encryption algorithm until the current second ciphertext data is taken as final ciphertext data when i +1 is m.
Preferably, the step of decrypting the ciphertext processing result by using the key to obtain decrypted data includes:
calculating by adopting a preset affine decryption algorithm based on the ith group key to obtain first decryption data corresponding to the ith group key; wherein the ith group key is (a)i,ni),0<i≤m;
Calculating to obtain second decryption data corresponding to the i-1 group key based on the first decryption data, the i-1 group key and the affine decryption algorithm;
and taking the second decrypted data as current first decrypted data, and repeatedly executing the step of calculating and obtaining second decrypted data corresponding to the i-1 group key based on the first decrypted data, the i-1 group key and the affine decryption algorithm until the current second decrypted data is taken as final decrypted data when i-1 is equal to 1.
Preferably, the service request further includes a data processing mode;
the sending the service request containing the ciphertext data to a server to obtain a ciphertext processing result of the server after the ciphertext data is processed comprises:
and sending the service request to the server so that the server performs secure multi-party calculation on the ciphertext data in the data processing mode to obtain the ciphertext processing result.
Preferably, the decrypted data is the same as target data obtained by performing the secure multiparty computation on the original data;
the target data obtained by performing the secure multiparty computation on the raw data comprises:
and calculating the original data by adopting the data processing mode to obtain the target data.
In a second aspect, an apparatus for processing data is provided, the apparatus comprising:
the encryption module is used for encrypting the original data to be encrypted by adopting a secret key of the affine password after the homogeneous processing to obtain ciphertext data;
the sending module is used for sending the service request containing the ciphertext data to a server to obtain a ciphertext processing result of the server after the ciphertext data is processed;
the receiving module is used for receiving the ciphertext processing result;
and the decryption module is used for decrypting the ciphertext processing result by adopting the secret key to obtain decrypted data.
Preferably, the mode of the homogenization treatment comprises the following steps:
setting the parameter value of the displacement size in the original key of the affine password as 0, and setting the number of letters in the original key and the co-prime parameter a of the n as m-dimensional vectors to obtain m groups of keys (a)i,ni) (ii) a Wherein, aiIs the ith component of a, niIs the ith component of n, 0<i≤m,
Figure BDA0002416458170000041
n1<…<nmAnd i, m and n are positive integers.
Preferably, the encryption module includes:
the first calculation submodule is used for calculating to obtain first ciphertext data corresponding to the ith group of keys by adopting a preset affine encryption algorithm based on the ith group of keys; wherein the ith group key is (a)i,ni),0<i≤m;
The second calculation submodule is used for calculating to obtain second ciphertext data corresponding to the (i + 1) th group of keys based on the first ciphertext data, the (i + 1) th group of keys and the affine encryption algorithm;
and taking the second ciphertext data as current first ciphertext data, and repeatedly calling the first calculating submodule and the second calculating submodule until the current second ciphertext data is taken as final ciphertext data when i +1 is m.
Preferably, the decryption module comprises:
the first decryption submodule is used for calculating to obtain first decryption data corresponding to the ith group of keys by adopting a preset affine decryption algorithm based on the ith group of keys; wherein the ith group key is (a)i,ni),0<i≤m;
The second decryption submodule is used for calculating second decryption data corresponding to the i-1 group key based on the first decryption data, the i-1 group key and the affine decryption algorithm;
and taking the second decrypted data as current first decrypted data, and repeatedly calling the first decryption sub-module and the second decryption sub-module until the current second decrypted data is taken as final decrypted data when i-1 is equal to 1.
Preferably, the service request further includes a data processing mode;
the sending the service request containing the ciphertext data to a server to obtain a ciphertext processing result of the server after the ciphertext data is processed comprises:
and sending the service request to the server so that the server performs secure multi-party calculation on the ciphertext data in the data processing mode to obtain the ciphertext processing result.
Preferably, the decrypted data is the same as target data obtained by performing the secure multiparty computation on the original data;
the target data obtained by performing the secure multiparty computation on the raw data comprises:
and calculating the original data by adopting the data processing mode to obtain the target data.
In a third aspect, an electronic device is provided, which includes:
a processor, a memory, and a bus;
the bus is used for connecting the processor and the memory;
the memory is used for storing operation instructions;
the processor is configured to call the operation instruction, and the executable instruction enables the processor to execute an operation corresponding to the data processing method shown in the first aspect of the present application.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the method for processing data shown in the first aspect of the present application.
The beneficial effect that technical scheme that this application provided brought is:
the method comprises the steps that for original data to be encrypted, a terminal encrypts the original data by adopting a secret key of an affine password after homogenization processing to obtain ciphertext data, then a service request containing the ciphertext data is sent to a server to obtain a ciphertext processing result of the server after the ciphertext data is processed, and when the ciphertext processing result is received, the secret key is adopted to conduct affine decryption on the ciphertext processing result to obtain decrypted data. Compared with the traditional affine cipher homomorphic operation, the method has the advantage that the operation efficiency is greatly improved due to the fact that the keys of the traditional affine cipher are subjected to the homogenization treatment. Moreover, because the keys of the traditional affine cipher are subjected to the homogenization treatment, the number of homomorphic operations is not required to be provided in the decryption process, and the safety is greatly enhanced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
FIG. 1 is a schematic diagram of an application environment of the present application;
fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data processing apparatus according to yet another embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device for processing data according to yet another embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The terms referred to in this application will first be introduced and explained:
cloud technology refers to a hosting technology for unifying serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data.
Cloud technology (Cloud technology) is based on a general term of network technology, information technology, integration technology, management platform technology, application technology and the like applied in a Cloud computing business model, can form a resource pool, is used as required, and is flexible and convenient. Cloud computing technology will become an important support. Background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture-like websites and more web portals. With the high development and application of the internet industry, each article may have its own identification mark and needs to be transmitted to a background system for logic processing, data in different levels are processed separately, and various industrial data need strong system background support and can only be realized through cloud computing.
Cloud computing (cloud computing) is a computing model that distributes computing tasks over a pool of resources formed by a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. The network that provides the resources is referred to as the "cloud". Resources in the "cloud" appear to the user as being infinitely expandable and available at any time, available on demand, expandable at any time, and paid for on-demand.
As a basic capability provider of cloud computing, a cloud computing resource pool (cloud platform for short) generally called as an Infrastructure as a Service (IaaS) platform is established, and multiple types of virtual resources are deployed in the resource pool and are selectively used by external clients. The cloud computing resource pool mainly comprises: computing devices (which are virtualized machines, including operating systems), storage devices, and network devices.
According to the logic function division, a PaaS (Platform as a Service) layer can be deployed on an IaaS (Infrastructure as a Service) layer, a SaaS (Software as a Service) layer is deployed on the PaaS layer, and the SaaS can be directly deployed on the IaaS. PaaS is a platform on which software runs, such as a database, a web container, etc. SaaS is a variety of business software, such as web portal, sms, and mass texting. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
Secure multi-party computing: is a secret x1,…,xKWhen the hand is held in a distributed manner (each data corresponds to one x)K) Safe solving of a global problem, or evaluating a global function f (x)1,…,xk) Is a sub-field of cryptography. For example, for the classical millionaire problem: how to compare more rich on the premise of not exposing respective wealth when two strong and good winning rich radicals Alice and Bob meet each other on the street? It can be solved by secure multiparty computing, which can be implemented based on cloud computing.
Homomorphic encryption: it is a property of some cryptosystems-a cryptosystem has homomorphism if ciphertext operations (e.g., addition, multiplication) in ciphertext space can be mapped to plaintext space. We use<k>Representing the ciphertext of plaintext k. For example, the well-known RSA cryptosystem is multiplicatively homomorphic, i.e., satisfies<k1k2>=<k1><2>. One of the core technologies for secure multiparty computation in homomorphic encryption.
Affine cipher is a symmetric cipher system, and its key is (a, b, n), in which n is number of letters and is positive integer, b is shift size, b ∈ ZnI.e. b is an integer between 1 and n-1;
Figure BDA0002416458170000081
i.e. a is an integer between 1 and n-1 and coprime to n. The encryption function is:
e (x) ═ (ax + b) modn formula (1)
The decryption function is:
D(y)=a-1(y-b) mod n equation (2)
Wherein, a-1Is the multiplicative modulo inverse of a with respect to n. Obviously, affine ciphers have additive homologies:
(E(x1;a,b,n)+E(x2;a,b,n))mod n=E(x1+x2;a,2b,n)
euler function:
Figure BDA0002416458170000082
represents the number of positive integers smaller than n and coprime to n. Obviously, when n is a prime number, φ (n) is n-1.
In the existing affine cipher, if the known key n has a length of l bits, then n has a length of 2l-1A possible value, a has phi (n) possible values, b has about n-1 possible values, so that the available key (a, b, n) has a total of 2l-1(n-1)φ(n)≤2l-1(n-1)2≤2l-1(2l-1)2And (4) respectively. According to the above analysis, when the key length l is fixed, the key space size is limited to 2l-1(2l-1)2. This presents a serious safety problem: when decrypting a homomorphic operated affine ciphertext, it is necessary to provide the homomorphic operated times k, for example, "2" in the right side "2 b" in the addition homomorphic formula, and after knowing k, others can decrypt the affine ciphertext, which causes the disclosure of user privacy.
In the field of secure multiparty computing, homomorphic encryption techniques include partial homomorphism. Partial homomorphism is only homomorphism under certain operators, such as addition and multiplication. Cryptographic systems that satisfy partial homomorphism can be divided into two types according to their key types:
1) asymmetric partially homomorphic cryptosystems: the key of the cryptosystem is divided into a public key and a private key, wherein the public key is used for encryption, and the private key is used for decryption. Partial homomorphism of the asymmetric type is widely applied, such as RSA and Paillier.
2) Symmetric partially homomorphic cryptosystems: the cryptographic system has only one key, and the key owner can encrypt and decrypt the key. The application of partial homologies of the symmetric type is relatively narrow, such as affine cryptography.
The application provides a data processing method, a data processing device, an electronic device and a computer-readable storage medium, which aim to solve the above technical problems in the prior art.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
An embodiment of the present invention provides an application environment for video playing, as shown in fig. 1, where the application environment includes: a server 101 and a terminal 102. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and a big data and artificial intelligence platform. The terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein. The terminal may have the following features:
(1) on a hardware architecture, a device has a central processing unit, a memory, an input unit and an output unit, that is, the device is often a microcomputer device having a communication function. In addition, various input modes such as a keyboard, a mouse, a touch screen, a microphone, a camera and the like can be provided, and input can be adjusted as required. Meanwhile, the equipment often has a plurality of output modes, such as a telephone receiver, a display screen and the like, and can be adjusted according to needs;
(2) on a software system, the device must have an operating system, such as Windows Mobile, Symbian, Palm, Android, iOS, and the like. Meanwhile, the operating systems are more and more open, and personalized application programs developed based on the open operating system platforms are infinite, such as a communication book, a schedule, a notebook, a calculator, various games and the like, so that the requirements of personalized users are met to a great extent;
(3) in terms of communication capacity, the device has flexible access mode and high-bandwidth communication performance, and can automatically adjust the selected communication mode according to the selected service and the environment, thereby being convenient for users to use. The device can support GSM (Global System for Mobile Communication), WCDMA (Wideband Code Division Multiple Access), CDMA2000(Code Division Multiple Access), TDSCDMA (Time Division-Synchronous Code Division Multiple Access), Wi-Fi (Wireless-Fidelity), WiMAX (world interoperability for Microwave Access), etc., thereby adapting to various systems of networks, not only supporting voice service, but also supporting various Wireless data services;
(4) in the aspect of function use, the equipment focuses more on humanization, individuation and multi-functionalization. With the development of computer technology, devices enter a human-centered mode from a device-centered mode, and the embedded computing, control technology, artificial intelligence technology, biometric authentication technology and the like are integrated, so that the human-oriented purpose is fully embodied. Due to the development of software technology, the equipment can be adjusted and set according to individual requirements, and is more personalized. Meanwhile, the device integrates a plurality of software and hardware, and the function is more and more powerful.
Further, the server may perform secure multi-party computations. Specifically, the server acquires encrypted ciphertext data and data processing modes corresponding to the ciphertext data from the terminals, performs corresponding processing on each ciphertext data in the corresponding data processing mode to obtain ciphertext processing results, sends the ciphertext processing results to the terminals respectively, and decrypts the ciphertext processing results to obtain processed plaintext data.
For example, in the above classic mega-rich problem, Alice encrypts the wealth value, sets the data processing mode to "value size comparison", then uploads the encrypted wealth data and the data processing mode to the server, Bob also encrypts the wealth value, sets the data processing mode to "value size comparison", then uploads the encrypted wealth data and the data processing mode to the server, after receiving ciphertext data of the two parties, the server performs "value size comparison" on the two ciphertext data to obtain comparison results (also ciphertext data), respectively sends the comparison results to the two parties, and after receiving the comparison results, the two parties decrypt to know which party has more money, and at this time, the two parties still do not know how much the specific wealth value of the other party is.
In practical applications, only one participant may need to perform multi-party security calculations.
For example, a is a social media company, which has socially relevant characteristic data of numerous people; b is a credit company that has records of default for a small portion of the population, and the acquisition of each default record represents a significant loss to B. Now, B wants to make default prediction for a plurality of people by means of the wide characteristic model of A, judges whether a new user violates the rules according to the prediction result, and makes subsequent decisions, so that the default rate of the user is reduced. Specifically, A encrypts social related feature data of each user, uploads ciphertext data to a server, B uploads a data processing method (whether the user is predicted to default) to the server, the server predicts the ciphertext data of each user by using a model to obtain prediction results of each ciphertext, then sends the prediction results of each user to B, B decrypts the prediction results to obtain prediction results of each plaintext, and then judges whether each user will default or not based on the prediction results of each plaintext.
A data processing method may be performed in the application environment, as shown in fig. 2, and includes:
step S201, aiming at original data to be encrypted, the terminal encrypts the original data by adopting a secret key of an affine password after homogeneous processing to obtain ciphertext data;
the original data to be encrypted may be plaintext data that needs to be subjected to data processing and is provided by a secure multiparty computing party, such as the personal wealth value of the rich and social related feature data of the user provided by company a, and then the original data is subjected to affine encryption by using a secret key of the affine password after the homogeneous processing, so that corresponding ciphertext data can be obtained.
Affine cryptography is a kind of single-table encryption, where all letters in the alphabet system are encrypted by a simple mathematical equation, corresponding to a numerical value, or turning back to a letter.
Step S202, sending a service request containing the ciphertext data to a server to obtain a ciphertext processing result of the server after the ciphertext data is processed;
after the terminal performs affine encryption on the original data to obtain final ciphertext data, the ciphertext data can be sent to the server, the server can perform safe multi-party calculation on the ciphertext data to obtain a ciphertext processing result, and then the ciphertext processing result is sent to the terminal. Of course, in the whole process of performing secure multiparty computation, the server does not know what the original data is, and moreover, the ciphertext data cannot be decrypted because the server does not know what the secret key is.
And step S203, the terminal receives the ciphertext processing result and decrypts the ciphertext processing result by adopting the key to obtain decrypted data.
After the terminal receives the ciphertext processing result returned by the server, affine decryption is still performed on the ciphertext processing result by using the secret key after the homogenization processing, and then decrypted data can be obtained.
In the embodiment of the invention, for original data to be encrypted, a terminal adopts a secret key of an affine password after the homogenization treatment to perform affine encryption on the original data to obtain ciphertext data, then a service request containing the ciphertext data is sent to a server to obtain a ciphertext treatment result of the server after the ciphertext data is treated, and when the ciphertext treatment result is received, the secret key is adopted to decrypt the ciphertext treatment result to obtain decrypted data. Compared with the traditional affine cipher homomorphic operation, the method has the advantage that the operation efficiency is greatly improved due to the fact that the keys of the traditional affine cipher are subjected to the homogenization treatment. Moreover, because the keys of the traditional affine cipher are subjected to the homogenization treatment, the number of homomorphic operations is not required to be provided in the decryption process, and the safety is greatly enhanced.
In another embodiment, a detailed description of a data processing method as shown in fig. 2 is continued.
Step S201, aiming at original data to be encrypted, the terminal encrypts the original data by adopting a secret key of an affine password after homogeneous processing to obtain ciphertext data;
the original data to be encrypted may be plaintext data that needs to be subjected to data processing and is provided by a secure multiparty computing party, such as the personal wealth value of the rich and social related feature data of the user provided by company a, and then the original data is subjected to affine encryption by using a secret key of the affine password after the homogeneous processing, so that corresponding ciphertext data can be obtained.
Affine cryptography is a kind of single-table encryption, where all letters in the alphabet system are encrypted by a simple mathematical equation, corresponding to a numerical value, or turning back to a letter.
For example, the letters are from a to Z, and there are corresponding values in table 1:
TABLE 1
Figure BDA0002416458170000121
Figure BDA0002416458170000131
Assuming that the original data to be encrypted is "AFFINECIPHER", all possible values of a when encrypted are 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, and 25. If a is not equal to 1 (a special case is because when a is 1, affine encryption is an arcade cipher, equation (1) can be simplified to linear motion), setting a to 5, b to 8, and n to 26 (because 26 letters are used in common), then the value of b can be randomly selected, so the encryption function in this example is e (x) to (5x +8) mod 26. The numbers corresponding to the letters in the raw data are shown in table 2:
TABLE 2
Raw data A F F I N E C I P H E R
x 0 5 5 8 13 4 2 8 15 7 4 17
Now, taking the values of x and solving the first part of the equation (5x +8) yields the value of (5x +8) for each letter, and taking the remainder of its pair 26 yields the calculation results shown in Table 3:
TABLE 3
Raw data A F F I N E C I P H E R
x 0 5 5 8 13 4 2 8 15 7 4 17
5x+8 8 33 33 48 73 28 18 48 83 43 28 93
(5x+8)mod26 8 7 7 22 21 2 18 22 5 17 2 15
Ciphertext data I H H W V C S W F R C P
Thus, ciphertext data obtained by using the conventional key (a, b, n) for the original data "AFFINECIPHER" is "IHHWVCSWFRCP".
Accordingly, the conventional key (a, b, n) used to decrypt "IHHWVCSWFRCP" is calculated using equation (2) above, a-1When 21, 8, 26, m, the formula (2) is substituted to obtain: d (y) 21(y-8) mod 26. The calculation result obtained by calculating the ciphertext data by using the formula (2) is shown in table 4:
TABLE 4
Figure BDA0002416458170000132
Figure BDA0002416458170000141
In the embodiment of the invention, the traditional secret key is subjected to homogeneous processing, and then the processed secret key is adopted to perform affine encryption on the original data to obtain the ciphertext data.
In the embodiment of the present invention, the method of the homogeneous processing includes:
setting the parameter value of the displacement in the original key of the affine password as 0, and setting the letter number parameter n and the co-prime parameter a of n in the original key as m-dimensional vectors to obtain m groups of keys (a)i,ni) (ii) a Wherein, aiIs the ith component of a, niIs the ith component of n, 0<i≤m,
Figure BDA0002416458170000142
n1<…<nmAnd i, m and n are positive integers.
Specifically, b of (a, b, n) in the conventional key is set to 0, so that the key is (a, n), then a and n are respectively set to m-dimensional vectors, and a is usediDenotes the ith component of a, niDenotes the ith component of n, and each group (a)i,ni) All satisfy the property of affine cryptography, i.e.
Figure BDA0002416458170000143
N is also required to satisfy1<…<nmAnd 0<i is less than or equal to m; wherein i, m and n are positive integers.
The method comprises the following steps of carrying out affine encryption by adopting a secret key of an affine password after the homogeneous processing to obtain ciphertext data, wherein the steps comprise:
calculating by adopting a preset affine encryption algorithm based on the ith group of keys to obtain first ciphertext data corresponding to the ith group of keys; wherein the ith group key is (a)i,ni),0<i≤m;
Calculating to obtain second ciphertext data corresponding to the (i + 1) th group key based on the first ciphertext data, the (i + 1) th group key and an affine encryption algorithm;
and taking the second ciphertext data as the current first ciphertext data, and repeatedly executing the step of calculating to obtain second ciphertext data corresponding to the i +1 group key based on the first ciphertext data, the i +1 group key and the affine encryption algorithm until the current second ciphertext data is taken as the final ciphertext data when i +1 is m.
In particular, from the 1 st group key, i.e. from (a)1,n1) Initially, the original data is encrypted using a preset affine encryption algorithm (i.e., equation (1)). Since b in the key is set to 0, substituting the key after the homogenization process into equation (1) yields Ei(x)=aix modniFor example, if it is (a)1,n1) Then the algorithm for affine encryption of the original data is: e1(x)=a1x modn1Thereby obtaining first ciphertext data corresponding to the 1 st group key.
Then, the first ciphertext data is used as input based on the 2 nd group key (a)2,n2) Adopting an affine encryption algorithm to encrypt, namely: e2(x)=a2(E1(x))modn2Thereby obtaining second ciphertext data corresponding to the 2 nd group key.
Further, the second ciphertext data is input based on the 3 rd group key (a)3,n3) And obtaining third ciphertext data, and repeating the steps until i +1 is m, namely calculating the ciphertext data corresponding to the last group of keys by using the ciphertext data corresponding to the second-to-last group of keys to obtain the ciphertext data corresponding to the last group of keys, and using the ciphertext data as final ciphertext data. The calculation process may refer to tables 1 to 3, and the value of b is removed, which is not described herein again.
The above process can be specifically calculated by using the following formula:
Figure BDA0002416458170000151
wherein the content of the first and second substances,
Figure BDA0002416458170000152
representing a complex calculation of the function. That is, the present inventionThe application is to obtain the formula (3) by performing the homogeneous processing on the traditional affine key and performing the iterative operation on the traditional affine encryption algorithm, and for convenience of description, the formula is referred to as an iterative affine password in the application.
Step S202, sending a service request containing the ciphertext data to a server to obtain a ciphertext processing result of the server after the ciphertext data is processed;
after the terminal performs affine encryption on the original data to obtain final ciphertext data, the ciphertext data can be sent to the server, the server can perform safe multi-party calculation on the ciphertext data to obtain a ciphertext processing result, and then the ciphertext processing result is sent to the terminal. Of course, in the whole process of performing secure multiparty computation, the server does not know what the original data is, and moreover, the ciphertext data cannot be decrypted because the server does not know what the secret key is. For example, the original data is "AFFINECIPHER", and the encrypted ciphertext data is "IHHWVCSWFRCP" (obtained by non-formula (3)), then the data used by the server in performing the secure multiparty computation is "IHHWVCSWFRCP".
In a preferred embodiment of the present invention, the service request further includes a data processing mode;
sending the service request containing the ciphertext data to the server to obtain a ciphertext processing result of the server after the ciphertext data is processed, wherein the ciphertext processing result comprises the following steps:
and sending the service request to the server so that the server performs secure multi-party calculation on the ciphertext data in a data processing mode to obtain a ciphertext processing result.
Specifically, the server receiving the service request may further include a data processing manner, such as comparing the magnitude of the two values in the above-mentioned fukullman problem, and performing default prediction by using the B corporation model based on the relevant feature data of the user. Of course, only one of the multiple participants may need to perform the secure multiparty computation, or all of the multiple participants may need to perform the secure multiparty computation, and the data processing of the participants may be different from each other. Then, the server can perform corresponding data processing on the respective ciphertext data based on the data processing mode of each participant, so as to obtain a ciphertext processing result required by each participant.
Further, the target data obtained by performing secure multiparty computation on the original data comprises:
and calculating the original data by adopting a data processing mode to obtain target data. And the decrypted data is the same as the target data obtained by performing secure multiparty computation on the original data.
Since the traditional secret key is subjected to the homogenization treatment, the formula (1) after the homogenization treatment is as follows: ei(x)=aix modniAs can be seen, (E (x)1)+E(x2))modnm=E(x1+x2) Therefore, affine encryption and affine decryption still have homomorphism when the keys after the homogenization processing are used for carrying out affine encryption and affine decryption. That is, if the original data of the participant is not encrypted, but the data processing mode is directly adopted to process the original data, the obtained result is the same as the result obtained after the original data is encrypted, safely calculated and decrypted.
Further, since b in the conventional key is set to 0, the number of homomorphic calculations does not need to be known when homomorphic encryption is performed, thereby improving security.
Moreover, since a and n are m-dimensional vectors, the total number of usable keys after the homogeneous processing is:
Figure BDA0002416458170000161
wherein liIs the secret key niLength of (d). Assume that the cipher text length of the conventional affine cipher and the cipher text length of the iterative affine cipher are 1024 bits, i.e., l ═ lm1024, the key of the conventional affine cipher is about 2 by simple calculation3071And m is 5 and l1,…,l5The key of the iterative affine cipher distributed uniformly between 512 and 1024 is about 23835The size of the key space is improved by 2764FromAnd the safety is greatly improved. In addition, the size of m is improved and l is reasonably arranged1,…,lmThere is still room for further improvement in safety.
And step S203, the terminal receives the ciphertext processing result and decrypts the ciphertext processing result by adopting the key to obtain decrypted data.
After the terminal receives the ciphertext processing result returned by the server, affine decryption is still performed on the ciphertext processing result by using the secret key after the homogenization processing, and then decrypted data can be obtained.
The method comprises the following steps of carrying out affine decryption on a ciphertext processing result by using a secret key to obtain decrypted data, and comprises the following steps of:
calculating by adopting a preset affine decryption algorithm based on the ith group key to obtain first decryption data corresponding to the ith group key; wherein the ith group key is (a)i,ni),0<i≤m;
Calculating to obtain second decryption data corresponding to the i-1 group key based on the first decryption data, the i-1 group key and an affine decryption algorithm;
and taking the second decrypted data as the current first decrypted data, and repeatedly executing the step of calculating the second decrypted data corresponding to the i-1 group key based on the first decrypted data, the i-1 group key and the affine decryption algorithm until the current second decrypted data is taken as the final decrypted data when i-1 is equal to 1.
Specifically, the slave 1 sets of keys (i.e., when i ═ m), i.e., the slave (a)i,ni) Initially, the original data is decrypted using a preset affine decryption algorithm (i.e., equation (2)). Since b in the key is set to 0, substituting the key after the homogenization process into equation (2) results in
Figure BDA0002416458170000171
For example, if it is the (a) thi,ni) Then, the algorithm for performing affine decryption on the ciphertext data is as follows:
Figure BDA0002416458170000172
thereby obtainingFirst decryption data corresponding to the 1 st group key.
Then, the first decrypted data is used as input, based on the 2 nd group key (a)i-1,ni-1) Adopting an affine encryption algorithm to decrypt, namely:
Figure BDA0002416458170000173
thereby resulting in second decrypted data corresponding to the penultimate set of keys.
Further, the second decrypted data is used as input, based on the third last group key (a)i-2,ni-2) And obtaining third decrypted data, and so on, until when i-1 is equal to 1, calculating the decrypted data corresponding to the first group key by using the decrypted data corresponding to the second group key, and using the decrypted data as final decrypted data. The calculation process may refer to table 4, and the value of b may be removed, which is not described herein again.
The above process can be specifically calculated by using the following formula:
Figure BDA0002416458170000174
wherein the content of the first and second substances,
Figure BDA0002416458170000175
representing a complex calculation of the function. That is, the formula (4) is obtained by performing the homogeneous processing on the conventional affine key and performing the iterative operation on the conventional affine decryption algorithm.
Further, to verify the performance improvement, the skilled person performs the following experiment compared to the asymmetric Paillier:
1) the single machine test randomly generates 100 ten thousand floating point numbers between-100, respectively uses 1024-bit Paillier and 2048-bit iterative affine cipher (at this time, the cipher texts are the same in length) to encrypt, homomorphic operate and decrypt, and the time consumption is shown in the following table 5:
TABLE 5
1024-bit Paillier 2048 bit iterative affine cipher Multiple of
Encrypted time(s) 12498.962 0.726 17216
Homomorphic operation time(s) 193.078 0.072 2682
Time consumed for decryption(s) 0.004 0 (negligible) INF
2) The two are integrated in a SecureBoosting algorithm and trained on the following data: 70000 samples, one side grasps 108 columns of characteristic data, and the other side grasps 10 columns of characteristic data and labels. The elapsed time (in seconds) per tree grown is recorded in table 6:
TABLE 6
Figure BDA0002416458170000181
It can be obviously known that the time consumption is saved by about 70%.
The two experiments show that the homomorphic operation efficiency of the iterative affine password is greatly improved.
In the embodiment of the invention, aiming at original data to be encrypted, a terminal encrypts the original data by adopting a secret key of an affine password after the homogenization treatment to obtain ciphertext data, then sends a service request containing the ciphertext data to a server to obtain a ciphertext treatment result of the server after the ciphertext data is treated, and decrypts the ciphertext treatment result by adopting the secret key to obtain decrypted data when the ciphertext treatment result is received. Compared with the traditional affine cipher homomorphic operation, the method has the advantage that the operation efficiency is greatly improved due to the fact that the keys of the traditional affine cipher are subjected to the homogenization treatment. Moreover, because the keys of the traditional affine cipher are subjected to the homogenization treatment, the number of homomorphic operations is not required to be provided in the decryption process, and the safety is greatly enhanced.
Furthermore, due to the fact that multidimensional vectors are set for the keys after the alignment processing, compared with the keys of the traditional affine cipher, the number of the keys is greatly increased, and therefore safety is further enhanced.
Fig. 3 is a schematic structural diagram of a data processing apparatus according to another embodiment of the present application, and as shown in fig. 3, the apparatus of this embodiment may include:
the encryption module 301 is configured to encrypt, for original data to be encrypted, the original data by using a secret key of an affine password after the homogeneous processing to obtain ciphertext data;
a sending module 302, configured to send a service request including ciphertext data to a server, to obtain a ciphertext processing result after the server processes the ciphertext data;
a receiving module 303, configured to receive a ciphertext processing result;
and the decryption module 304 is configured to decrypt the ciphertext processing result by using the key to obtain decrypted data.
In a preferred embodiment of the present invention, the mode of the homogenization treatment comprises:
setting the parameter value of the displacement in the original key of the affine password as 0, and setting the letter number parameter n and the co-prime parameter a of n in the original key as m-dimensional vectors to obtain m groups of keys (a)i,ni) (ii) a Wherein, aiIs the ith component of a, niIs the ith component of n, 0<i≤m,
Figure BDA0002416458170000191
n1<…<nmAnd i, m and n are positive integers.
In a preferred embodiment of the present invention, the encryption module comprises:
the first calculation submodule is used for calculating to obtain first ciphertext data corresponding to the ith group of keys by adopting a preset affine encryption algorithm based on the ith group of keys; wherein the ith group key is (a)i,ni),0<i≤m;
The second calculation submodule is used for calculating to obtain second ciphertext data corresponding to the (i + 1) th group of keys based on the first ciphertext data, the (i + 1) th group of keys and the affine encryption algorithm;
and taking the second ciphertext data as the current first ciphertext data, and repeatedly calling the first calculation sub-module and the second calculation sub-module until the current second ciphertext data is taken as the final ciphertext data when i +1 is m.
In a preferred embodiment of the present invention, the decryption module comprises:
the first decryption submodule is used for calculating to obtain first decryption data corresponding to the ith group of keys by adopting a preset affine decryption algorithm based on the ith group of keys; wherein the ith group key is (a)i,ni),0<i≤m;
The second decryption submodule is used for calculating second decryption data corresponding to the i-1 group key based on the first decryption data, the i-1 group key and the affine decryption algorithm;
and taking the second decrypted data as the current first decrypted data, and repeatedly calling the first decryption sub-module and the second decryption sub-module until the current second decrypted data is taken as the final decrypted data when i-1 is equal to 1.
In a preferred embodiment of the present invention, the service request further includes a data processing mode;
sending the service request containing the ciphertext data to the server to obtain a ciphertext processing result of the server after the ciphertext data is processed, wherein the ciphertext processing result comprises the following steps:
and sending the service request to the server so that the server performs secure multi-party calculation on the ciphertext data in a data processing mode to obtain a ciphertext processing result.
In a preferred embodiment of the present invention, the decrypted data is the same as the target data obtained by performing secure multiparty computation on the original data;
the target data obtained by performing secure multi-party calculation on the original data comprises the following steps:
and calculating the original data by adopting a data processing mode to obtain target data.
The data processing apparatus of this embodiment can execute the data processing methods shown in the first embodiment and the second embodiment of this application, and the implementation principles thereof are similar, and are not described herein again.
In the embodiment of the invention, aiming at original data to be encrypted, a terminal encrypts the original data by adopting a secret key of an affine password after the homogenization treatment to obtain ciphertext data, then sends a service request containing the ciphertext data to a server to obtain a ciphertext treatment result of the server after the ciphertext data is treated, and decrypts the ciphertext treatment result by adopting the secret key to obtain decrypted data when the ciphertext treatment result is received. Compared with the traditional affine cipher homomorphic operation, the method has the advantage that the operation efficiency is greatly improved due to the fact that the keys of the traditional affine cipher are subjected to the homogenization treatment. Moreover, because the keys of the traditional affine cipher are subjected to the homogenization treatment, the number of homomorphic operations is not required to be provided in the decryption process, and the safety is greatly enhanced.
Furthermore, due to the fact that multidimensional vectors are set for the keys after the alignment processing, compared with the keys of the traditional affine cipher, the number of the keys is greatly increased, and therefore safety is further enhanced.
In another embodiment of the present application, there is provided an electronic device including: a memory and a processor; at least one program stored in the memory for execution by the processor, which when executed by the processor, implements: the terminal encrypts the original data by adopting the secret key of the affine password after the homogenization treatment to obtain ciphertext data, then sends a service request containing the ciphertext data to the server to obtain a ciphertext treatment result of the server after the ciphertext data is treated, and decrypts the ciphertext treatment result by adopting the secret key to obtain decrypted data when the ciphertext treatment result is received. Compared with the traditional affine cipher homomorphic operation, the method has the advantage that the operation efficiency is greatly improved due to the fact that the keys of the traditional affine cipher are subjected to the homogenization treatment. Moreover, because the keys of the traditional affine cipher are subjected to the homogenization treatment, the number of homomorphic operations is not required to be provided in the decryption process, and the safety is greatly enhanced.
In an alternative embodiment, an electronic device is provided, as shown in fig. 4, the electronic device 4000 shown in fig. 4 comprising: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further comprise a transceiver 4004. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
Processor 4001 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 4002 may include a path that carries information between the aforementioned components. Bus 4002 may be a PCI bus, EISA bus, or the like. The bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
Memory 4003 may be, but is not limited to, a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, an EEPROM, a CD-ROM or other optical disk storage, an optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 4003 is used for storing application codes for executing the scheme of the present application, and the execution is controlled by the processor 4001. Processor 4001 is configured to execute application code stored in memory 4003 to implement what is shown in any of the foregoing method embodiments.
Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like.
Yet another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, which, when run on a computer, enables the computer to perform the corresponding content in the aforementioned method embodiments. Compared with the prior art, the terminal encrypts the original data by adopting the secret key of the affine password after the homogenization treatment aiming at the original data to be encrypted to obtain the ciphertext data, then sends the service request containing the ciphertext data to the server to obtain the ciphertext treatment result of the server after the ciphertext data is treated, and decrypts the ciphertext treatment result by adopting the secret key to obtain the decrypted data when the ciphertext treatment result is received. Compared with the traditional affine cipher homomorphic operation, the method has the advantage that the operation efficiency is greatly improved due to the fact that the keys of the traditional affine cipher are subjected to the homogenization treatment. Moreover, because the keys of the traditional affine cipher are subjected to the homogenization treatment, the number of homomorphic operations is not required to be provided in the decryption process, and the safety is greatly enhanced.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for processing data, comprising:
for original data to be encrypted, encrypting the original data by the terminal by adopting a secret key of an affine password after the homogenization treatment to obtain ciphertext data;
sending a service request containing the ciphertext data to a server to obtain a ciphertext processing result of the server after the ciphertext data is processed;
and the terminal receives the ciphertext processing result and decrypts the ciphertext processing result by adopting the key to obtain decrypted data.
2. The data processing method of claim 1, wherein the homogeneous processing mode comprises:
setting the parameter value of the displacement size in the original key of the affine password as 0, and setting the number of letters in the original key and the co-prime parameter a of the n as m-dimensional vectors to obtain m groups of keys (a)i,ni) (ii) a Wherein, aiIs the ith component of a, niIs the ith component of n, i is more than 0 and less than or equal to m,
Figure FDA0002416458160000011
n1<…<nmand i, m and n are positive integers.
3. The data processing method according to claim 1 or 2, wherein the step of encrypting the original data by the terminal using the secret key of the affine cipher after the homogeneous processing to obtain the ciphertext data comprises:
calculating by adopting a preset affine encryption algorithm based on the ith group of keys to obtain first ciphertext data corresponding to the ith group of keys; wherein the ith group key is (a)i,ni),0<i≤m;
Calculating to obtain second ciphertext data corresponding to the (i + 1) th group key based on the first ciphertext data, the (i + 1) th group key and the affine encryption algorithm;
and taking the second ciphertext data as current first ciphertext data, and repeatedly executing the step of calculating to obtain second ciphertext data corresponding to the i +1 group key based on the first ciphertext data, the i +1 group key and the affine encryption algorithm until the current second ciphertext data is taken as final ciphertext data when i +1 is m.
4. The data processing method according to claim 1, wherein the step of decrypting the ciphertext processing result using the key to obtain decrypted data comprises:
calculating by adopting a preset affine decryption algorithm based on the ith group key to obtain first decryption data corresponding to the ith group key; wherein the ith group key is (a)i,ni),0<i≤m;
Calculating to obtain second decryption data corresponding to the i-1 group key based on the first decryption data, the i-1 group key and the affine decryption algorithm;
and taking the second decrypted data as current first decrypted data, and repeatedly executing the step of calculating and obtaining second decrypted data corresponding to the i-1 group key based on the first decrypted data, the i-1 group key and the affine decryption algorithm until the current second decrypted data is taken as final decrypted data when i-1 is equal to 1.
5. The data processing method according to claim 1, wherein the service request further includes a data processing mode;
the sending the service request containing the ciphertext data to a server to obtain a ciphertext processing result of the server after the ciphertext data is processed comprises:
and sending the service request to the server so that the server performs secure multi-party calculation on the ciphertext data in the data processing mode to obtain the ciphertext processing result.
6. The method of claim 1 or 5, further characterized in that the decrypted data is the same as the target data obtained by performing the secure multiparty computation on the original data;
the target data obtained by performing the secure multiparty computation on the raw data comprises:
and calculating the original data by adopting the data processing mode to obtain the target data.
7. An apparatus for processing data, comprising:
the encryption module is used for encrypting the original data to be encrypted by adopting a secret key of the affine password after the homogeneous processing to obtain ciphertext data;
the sending module is used for sending the service request containing the ciphertext data to a server to obtain a ciphertext processing result of the server after the ciphertext data is processed;
the receiving module is used for receiving the ciphertext processing result;
and the decryption module is used for decrypting the ciphertext processing result by adopting the secret key to obtain decrypted data.
8. The apparatus for processing data according to claim 7, wherein the homogeneous processing manner comprises:
setting the parameter value of the displacement size in the original key of the affine password as 0, and setting the number of letters in the original key and the co-prime parameter a of the n as m-dimensional vectors to obtain m groups of keys (a)i,ni) (ii) a Wherein, aiIs the ith component of a, niIs the ith component of n, i is more than 0 and less than or equal to m,
Figure FDA0002416458160000031
n1<…<nmand i, m and n are positive integers.
9. An electronic device, comprising:
a processor, a memory, and a bus;
the bus is used for connecting the processor and the memory;
the memory is used for storing operation instructions;
the processor is used for executing the data processing method of any one of the claims 1-6 by calling the operation instruction.
10. A computer-readable storage medium for storing computer instructions which, when executed on a computer, cause the computer to perform the method of processing data of any of claims 1-6.
CN202010192637.0A 2020-03-18 2020-03-18 Data processing method and device, electronic equipment and computer readable storage medium Active CN111404943B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010192637.0A CN111404943B (en) 2020-03-18 2020-03-18 Data processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010192637.0A CN111404943B (en) 2020-03-18 2020-03-18 Data processing method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111404943A true CN111404943A (en) 2020-07-10
CN111404943B CN111404943B (en) 2021-10-26

Family

ID=71413428

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010192637.0A Active CN111404943B (en) 2020-03-18 2020-03-18 Data processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111404943B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112073196A (en) * 2020-11-10 2020-12-11 腾讯科技(深圳)有限公司 Service data processing method and device, electronic equipment and storage medium
CN112906044A (en) * 2021-05-10 2021-06-04 腾讯科技(深圳)有限公司 Multi-party security calculation method, device, equipment and storage medium
CN113806760A (en) * 2021-04-09 2021-12-17 京东科技控股股份有限公司 Method and device for obtaining correlation coefficient between features, electronic equipment and storage medium
CN114039785A (en) * 2021-11-10 2022-02-11 奇安信科技集团股份有限公司 Data encryption, decryption and processing method, device, equipment and storage medium
CN114093465A (en) * 2021-10-28 2022-02-25 广东珠江智联信息科技股份有限公司 Medical image labeling system based on homomorphic encryption and data processing method thereof
CN114584285A (en) * 2022-05-05 2022-06-03 深圳市洞见智慧科技有限公司 Secure multiparty processing method and related device
CN116049851A (en) * 2023-01-28 2023-05-02 北京隐算科技有限公司 Ciphertext processing system and method based on full homomorphic encryption

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103188075A (en) * 2013-02-01 2013-07-03 广州大学 Secret key and true random number generator and method for generating secret key and true random number
CN105204820A (en) * 2014-06-26 2015-12-30 英特尔公司 Instructions and logic to provide general purpose gf(256) simd cryptographic arithmetic functionality
CN105577362A (en) * 2015-12-28 2016-05-11 中山大学花都产业科技研究院 Byte substitution method applied to AES algorithm and system thereof
CN106663387A (en) * 2014-09-18 2017-05-10 华为国际有限公司 Encryption/decryption function generating method, an encryption/decryption method and related apparatuses
CN106789066A (en) * 2016-12-12 2017-05-31 西北工业大学 Agency's weight endorsement method based on IP signatures
CN109474423A (en) * 2018-12-10 2019-03-15 平安科技(深圳)有限公司 Data encryption/decryption method, server and storage medium
CN109995506A (en) * 2019-04-09 2019-07-09 司法鉴定科学研究院 Skinny algorithm optimal implementation method, system, terminal, storage medium
US20190327088A1 (en) * 2018-04-23 2019-10-24 International Business Machines Corporation Method for Leakage-Resilient Distributed Function Evaluation with CPU-Enclaves
CN110543772A (en) * 2019-08-23 2019-12-06 厦门市美亚柏科信息股份有限公司 Offline decryption method and device
CN110765473A (en) * 2019-10-11 2020-02-07 矩阵元技术(深圳)有限公司 Data processing method, data processing device, computer equipment and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103188075A (en) * 2013-02-01 2013-07-03 广州大学 Secret key and true random number generator and method for generating secret key and true random number
CN105204820A (en) * 2014-06-26 2015-12-30 英特尔公司 Instructions and logic to provide general purpose gf(256) simd cryptographic arithmetic functionality
CN106663387A (en) * 2014-09-18 2017-05-10 华为国际有限公司 Encryption/decryption function generating method, an encryption/decryption method and related apparatuses
CN105577362A (en) * 2015-12-28 2016-05-11 中山大学花都产业科技研究院 Byte substitution method applied to AES algorithm and system thereof
CN106789066A (en) * 2016-12-12 2017-05-31 西北工业大学 Agency's weight endorsement method based on IP signatures
US20190327088A1 (en) * 2018-04-23 2019-10-24 International Business Machines Corporation Method for Leakage-Resilient Distributed Function Evaluation with CPU-Enclaves
CN109474423A (en) * 2018-12-10 2019-03-15 平安科技(深圳)有限公司 Data encryption/decryption method, server and storage medium
CN109995506A (en) * 2019-04-09 2019-07-09 司法鉴定科学研究院 Skinny algorithm optimal implementation method, system, terminal, storage medium
CN110543772A (en) * 2019-08-23 2019-12-06 厦门市美亚柏科信息股份有限公司 Offline decryption method and device
CN110765473A (en) * 2019-10-11 2020-02-07 矩阵元技术(深圳)有限公司 Data processing method, data processing device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JUMPFLY_W: "乘法密码", 《HTTPS://BLOG.CSDN.NET/ONLY06/ARTICLE/DETAILS/54784140/》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112073196A (en) * 2020-11-10 2020-12-11 腾讯科技(深圳)有限公司 Service data processing method and device, electronic equipment and storage medium
CN112073196B (en) * 2020-11-10 2021-02-23 腾讯科技(深圳)有限公司 Service data processing method and device, electronic equipment and storage medium
CN113806760A (en) * 2021-04-09 2021-12-17 京东科技控股股份有限公司 Method and device for obtaining correlation coefficient between features, electronic equipment and storage medium
CN113806760B (en) * 2021-04-09 2024-05-17 京东科技控股股份有限公司 Method, device, electronic equipment and storage medium for acquiring correlation coefficient between features
CN112906044A (en) * 2021-05-10 2021-06-04 腾讯科技(深圳)有限公司 Multi-party security calculation method, device, equipment and storage medium
CN112906044B (en) * 2021-05-10 2021-07-30 腾讯科技(深圳)有限公司 Multi-party security calculation method, device, equipment and storage medium
CN114093465A (en) * 2021-10-28 2022-02-25 广东珠江智联信息科技股份有限公司 Medical image labeling system based on homomorphic encryption and data processing method thereof
CN114039785A (en) * 2021-11-10 2022-02-11 奇安信科技集团股份有限公司 Data encryption, decryption and processing method, device, equipment and storage medium
CN114039785B (en) * 2021-11-10 2024-02-27 奇安信科技集团股份有限公司 Data encryption, decryption and processing methods, devices, equipment and storage medium
CN114584285A (en) * 2022-05-05 2022-06-03 深圳市洞见智慧科技有限公司 Secure multiparty processing method and related device
CN116049851A (en) * 2023-01-28 2023-05-02 北京隐算科技有限公司 Ciphertext processing system and method based on full homomorphic encryption
CN116049851B (en) * 2023-01-28 2023-08-22 北京隐算科技有限公司 Ciphertext processing system and method based on full homomorphic encryption

Also Published As

Publication number Publication date
CN111404943B (en) 2021-10-26

Similar Documents

Publication Publication Date Title
CN111404943B (en) Data processing method and device, electronic equipment and computer readable storage medium
US10713535B2 (en) Methods and processes of encrypted deep learning services
CN107145791B (en) K-means clustering method and system with privacy protection function
CN107196926B (en) Cloud outsourcing privacy set comparison method and device
CN111510281B (en) Homomorphic encryption method and device
CN110089071B (en) Secure distributed data processing
US10367640B2 (en) Shared secret data production system
CN112104619A (en) Data access control system and method based on outsourcing ciphertext attribute encryption
Natanael et al. Text encryption in android chat applications using elliptical curve cryptography (ECC)
US20190065759A1 (en) Method for protecting data
CN115694777A (en) Privacy set intersection method, device, equipment and medium based on homomorphic encryption
CN107888385B (en) RSA modulus generation method, RSA key generation method, computer device, and medium
CN114039785A (en) Data encryption, decryption and processing method, device, equipment and storage medium
Yan et al. CloudFile: A cloud data access control system based on mobile social trust
Jammula et al. Hybrid lightweight cryptography with attribute-based encryption standard for secure and scalable IoT system
CN113434906B (en) Data query method, device, computer equipment and storage medium
CN113055184B (en) Data encryption and decryption method and device
CN111555880A (en) Data collision method and device, storage medium and electronic equipment
Qu et al. Improved cryptanalysis of a fully homomorphic symmetric encryption scheme
EP3298720B1 (en) Computing with encrypted values
CN113904833B (en) Dynamic multi-factor identity authentication method and communication method based on threshold
CN115459909A (en) Key data processing method and device
Ansah et al. Relevance of elliptic curve cryptography in modern-day technology
US11569979B2 (en) Cryptographic systems with variable layout cryptography
KR102304831B1 (en) Encryption systems and method using permutaion group based cryptographic techniques

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40025932

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant