Data encryption and decryption methods, devices, storage media, and software products

By establishing a lifting mapping relationship between the finite field and the residual ring class, and using the distorted Edwards curve for encryption, the problem of high computational overhead of the SM2 curve group encryption method is solved, and efficient data encryption is achieved.

CN120602242BActive Publication Date: 2025-10-28BEIJING INFOSEC TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511115863.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-08
Publication Date
2025-10-28
Estimated Expiration
2045-08-08

AI Technical Summary

Technical Problem

In existing technologies, encryption methods based on the SM2 curve group have huge computational overhead, resulting in reduced encryption efficiency.

Method used

Establish a lifting mapping relationship from the twisted Edwards curve over a finite field to the remaining class ring. Determine the first curve point through the public key for lifting mapping, and use the mapping function and inverse transformation to calculate the class function for encryption.

Benefits of technology

It significantly reduces computational overhead in the encryption process, improves encryption efficiency, and is suitable for resource-constrained environments such as IoT devices and smart cards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120602242B_ABST
    Figure CN120602242B_ABST
Patent Text Reader

Abstract

This application provides a data encryption and decryption method, device, storage medium, and program product. In this application, a lifting mapping relationship is established between a twisted Edwards curve over a finite field and a twisted Edwards curve over a residual ring-like structure. A first curve on the twisted Edwards curve over the finite field is determined based on a public key. The first curve point is then lifted and mapped to a second curve point on the twisted Edwards curve over the residual ring-like structure based on the lifting mapping relationship. Algebraic features are extracted from the second curve point using a mapping function, and an inverse transformation is performed to calculate a class function. This class function is then used to encrypt the first data to be encrypted, resulting in a first sub-ciphertext, which, together with the second sub-ciphertext, constitutes the first ciphertext. This application, based on the twisted Edwards curve and using the lifting mapping relationship, encrypts the first data to be encrypted, significantly reducing computational overhead during the encryption process and thus improving encryption efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer application technology, and in particular to a data encryption and decryption method, device, storage medium and program product. Background Technology

[0002] In today's digital age, data has become a core asset. For security reasons, all existing data needs to be transmitted and stored in an encrypted manner.

[0003] One common encryption method involves extending the SM2 (Elliptic Curve Public-Key Cryptography) curves to the residual ring class. Its encryption principle is based on the group homomorphism mapping from the SM2 curve group over a finite field to the SM2 curve group over the residual ring class. The plaintext data is encrypted using a public key to obtain the corresponding ciphertext. However, in practical applications, this encryption method incurs enormous computational overhead, directly leading to a reduction in overall encryption efficiency. Summary of the Invention

[0004] Embodiments of this application provide a data encryption and decryption method, device, storage medium, and program product to reduce computational overhead during the encryption process and thereby improve encryption efficiency.

[0005] This application provides a data encryption method, comprising: establishing a lifting mapping relationship between a twisted Edwards curve on a finite field and a twisted Edwards curve on a residual ring-like structure, wherein the lifting mapping relationship is such that, in an affine coordinate system, the adjustment amount of the ordinate is h1p through a lifting operation based on P-adduct; where h1 represents the adjustment coefficient of the ordinate, and the adjustment coefficient is associated with the coordinates of the point on the twisted Edwards curve on the finite field to be mapped to the twisted Edwards curve on the residual ring-like structure; p represents a prime number; determining a first curve point on the twisted Edwards curve on the finite field based on a public key, and lifting and mapping the first curve point to a second curve point on the twisted Edwards curve on the residual ring-like structure based on the lifting mapping relationship; extracting algebraic features from the second curve point through a mapping function, and performing inverse transformation calculation on the algebraic features to obtain the class function of the second curve point; encrypting the first data to be encrypted using the class function of the second curve point to obtain a first sub-ciphertext; the first sub-ciphertext and the second sub-ciphertext constitute the first ciphertext; the second sub-ciphertext is generated based on the parameters of the twisted Edwards curve on the finite field.

[0006] This application also provides a data decryption method, including: obtaining a first ciphertext and a second ciphertext; the first ciphertext and the second ciphertext are encrypted using any one of the data encryption methods; summing the first ciphertext and the second ciphertext to obtain a third ciphertext; and sending the third ciphertext to a decryptor so that the decryptor can decrypt the third ciphertext to obtain decrypted data, wherein the decrypted data is the sum of the first data to be encrypted and the second data to be encrypted.

[0007] This application also provides a data decryption method, comprising: obtaining a first ciphertext; the first ciphertext being obtained by encrypting a first piece of data to be encrypted using any one of the data encryption methods; the first ciphertext including a first sub-ciphertext and a second sub-ciphertext; the second sub-ciphertext being generated based on the parameters of a twisted Edwards curve over a finite field; calculating a first decryption curve point of the twisted Edwards curve over the finite field using a private key and the second sub-ciphertext; based on the lifting mapping relationship between the twisted Edwards curve over the finite field and the twisted Edwards curve over the residual ring class, lifting and mapping the first decryption curve point to a second decryption curve point on the twisted Edwards curve over the residual ring class; extracting algebraic features from the second decryption curve point using a mapping function, and performing inverse transformation calculation on the algebraic features to obtain a class function of the second decryption curve point; and decrypting the first sub-ciphertext using the class function of the second decryption curve point to obtain the first piece of data to be encrypted.

[0008] This application also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is able to implement the various steps in the data encryption and data decryption method provided in this application.

[0009] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the various steps of the data encryption and decryption methods provided in this application.

[0010] This application also provides a computer program product, including a computer program / instructions, which, when executed by a processor, enable the processor to implement the various steps in the data encryption and decryption methods provided in this application.

[0011] In this embodiment, a lifting mapping relationship is established between the twisted Edwards curve over a finite field and the twisted Edwards curve over the remaining ring class. A first curve on the twisted Edwards curve over the finite field is determined based on the public key. The first curve point is then lifted and mapped to a second curve point on the twisted Edwards curve over the remaining ring class based on the lifting mapping relationship. Algebraic features are extracted from the second curve point using a mapping function, and an inverse transformation is performed to calculate a class function. This class function is then used to encrypt the first data to be encrypted, resulting in a first sub-ciphertext. This sub-ciphertext, together with the second sub-ciphertext generated based on the curve parameters, constitutes the first ciphertext. This application, based on the twisted Edwards curve and the lifting mapping relationship, encrypts the first data to be encrypted, significantly reducing computational overhead and thus improving encryption efficiency. Attached Figure Description

[0012] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0013] Figure 1 A flowchart illustrating a data encryption method provided for an exemplary embodiment of this application;

[0014] Figure 2 A flowchart illustrating a data decryption method provided for an exemplary embodiment of this application;

[0015] Figure 3 A flowchart illustrating another data decryption method provided for an exemplary embodiment of this application;

[0016] Figure 4 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this application. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] It should be noted that, in the cases involving user information in the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) comply with relevant laws and standards.

[0019] To address the technical problem in existing technologies that extend SM2 (Elliptic Curve Cryptography based on Weierstrass curves) to the residual ring class, the Weierstrass curve mapping process of SM2 involves excessive conditional branches and inverse calculations, requiring coordinate transformations, resulting in huge computational overhead and reduced overall encryption efficiency. This application addresses this issue by establishing a lifting mapping relationship between a twisted Edwards curve over a finite field and a twisted Edwards curve over the residual ring class. Based on the public key, a first curve on the twisted Edwards curve over the finite field is determined. The first curve point is then lifted and mapped to a second curve point on the twisted Edwards curve over the residual ring class based on the lifting mapping relationship. Algebraic features are extracted from the second curve point using a mapping function, and an inverse transformation is performed to obtain a class function. This class function is then used to encrypt the first data to be encrypted, resulting in a first sub-ciphertext, which, together with the second sub-ciphertext generated based on the curve parameters, constitutes the first ciphertext. This application, based on the twisted Edwards curve and using the lifting mapping relationship, encrypts the first data to be encrypted, significantly reducing computational overhead and thus improving encryption efficiency.

[0020] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0021] Figure 1 This is a flowchart illustrating a data encryption method provided for an exemplary embodiment of this application. Figure 1 As shown, the method includes:

[0022] S101. Establish a lifting mapping relationship between the twisted Edwards curve on the finite field and the twisted Edwards curve on the residual ring class. The lifting mapping relationship is that, in the affine coordinate system, the adjustment amount of the ordinate is h1p by the lifting operation based on P-adjustment; where h1 represents the adjustment coefficient of the ordinate, and the adjustment coefficient is related to the coordinate of the point on the twisted Edwards curve on the finite field to be mapped to the twisted Edwards curve on the residual ring class; p represents a prime number.

[0023] S102. Determine the first curve point on the twisted Edwards curve over the finite field based on the public key, and then perform a lifting mapping on the first curve point to the second curve point on the twisted Edwards curve over the remaining ring-like domain based on the lifting mapping relationship.

[0024] S103. Extract algebraic features from the second curve points using the mapping function, and perform inverse transformation calculations on the algebraic features to obtain the class function of the second curve points.

[0025] S104. Encrypt the first data to be encrypted using the class function of the second curve point to obtain the first sub-ciphertext; the first sub-ciphertext and the second sub-ciphertext constitute the first ciphertext; the second sub-ciphertext is generated based on the parameters of the distorted Edwards curve over a finite field.

[0026] In this application embodiment, it can be applied to the encryption side. The Twisted Edwards Curve is a special form of elliptic curve, whose standard equation is ax². 2 +y 2 =1+dx 2 y 2 Here, 'a' and 'd' represent the parameters of the twisted Edwards curve, which are constants in the domain and satisfy a ≠ d and ad ≠ = 0. The twisted Edwards curve is a generalization of the Edwards curve, enhancing flexibility by introducing the twisting parameter 'a'. When performing addition and doubling operations on elliptic curves, the formula for the twisted Edwards curve is simpler and more efficient than that of the traditional Weierstrass curve (such as that used in SM2). For example, when calculating the addition of two points, the formula is symmetric and requires relatively few multiplication and addition operations. This allows the twisted Edwards curve to perform cryptographic operations, such as key generation, faster while maintaining security in resource-constrained environments, such as IoT devices and smart cards.

[0027] The parameters of the distorted Edwards curve may include E ed (Fp), G, and q, etc. Among them, E ed (Fp) denotes a twisted Edwards curve defined on the finite field Fp, and G denotes the twisted Edwards curve E. ed (Fp) is a base point of order q on which q is a positive integer.

[0028] In this embodiment, a finite field is an algebraic structure containing a finite number of elements, where addition, subtraction, multiplication, and division (excluding division by zero) all satisfy the commutative, associative, and distributive laws. The size of the finite field is a prime power, which can be denoted as Fq, where q = p. n (where p is a prime number and n is a positive integer); when n=1, it is called the prime field Fp, whose elements are integers {0,1,2,…,p−1}, and arithmetic operations are defined modulo p. In cryptography, the coefficients and coordinates of the points in the distorted Edwards curve equation can be taken from finite fields, ensuring that all operations are closed within a finite set, thus providing security guarantees for cryptographic protocols.

[0029] In this embodiment, the residue class ring refers to the integer ring modulo, whose elements are residue classes [0], [1], ..., [modulo-1]. Addition and multiplication are defined as modulo operations. When the modulus is a prime number p, the residue class ring degenerates into a finite field; however, when the modulus is a composite number (e.g., modulus = p), the ring degenerates into a finite field.k When k≥2), it is a non-domain ring. In this application, the residual class ring refers to Z / p k Z (k>1), i.e., modulo p k The ring, whose elements can be represented by a p-adduct expansion. In this application, k is 2, that is, the residue class ring is Z / p. 2 Z, module p 2 The ring. When encrypting data, the remaining class ring can be used to construct a lifting map, by utilizing the modulus p. 2 The above operation can be decomposed into iterative calculations modulo p to reduce the overall encryption complexity and thus improve encryption efficiency.

[0030] In this embodiment, the data to be encrypted is encrypted based on a lifting mapping relationship established between a twisted Edwards curve on a finite field and a twisted Edwards curve on the remaining ring-like structure. This lifting mapping relationship refers to establishing a lifting mapping from a twisted Edwards curve defined on a finite field to a twisted Edwards curve defined on the remaining ring-like structure. Specifically, in an affine coordinate system, the lifting mapping maintains an adjustment of the ordinate of h1p through a P-adjustment-based lifting operation. Here, h1 represents the adjustment coefficient of the ordinate, and this adjustment coefficient is associated with the coordinates of the point on the twisted Edwards curve on the finite field to be mapped onto the twisted Edwards curve on the remaining ring-like structure.

[0031] P-base numbers are an important mathematical tool in number theory. Their core idea is to construct a completely new number system structure based on a fixed prime number p. This provides a method of number system construction entirely different from that of real numbers, using a "base expansion" based on the prime number p to analyze the local behavior of integers and rational numbers under the prime number p. P-base numbers define their absolute value through p-base assignment: for any non-zero rational number x, it can be expressed as a power of p multiplied by a fraction coprime to p, where v is the p-base assignment. p(x) That is, the exponent of that power, and the absolute value of p-p is defined as |x|p=p {-v_p(x)} This means that when x contains more factors of p (e.g., x is divisible by higher powers of p), its p-advanced absolute value is actually smaller, which is the exact opposite of the behavior of the absolute value of a real number. (P-advanced field Q) p This is obtained by completing rational numbers with respect to this p-advanced absolute value, where each element can be uniquely represented as a p-advanced open form extending infinitely to the left, such as ... + a²p. 2 +a1p+a0+a {-1} p {-1} +..., coefficient a iAll values ​​are taken from the integer range of 0 to p-1. This expansion direction contrasts sharply with the characteristic of real decimals extending to the right, giving P-bases a unique advantage in analyzing the power behavior of integers modulo p, and in progressively increasing the solutions modulo p to higher modulos p. k It plays a key role in solving the problem.

[0032] In this embodiment, P-base is used to expand the ordinate of a point on a twisted Edwards curve on the residual ring-like structure. Specifically, when establishing a lifting mapping relationship between a twisted Edwards curve in a finite field and a twisted Edwards curve on the residual ring-like structure, a point on the twisted Edwards curve on the residual ring-like structure is randomly selected as the third curve point (x, y). When mapping the fourth curve point (x′, y′) in the finite field to the third curve point (x, y) on the residual ring-like structure with x = x′ as the solution condition, a P-base expansion of the ordinate y of the third curve point is required. By expanding the ordinate y using P-base, the complex curve point mapping problem can be decomposed into a solution problem of multiple terms with different powers of p, thereby simplifying the processing of the mapping equation. At the same time, the conditions of the curve equation can be satisfied step by step at different powers of p, thus ensuring that the mapped point satisfies the equation of the twisted Edwards curve on the residual ring-like structure.

[0033] In affine coordinates, the P-advanced lifting operation can "lift" coordinate elements in a finite field to their corresponding elements in the residual ring of classes without coordinate transformation. This lifting is achieved directly through the P-advanced lifting operation, avoiding the additional overhead caused by the asymmetry of the curve form. Specifically, the symmetry of the twisted Edwards curve equation ensures that the derivative in the lifting mapping is non-zero, demonstrating that the P-advanced lifting operation can be performed on the twisted Edwards curve in a finite field, making the calculation of the adjustment h1p more direct. Simultaneously, the calculation of subsequent class functions is easier to handle in the residual ring of classes, reducing the modular inverse operation during encryption. This advantage stems from the inherent geometric properties of the twisted Edwards curve: it has no singularities in the affine plane, and all points can be represented by finite coordinates, making the iterative process of the lifting mapping (e.g., from modulo p to modulo p) easier. 2 It only requires linear adjustments, rather than high-order iterations, thereby improving encryption speed while maintaining security.

[0034] In this embodiment, the relationship between the public and private keys is established through scalar multiplication on an elliptic curve. Based on a twisted Edwards curve over a finite field, the private and public keys can be generated. Specifically, a random integer d between 0 and q1 can be generated as the private key, where q represents the order in the twisted Edwards curve parameters. Then, the private key d is used to generate the public key Q. This is achieved by performing a scalar multiplication operation between the base point G of the twisted Edwards curve parameters and the private key d to obtain the generated public key Q = [d]G, where Q ∈ ET.ed (Fp), G∈E ed (Fp), where Q represents the public key and G represents the base point in the parameters of the twisted Edwards curve. [] denotes scalar multiplication, which means multiplying a point on the twisted Edwards curve by an integer (scalar). Essentially, it involves repeatedly adding that point along the twisted Edwards curve multiple times, the number of times determined by the value of the scalar. For example, if the scalar is d and the curve point is C1, then [d]C1 means adding point C1 to itself d times.

[0035] In short, the private key is the base from which the public key is generated, and the public key is the result of scalar multiplication of the private key and the base. This relationship allows the private key to be used for decryption, while the public key is used for encryption. Furthermore, it is difficult to deduce the private key from the public key, thus ensuring the security of data encryption.

[0036] Specifically, by utilizing the twisted Edwards curve parameters, points on the twisted Edwards curve over a finite field can be generated as partial ciphertext. Specifically, a random number r between 0 and q1 can be generated, and this random number, along with the twisted Edwards curve parameters, can be used to generate points C1 = r[G]∈E. ed (Fp), C1 represents a portion of the ciphertext, which can be used to construct the complete ciphertext. For ease of description, the portion of the ciphertext represented by C1 can be called the second sub-ciphertext.

[0037] In this embodiment, the public key can be used to generate the first curve point on the distorted Edwards curve over a finite field. Specifically, the first curve point C2=[r]Q∈E can be generated using a random number r and the public key. ed (Fp), C2 represents the twisted Edwards curve E over a finite field. ed The first curve point on (Fp) can be used to encrypt the data to be encrypted to obtain encrypted ciphertext, which can be called the first sub-ciphertext. It can be combined with the second sub-ciphertext mentioned above to form a complete ciphertext.

[0038] For ease of description, the points on the twisted Edwards curve over a finite field can be called the first curve points, and the points on the twisted Edwards curve over the remaining ring can be called the second curve points.

[0039] In this embodiment, based on the lifting mapping relationship described in the above embodiments, the first curve point can be lifted and mapped to a second curve point on the twisted Edwards curve on the residual ring-like curve. Specifically, the point sets on the twisted Edwards curve in the finite field and the twisted Edwards curve on the residual ring-like curve are not entirely one-to-one correspondences, but through a specific lifting mapping relationship, each point on the finite field curve can be uniquely lifted to a specific point on the residual ring-like curve.

[0040] Furthermore, algebraic features are extracted from the second curve point using a mapping function, and inverse transformation is performed on the algebraic features to obtain the class function of the second curve point. The class function of the second curve point can be calculated using the following formula (1), which prepares for further encryption of the first data to be encrypted using the class function of the second curve point:

[0041] b= (1)

[0042] in, Indicates the second curve point, Let represent the first curve point, q represent the order of the twisted Edwards curve over the finite field, Φ represent the lifting mapping from the twisted Edwards curve over the finite field to the twisted Edwards curve over the remaining class ring; b represent the class function of the second curve point, f represent the mapping function, and modp represent the modulus p.

[0043] Where [q]ΦC2 represents the lifting mapping of the first curve point followed by q. - Multiplication point calculation. Algebraic features are numerical attributes extracted from the coordinates of the second curve points, reflecting their algebraic structure. Taking the second curve point as the input point, the extraction operation is performed through the mapping function f to input the algebraic feature. Inverse transformation calculation refers to multiplying the algebraic feature f([q]ΦC2) by the multiplicative inverse q modulo p. −1 modp, a class function for obtaining the second curve point =b.

[0044] Furthermore, the class function of the second curve point can be used to encrypt the first data to be encrypted to obtain the first sub-ciphertext. The encrypted first sub-ciphertext possesses additive homomorphic encryption properties.

[0045] The aforementioned homomorphic encryption can include various implementation methods such as encryption with additive homomorphic properties or encryption with multiplicative homomorphic properties. As an optional implementation method, when the class function of the second curve point is used to encrypt the first data to be encrypted, it can be implemented as encryption with additive homomorphic properties. Then, the method of encrypting the first data to be encrypted using the class function of the second curve point to obtain the first sub-ciphertext can be to add the class function of the first curve point to the first data to be encrypted to obtain the first sub-ciphertext. Specifically, the first sub-ciphertext can be calculated using the following formula (2):

[0046] c = m + b mod p (2)

[0047] Where c represents the first sub-ciphertext, m represents the first data to be encrypted, b represents the class function of the second curve, mod represents the modulo operation, and p represents the parameter for distorting the Edwards curve.

[0048] Optionally, when encrypting the first data to be encrypted using the class function of the second curve point, it can be implemented as encryption with multiplicative homomorphic properties. Then, the first sub-ciphertext is obtained by encrypting the first data to be encrypted using the class function of the second curve point. Specifically, the first sub-ciphertext can be calculated using the following formula (3):

[0049] c=mbmodp(3)

[0050] Where c represents the first sub-ciphertext, m represents the first data to be encrypted, b represents the class function of the second curve, mod represents the modulo operation, and p represents the parameter for distorting the Edwards curve.

[0051] Furthermore, output ciphertext .in, This indicates that the public key (pk) is used to perform an encryption operation on the plaintext m (i.e., the first data to be encrypted); = This indicates that the ciphertext C consists of two components: Let c denote the twisted Edwards curve point on the finite field (i.e., the second sub-ciphertext), and let c denote the first sub-ciphertext generated by the class function based on the second curve point.

[0052] In an optional embodiment, establishing a lifting mapping relationship between a twisted Edwards curve on a finite field and a twisted Edwards curve on a residual ring-like structure includes: randomly selecting any curve point on the twisted Edwards curve on the residual ring-like structure as a third curve point (x, y), and randomly selecting any curve point on the twisted Edwards curve on the finite field as a fourth curve point (x′, y′); using x=x′ as the solution condition and mapping the fourth curve point (x′, y′) to the third curve point (x, y) as the objective, solving the mapping equation to obtain the adjustment coefficient that maps the ordinate of the fourth curve point to the ordinate of the third curve point. The expression is related to the coordinates of the fourth curve point (x′, y′); based on the adjustment coefficient... Given the expression and the prime number p, calculate the adjustment amount h1p for the ordinate of the fourth curve point; based on the adjustment amount h1p, use the fourth curve point (x′, y′) to re-express the coordinates of the third curve point as (x′, y′). This is used to obtain the lifting mapping relation, which is represented as (x′, y′) → (x′, y′). ).

[0053] Specifically, any point on the twisted Edwards curve on the remaining class ring is randomly selected as the third curve point (x, y) to select a starting point on the remaining class ring and provide a target position for the subsequent mapping relationship; any point on the twisted Edwards curve on the finite field is randomly selected as the fourth curve point (x′, y′) to select a starting point on the finite field and establish a correspondence with the point on the remaining class ring.

[0054] This approach avoids simultaneously solving the coupled equations for x and y, reducing the problem to a single-variable linear equation. A mapping equation is established to transform the fourth curve point on the finite field into a third curve point on the residual ring. Using x = x′ as the solution condition, the adjustment coefficient for mapping the ordinate of the fourth curve point to the ordinate of the third curve point can be derived. The expression describes how the ordinate y′ of a curve point on a finite field is adjusted to obtain the ordinate y of a curve point on the residual ring. Since different fourth curve points (x′, y′) have different coordinates, the expression for the adjustment coefficient h1 is related to the coordinates of the fourth curve point.

[0055] Furthermore, after obtaining the adjustment coefficient h1, the adjustment amount of the ordinate is calculated as h1p using the prime number p of the finite field. This is because the order of the finite field is p, and in the sense of modulus p, the adjustment amount h1p can be used to adjust the ordinate of the finite field to the residual ring.

[0056] Based on the adjustment h1p, the coordinates of the third curve point are re-expressed as (x′, y′) using the fourth curve point (x′, y′). This is used to obtain the lifting mapping relation, which is represented as (x′, y′) → (x′, y′). The expression () indicates that when mapping the fourth curve point (x′, y′) on the finite field to the third curve point on the residual ring, the x-coordinate remains x′, while the y-coordinate is adjusted to y′+h1p. This mapping relationship "lifts" the curve point on the twisted Edwards curve from the finite field to the residual ring. Furthermore, due to the introduction of the adjustment h1p, it is guaranteed that the lifted point satisfies the equation of the twisted Edwards curve on the residual ring and maintains a connection with the point on the finite field. For example, if the fourth curve point is (2, 3), the adjustment coefficient h1 is calculated to be 1, and the prime number p=5, then the adjustment is 1×5=5, and the y-coordinate of the lifted third curve point is 3+5=8 (further modulo operations may be needed in the residual ring, depending on the modulus of the residual ring). Through the above process, a lifting mapping relationship can be established between the twisted Edwards curve on the finite field and the twisted Edwards curve on the residual ring, providing a basic mathematical tool and conversion mechanism for subsequent cryptographic applications, such as encryption.

[0057] In an optional embodiment, the mapping equation is solved with x=x′ as the solution condition and the goal of mapping the fourth curve point (x′, y′) to the third curve point (x, y) as the objective, so as to obtain the adjustment coefficient that maps the ordinate of the fourth curve point to the ordinate of the third curve point. The expression includes: the mapping equation f(x,y) = f(x,y) constructed from the third curve point (x,y) on the finite field to the distorted Edwards curve on the remaining class ring. Where a and d represent the parameters of the twisted Edwards curve on the residual ring; the ordinate y of the third curve point is expanded using a p-adjacent expansion with respect to the prime number p to obtain the expression for the ordinate y as y = ;in, This represents the constant term of the ordinate y modulo p, i.e., y ≡ mod p, h2 represents the ordinate y in mod p. 3 The coefficient of the quadratic term at time, Represents a higher-order power term of p; using x=x′ as the solution condition, x′, y= Substituting into the mapping equation, and solving the equation modulo the square of a prime number p, we obtain the expression for the adjustment coefficient of the ordinate: .

[0058] in, Indicates y in the modulus p 2 The coefficient of the linear term when y ≡ + pmodp 2 Higher-order terms use O(p) 3 The symbol ≡ indicates that two numbers have the same remainder when modulo a certain number. For example, a≡b(modm) means that a−b is a multiple of m, i.e., m∣(a−b).

[0059] In an optional embodiment, x=x′ is used as the solution condition, and x′, y= Substituting into the mapping equation, and solving the equation modulo the square of a prime number p, we obtain the expression for the adjustment coefficient of the ordinate: This includes: using x=x′ as the solution condition, and setting x′ and y= Substituting into the mapping equation, we get the first equation to be solved:

[0060] f(x′,y)=ax′ 2 +( ) 2 −1−dx′ 2 ( ) 2

[0061] Grouping and rearranging by powers of p, we get:

[0062] f(x′,y)=[a(x′) 2 +h0 2 −1−d(x′) 2 h0 2 ]+[2h0h1−2d(x′) 2 h0h1]p+[(2h0h2+h1 2 )−d(x′) 2 (2h0h2+h1 2 )]p 2 +O(p 3 )

[0063] Where, [a(x′)] 2 +h0 2 −1−d(x′) 2 h0 2 ] is a constant term (p) 0 ), [2h0h1−2d(x′) 2 h0h1]p is a linear term (p 1 ), [(2h0h2+h1 2 )−d(x′) 2 (2h0h2+h1 2 )]p 2 For the quadratic term (p) 2 ).

[0064] The first equation to be solved is f(x′,y)=[a(x′)]. 2 +h0 2 −1−d(x′) 2 h0 2 ]+[2h0h1−2d(x′) 2 h0h1]p+[(2h0h2+h1 2 )−d(x′) 2 (2h0h2+h1 2 )]p 2 +O(p 3 Using 0 as a condition for solving the problem, we solve the first equation and obtain the constant term h0 = ;when ,but Substituting the constant term h0 into the first equation to be solved, we obtain the second equation to be solved: f(x′,y′)=ax′ 2 +y′ 2 −1−dx′ 2 y′ 2 .

[0065] Using the condition that the second equation is congruent to 0 modulo the square of a prime number p, we solve the second equation as follows: f(x′,y′)=ax′ 2 +y′ 2 −1−dx′ 2 y′ 2 ≡0(modp).

[0066] Therefore, f(x′, y′) is an integer multiple of p, denoted as f(x′, y′) = kp, where k is a random number.

[0067] The solution process for the second equation is as follows:

[0068] Substitute f(x′, y′) = kp into f(x′, y′) = ax′ 2 +y′ 2 −1−dx′ 2 y′ 2 ≡0 (mod p), and extract the term once to get:

[0069] f(x′,y′)=kp+2y′h1p(1−dx′ 2 )+p 2 [2y′h2(1−dx′ 2 )+h1 2 (1−dx′ 2 )]+O(p 3 )=kp+2y′h1p(1−dx′ 2 )+p 2 ⋅M+O(p 3 )

[0070] Where M=2y′h 2 (1−dx′ 2 )+h1 2 (1−dx′ 2 ) represents the coefficient of the second-order term.

[0071] For f(x′,y′)=kp+2y′h1p(1−dx′) 2 )+p 2 [2y′h2(1−dx′ 2 )+h1 2 (1−dx′ 2 )]+O(p 3 )=kp+2y′h1p(1−dx′ 2 )+p 2 ⋅M+O(p 3 Application Model p 2 After applying the congruence condition, we obtain:

[0072] k+2y′h1(1−dx′ 2 )≡0(modp)

[0073] k+2y′h1(1−dx′) 2 )≡0(mod p) rearranged to:

[0074] 2y′h1(1−dx′ 2 )≡−k(mod p)

[0075] Since the distorted Edwards curve is nonsingular and the cryptographic parameters ensure y′=0 and x′2=1 / d(mod p), the denominator 2y′h1(1−dx′) is... 2 It is invertible in a finite field.

[0076] Furthermore, solve 2y′h1(1−dx′) 2 )≡−k(mod p), we get:

[0077] h1≡ (modp)

[0078] Since f(x′, y′) = kp, we get k = f(x′, y′) / p. Substituting k = f(x′, y′) / p into h1≡ (modp), the expression for the adjustment factor of the ordinate is:

[0079] .

[0080] Through the above process, the fourth curve point (x′, y′) on the finite field is mapped to the third curve point (x′, y′+h1p) on the remaining ring-like structure, thus establishing a lifting mapping relationship. During the mapping process, the abscissa x′ remains unchanged, meaning that no complex calculations or adjustments to the abscissa are required. This direct lifting mapping reduces computational steps and simplifies the operation. Furthermore, the ordinate y′ is lifted through a simple linear adjustment, i.e., adding an adjustment amount h1p to the original ordinate y′. This adjustment amount h1p is pre-calculated, and the expression for h1 is related to the parameters of the distorted Edwards curve and the coordinates of the point on the finite field. However, once determined, the calculation process becomes direct and efficient.

[0081] More importantly, by using P-advanced expansion, the mapping equation can be solved step by step under different moduli. This step-by-step solution method decomposes the problem of solving complex nonlinear equations into multiple simple linear problems, thereby reducing computational complexity.

[0082] The simplicity of the lifting mapping relationship makes it efficient and easy to lift and map curve points on a twisted Edwards curve over a finite field to curve points on a twisted Edwards curve over a remaining ring-like structure. Therefore, encrypting the first data to be encrypted based on the lifting mapping relationship can significantly reduce the computational overhead in the encryption process and thus improve encryption efficiency.

[0083] In one optional embodiment, a fifth curve point on a twisted Edwards curve over a finite field is determined based on the second data to be encrypted. This fifth curve point is then lifted and mapped to a sixth curve point on a twisted Edwards curve over a residual ring based on a lifting mapping relationship. Algebraic features are extracted from the sixth curve point using a mapping function, and inverse transformations are performed on these features to obtain a class function for the sixth curve point. The class function of the sixth curve point is used to encrypt the second data to obtain a third sub-ciphertext. The third and fourth sub-ciphertexts constitute the second ciphertext. The fourth sub-ciphertext is generated based on the parameters of the twisted Edwards curve over the finite field. The first and second ciphertexts are summed to obtain the third ciphertext. The third ciphertext is sent to the decryptor for decryption to obtain the third data to be encrypted. The third data to be encrypted is the sum of the first and second data to be encrypted.

[0084] The detailed implementation methods and beneficial effects of each step in the method of this embodiment for encrypting the second data to be encrypted to obtain the second ciphertext are the same as the step for encrypting the first data to be encrypted to obtain the first ciphertext in the previous embodiment, and this step has been described in detail in the previous embodiment, so it will not be elaborated here.

[0085] The result obtained by adding and decrypting the first and third sub-ciphertexts is consistent with the result obtained by directly adding the first and second data to be encrypted. By using the above-mentioned encryption method with additive homomorphic properties to encrypt the data to be encrypted, it is possible to directly add the multiple ciphertexts obtained by encrypting multiple data to be encrypted during data transmission. Decrypting the result of this addition will yield the same result as adding multiple data to be encrypted, avoiding decryption of ciphertexts during data transmission and preventing data leakage. This method is applicable to data transmission scenarios including untrusted environments, such as cloud environments. Furthermore, the data encryption method based on the lifting mapping relationship in this embodiment, which performs homomorphic encryption, can significantly reduce the computational overhead in the homomorphic encryption process, thereby improving encryption efficiency.

[0086] Optionally, for the ciphertext C=(C1, c) obtained by encrypting the plaintext m (i.e., the data to be encrypted), and for any constant k∈M, we have k·C=([k] C1, kcmod p). This equation shows that the result obtained by decrypting the ciphertext C after performing a scalar multiplication operation k·C is consistent with the result obtained by encrypting the plaintext m after performing a scalar multiplication operation km. By using the above encryption method with the homomorphic property of scalar multiplication to encrypt the data to be encrypted, it is possible to efficiently complete [k] C1 (curve point scalar multiplication) and kcmod p (modulo operation) directly in the ciphertext domain when a scalar multiplication operation needs to be performed on the ciphertext during data transmission and processing, without decryption and calculation first. Decrypting the result of this scalar multiplication operation can accurately restore the value of km, effectively avoiding the risk of data leakage caused by decryption in an untrusted environment.

[0087] In particular, in scenarios such as privacy-preserving machine learning and secure outsourced computing, data owners can upload encrypted data to a cloud server and authorize the cloud server to directly perform scalar multiplication operations (such as weight adjustment, feature scaling and other key operations) on the ciphertext according to the method in the embodiments of this application without accessing the original data. This maintains data confidentiality and significantly reduces the local computing burden, providing a cryptographic basis for resource-constrained devices to achieve efficient and secure privacy-preserving computing in the cloud environment.

[0088] Figure 2 This is a flowchart illustrating a data decryption method provided as an exemplary embodiment of this application. Figure 2 As shown, the method includes:

[0089] S201. Obtain the first ciphertext and the second ciphertext; the first ciphertext and the second ciphertext are obtained by encrypting them using any one of the data encryption methods;

[0090] S202. Add the first ciphertext and the second ciphertext together to obtain the third ciphertext;

[0091] S203. Send the third ciphertext to the decryptor so that the decryptor can decrypt the third ciphertext to obtain the decrypted data, which is the sum of the first data to be encrypted and the second data to be encrypted.

[0092] The detailed implementation methods and beneficial effects of steps S201-S202 in this embodiment have been described in detail in the foregoing embodiments, and will not be elaborated here.

[0093] In this embodiment, the decryptor is a trusted entity holding the private key, capable of performing lifting mappings and function-like computations; this is not limited to this entity. For example, it could be an authorized decryption module in a cloud server or an IoT gateway. Through the aforementioned data decryption method, the decryptor can directly perform addition operations on the ciphertext and verify the result without decrypting the original data. Its core function is to achieve secure computation that is "usable but not visible," protecting data privacy while supporting secure aggregation of data from multiple parties and avoiding the risk of key exposure due to intermediate decryption.

[0094] For example, suppose p=17, public key=3, private key=6. Encrypting data: First ciphertext D1=2, C1=2*3=6 mod 17; Second ciphertext D2=3, C2=3*3=9 mod 17. The summation ciphertext is C3=C1+C2=6+9=15 mod 17. Decrypting ciphertext: D=15*6=90 mod 17=90-5*17=90-85=5 mod 1. Therefore, the decrypted result 5 equals first ciphertext D1+second ciphertext D2=2+3=5, demonstrating additive homomorphism.

[0095] Figure 3 This is a flowchart illustrating another data decryption method provided as an exemplary embodiment of this application. Figure 3 As shown, the method includes:

[0096] S301. Obtain the first ciphertext; the first ciphertext is obtained by encrypting the first data to be encrypted using any of the data encryption methods; the first ciphertext includes a first sub-ciphertext and a second sub-ciphertext; the second sub-ciphertext is generated based on the parameters of the distorted Edwards curve over a finite field;

[0097] S302. Calculate the first decryption curve point of the twisted Edwards curve over the finite field using the private key and the second sub-ciphertext.

[0098] S303. Based on the lifting mapping relationship between the twisted Edwards curve on the finite field and the twisted Edwards curve on the residual ring, the decryption curve point is lifted and mapped to the second decryption curve point on the twisted Edwards curve on the residual ring.

[0099] S304. Extract algebraic features from the second decryption curve point using a mapping function, and perform inverse transformation calculation on the algebraic features to obtain the class function of the second decryption curve point.

[0100] S305. Use the class function of the second decryption curve point to decrypt the first sub-ciphertext to obtain the first data to be encrypted.

[0101] The detailed implementation and beneficial effects of step S301 in this embodiment have been described in detail in the foregoing embodiments, and will not be elaborated here.

[0102] Specifically, the first decryption curve point of the twisted Edwards curve over a finite field is calculated using the private key d and the second sub-ciphertext. Specifically, the first decryption curve point of the twisted Edwards curve over a finite field can be calculated using the private key and the second sub-ciphertext according to the following formula (4):

[0103] C1'=[d]C1(4)

[0104] Where C1' represents the first decryption curve point, d represents the private key, and C1 represents the second sub-ciphertext.

[0105] In this embodiment, based on the lifting mapping relationship between the twisted Edwards curve on the finite field and the twisted Edwards curve on the residual ring-like structure, the first decryption curve point is lifted and mapped to the second decryption curve point on the twisted Edwards curve on the residual ring-like structure. The second decryption curve point can be calculated according to the following formula (5):

[0106] = (5)

[0107] in, C1' represents the decryption point of the second elliptic curve, C1' represents the decryption point of the first curve, q represents the order of the twisted Edwards curve over the finite field, and Φ represents the lifting mapping between the twisted Edwards curve over the finite field and the twisted Edwards curve over the remaining ring class.

[0108] In this embodiment of the application, after determining the second decryption curve point, algebraic features can be extracted from the second decryption curve point through a mapping function, and inverse transformation calculation can be performed on the algebraic features to obtain the class function of the second decryption curve point. The class function of the second decryption curve point is used for decryption, and the class function of the second decryption curve point can be calculated using the following formula (6):

[0109] (6)

[0110] in, Let f denote the class function of the second decryption curve point, modp denote the modulus p; Φ denotes the lifting mapping from the twisted Edwards over the finite field to the twisted Edwards over the remaining class ring. C1' represents the decryption point of the second elliptic curve, and C1' represents the decryption point of the first elliptic curve.

[0111] In this embodiment, the method of extracting algebraic features from the second decryption curve point through a mapping function and performing inverse transformation calculation on the algebraic features is the same as the implementation method in the previous embodiment of extracting algebraic features from the second curve point through a mapping function and performing inverse transformation calculation on the algebraic features to obtain the class function of the second curve point. The detailed implementation method and beneficial effects have been described in detail in the previous embodiment, and will not be elaborated here.

[0112] Specifically, decryption using the class function at the second decryption curve point allows for the decryption of the first sub-ciphertext according to the decryption method corresponding to the encryption method. In this embodiment, the decryption method using the class function at the second decryption curve point to decrypt the first sub-ciphertext can be implemented in multiple ways.

[0113] As an optional implementation, the first data to be encrypted can be obtained by adding the first sub-ciphertext to the class function of the second decryption curve point. Specifically, m=c modp, where m represents the first data to be encrypted and c represents the first sub-ciphertext. The class function represents the second decryption curve point, mod represents the modulo operation, and p represents the parameter for distorting the Edwards curve.

[0114] As an alternative implementation, the first data to be encrypted can be obtained by multiplying the first sub-ciphertext by a class function at the second decryption curve point. Alternatively, the quotient can be calculated using the class function at the second decryption curve point to obtain the first data to be encrypted. Specifically, m=c 1 modp, where m represents the first data to be encrypted and c represents the first sub-ciphertext. The class function represents the second decryption curve point, mod represents the modulo operation, and p represents the parameter for distorting the Edwards curve.

[0115] The detailed implementation methods and beneficial effects of each step in this embodiment have been described in detail in the foregoing embodiments, and will not be elaborated here.

[0116] Furthermore, some processes described in the above embodiments and accompanying drawings include multiple operations appearing in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0117] Figure 4 This is a schematic diagram of an electronic device structure provided for an exemplary embodiment of this application. For example... Figure 3 As shown, the electronic device includes: a memory 44 and a processor 45.

[0118] Memory 44 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device, first data to be encrypted, first curve points, and class functions, etc.

[0119] The memory 44 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0120] Processor 45, coupled to memory 44, is used to execute computer programs in memory 44 for: establishing a lifting mapping relationship between a twisted Edwards curve on a finite field and a twisted Edwards curve on the residual ring-like structure, wherein the lifting mapping relationship is such that, in affine coordinates, the adjustment of the ordinate is h1p based on a P-adjustment-based lifting operation; where h1 represents the adjustment coefficient of the ordinate, and the adjustment coefficient is associated with the coordinates of the point on the twisted Edwards curve on the finite field to be mapped to the twisted Edwards curve on the residual ring-like structure; p represents a prime number; based on the common... The key determines the first curve point on the twisted Edwards curve over a finite field. Based on the lifting mapping relation, the first curve point is lifted and mapped to a second curve point on the twisted Edwards curve over the remaining class ring. Algebraic features are extracted from the second curve point through the mapping function, and inverse transformation is performed on the algebraic features to obtain the class function of the second curve point. The class function of the second curve point is used to encrypt the first data to be encrypted to obtain the first sub-ciphertext. The first sub-ciphertext and the second sub-ciphertext constitute the first ciphertext. The second sub-ciphertext is generated based on the parameters of the twisted Edwards curve over the finite field.

[0121] In an optional embodiment, the processor 45 establishes a lifting mapping relationship between a twisted Edwards curve on a finite field and a twisted Edwards curve on a residual ring-like structure, including: randomly selecting any curve point on the twisted Edwards curve on the residual ring-like structure as a third curve point (x, y), and randomly selecting any curve point on the twisted Edwards curve on the finite field as a fourth curve point (x′, y′); using x=x′ as the solution condition and mapping the fourth curve point (x′, y′) to the third curve point (x, y) as the objective, solving the mapping equation to obtain the adjustment coefficient that maps the ordinate of the fourth curve point to the ordinate of the third curve point. The expression is related to the coordinates of the fourth curve point (x′, y′); based on the adjustment coefficient... Given the expression and the prime number p, calculate the adjustment amount h1p for the ordinate of the fourth curve point; based on the adjustment amount h1p, use the fourth curve point (x′, y′) to re-express the coordinates of the third curve point as (x′, y′). This is used to obtain the lifting mapping relation, which is represented as (x′, y′) → (x′, y′). ).

[0122] In an optional embodiment, the processor 45 solves the mapping equation with x=x′ as the solution condition and the goal of mapping the fourth curve point (x′, y′) to the third curve point (x, y) as the objective, in order to obtain the adjustment coefficient that maps the ordinate of the fourth curve point to the ordinate of the third curve point. The expression includes: the mapping equation f(x,y) = f(x,y) constructed from the third curve point (x,y) on the finite field to the distorted Edwards curve on the remaining class ring. Where a and d represent the parameters of the twisted Edwards curve on the residual ring; the ordinate y of the third curve point is expanded using a p-adjacent expansion with respect to the prime number p to obtain the expression for the ordinate y as y = ;in, h2 represents the constant term of the ordinate y modulo p, and h2 represents the constant term of the ordinate y modulo p. 3 The coefficient of the quadratic term at time, Represents a higher-order power term of p; using x=x′ as the solution condition, x′, y= Substituting into the mapping equation, and solving the equation modulo the square of a prime number p, we obtain the expression for the adjustment coefficient of the ordinate: .

[0123] In an optional embodiment, the processor 45 uses x=x′ as the solution condition, and calculates x′, y= Substituting into the mapping equation, and solving the equation modulo the square of a prime number p, we obtain the expression for the adjustment coefficient of the ordinate: This includes: using x=x′ as the solution condition, and setting x′ and y= Substitute the values ​​into the mapping equation to obtain the first equation to be solved. Using the condition that the first equation equals 0, solve the first equation to obtain the constant term h0. Substitute the constant term h0 into the first equation to obtain the second equation to be solved. Using the condition that the second equation is congruent to 0 in the modulo operation of the square of a prime number p, solve the second equation to obtain the expression for the adjustment coefficient of the ordinate: .

[0124] In an optional embodiment, the processor 45 determines a fifth curve point on a twisted Edwards curve over a finite field based on the second data to be encrypted, and performs a lifting mapping on the fifth curve point to a sixth curve point on a twisted Edwards curve over a residual ring; it extracts algebraic features from the sixth curve point using a mapping function and performs inverse transformation calculations on the algebraic features to obtain a class function for the sixth curve point; it uses the class function of the sixth curve point to encrypt the second data to be encrypted to obtain a third sub-ciphertext; the third sub-ciphertext and the fourth sub-ciphertext constitute the second ciphertext; the fourth sub-ciphertext is generated based on the parameters of the twisted Edwards curve over the finite field; the first ciphertext and the second ciphertext are summed to obtain the third ciphertext; the third ciphertext is sent to the decryptor for decryption to obtain the third data to be encrypted; wherein the third data to be encrypted is the sum of the first data to be encrypted and the second data to be encrypted.

[0125] In an optional embodiment, the processor 45 acquires a first ciphertext and a second ciphertext; the first ciphertext and the second ciphertext are encrypted using any of the data encryption methods; the first ciphertext and the second ciphertext are summed to obtain a third ciphertext; the third ciphertext is sent to the decryptor so that the decryptor can decrypt the third ciphertext to obtain decrypted data, which is the sum of the first data to be encrypted and the second data to be encrypted.

[0126] In an optional embodiment, the processor 45 acquires a first ciphertext; the first ciphertext is obtained by encrypting a first data to be encrypted using any of the data encryption methods; the first ciphertext includes a first sub-ciphertext and a second sub-ciphertext; the second sub-ciphertext is generated based on the parameters of a twisted Edwards curve over a finite field; a first decryption curve point of the twisted Edwards curve over the finite field is calculated using the private key and the second sub-ciphertext; based on the lifting mapping relationship between the twisted Edwards curve over the finite field and the twisted Edwards curve over the residual ring class, the first decryption curve point is lifted and mapped to a second decryption curve point on the twisted Edwards curve over the residual ring class; algebraic features are extracted from the second decryption curve point using a mapping function, and inverse transformation calculation is performed on the algebraic features to obtain the class function of the second decryption curve point; the class function of the second decryption curve point is used to decrypt the first sub-ciphertext to obtain the first data to be encrypted.

[0127] Furthermore, such as Figure 4 As shown, the electronic device also includes other components such as a communication component 46, a display 47, a power supply component 48, and an audio component 49. Figure 4 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 4 The components shown.

[0128] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be performed by an electronic device in the above method embodiments.

[0129] The above Figure 4 The communication component is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G / LTE, 5G, or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA) technology, Ultra-Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0130] The above Figure 4 The display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe action, but also the duration and pressure associated with the touch or swipe operation.

[0131] The above Figure 4 The power supply component provides power to the various components of the device in which it resides. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which it resides.

[0132] The above Figure 4 The audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0133] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0134] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0135] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0137] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0138] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0139] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0140] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0141] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A data encryption method, characterized in that, include: A lifting mapping relationship is established between a twisted Edwards curve over a finite field and a twisted Edwards curve over a residual ring-like structure. This lifting mapping relationship is established in an affine coordinate system by using a lifting operation based on P-adjustment to maintain the adjustment of the ordinate by h1p. Here, h1 represents the adjustment coefficient of the ordinate, and this adjustment coefficient is associated with the coordinates of the point on the twisted Edwards curve over the finite field to be mapped onto the twisted Edwards curve over the residual ring-like structure; p represents a prime number. Based on the public key, the first curve point on the twisted Edwards curve over the finite field is determined, and based on the lifting mapping relationship, the first curve point is lifted and mapped to the second curve point on the twisted Edwards curve over the remaining class ring. Algebraic features are extracted from the second curve point using a mapping function, and inverse transformation is performed on the algebraic features to obtain the class function of the second curve point. The first data to be encrypted is encrypted using a class function of the second curve point to obtain a first sub-ciphertext; the first sub-ciphertext and the second sub-ciphertext constitute the first ciphertext; the second sub-ciphertext is generated based on the parameters of the distorted Edwards curve over the finite field.

2. The method according to claim 1, characterized in that, The establishment of the lifting mapping relationship between the twisted Edwards curve over the finite field and the twisted Edwards curve over the remaining class ring includes: Randomly select any curve point on the twisted Edwards curve on the remaining class ring as the third curve point (x, y), and randomly select any curve point on the twisted Edwards curve on the finite field as the fourth curve point (x′, y′); Using x=x′ as the solution condition, and with the goal of mapping the fourth curve point (x′, y′) to the third curve point (x, y), the mapping equation is solved to obtain the adjustment coefficient that maps the ordinate of the fourth curve point to the ordinate of the third curve point. The expression is related to the coordinates of the fourth curve point (x′, y′); According to the adjustment coefficient Given the expression and the prime number p, calculate the adjustment amount of the ordinate of the fourth curve point as h1p; Based on the adjustment amount h1p, the coordinates of the third curve point are re-expressed as (x′, y′) using the fourth curve point (x′, y′). The lifting mapping relationship is obtained by (x′, y′) → (x′, y′). ).

3. The method according to claim 2, characterized in that, Using x=x′ as the solution condition, and with the goal of mapping the fourth curve point (x′, y′) to the third curve point (x, y), the mapping equation is solved to obtain the adjustment coefficient that maps the ordinate of the fourth curve point to the ordinate of the third curve point. The expressions include: Based on the third curve point (x, y), construct the mapping equation f(x, y) from the curve on the twisted Edwards curve over the finite field to the twisted Edwards curve over the remaining ring class. Where a and d represent the parameters of the twisted Edwards curve on the remaining class ring; Expanding the ordinate y of the third curve point using the prime number p in a P-base manner, we obtain the expression for the ordinate y as y = ;in, h2 represents the constant term of the ordinate y modulo p, and h2 represents the constant term of the ordinate y modulo p. 3 The coefficient of the quadratic term at time, This represents a higher-order power term of p; Using x=x′ as the solution condition, let x′ and y= Substituting into the mapping equation, and solving the equation modulo the square of a prime number p, we obtain the expression for the adjustment coefficient of the ordinate as follows: .

4. The method according to claim 3, characterized in that, Using x=x′ as the solution condition, let x′ and y= Substituting into the mapping equation, and solving the equation modulo the square of a prime number p, we obtain the expression for the adjustment coefficient of the ordinate as follows: ,include: Using x=x′ as the solution condition, let x′ and y= Substitute the given mapping equation as the first equation to be solved; Using the condition that the first equation to be solved is equal to 0, the first equation to be solved is solved to obtain the constant term h0; Substituting the constant term h0 into the first equation to be solved yields the second equation to be solved. Using the condition that the second equation is congruent to 0 in the modulo operation of the square of a prime number p, the second equation is solved, yielding the expression for the adjustment coefficient of the ordinate: .

5. The method according to claim 1, wherein Also includes: Based on the second data to be encrypted, the fifth curve point on the twisted Edwards curve over the finite field is determined, and the fifth curve point is lifted and mapped to the sixth curve point on the twisted Edwards curve over the remaining class ring based on the lifting mapping relationship. Algebraic features are extracted from the sixth curve point using a mapping function, and inverse transformation is performed on the algebraic features to obtain the class function of the sixth curve point. The second data to be encrypted is encrypted using the class function of the sixth curve point to obtain the third sub-ciphertext; the third sub-ciphertext and the fourth sub-ciphertext constitute the second ciphertext; the fourth sub-ciphertext is generated based on the parameters of the distorted Edwards curve over the finite field. The first ciphertext and the second ciphertext are added together to obtain the third ciphertext; The third ciphertext is sent to the decryptor so that the decryptor can decrypt the third ciphertext to obtain the third data to be encrypted; wherein, the third data to be encrypted is the sum of the first data to be encrypted and the second data to be encrypted.

6. A data decryption method, characterized in that, include: Obtain the first ciphertext and the second ciphertext; the first ciphertext and the second ciphertext are obtained by encryption using the method described in any one of claims 1-4; The first ciphertext and the second ciphertext are summed to obtain the third ciphertext. The third ciphertext is sent to the decryption party so that the decryption party can decrypt the third ciphertext to obtain decrypted data, which is the sum of the first data to be encrypted and the second data to be encrypted.

7. A data decryption method, characterized in that, include: Obtain the first ciphertext; the first ciphertext is obtained by encrypting the first data to be encrypted using the method described in any one of claims 1-4; the first ciphertext includes a first sub-ciphertext and a second sub-ciphertext; the second sub-ciphertext is generated based on the parameters of the distorted Edwards curve over a finite field; The first decryption curve point of the distorted Edwards curve over the finite field is calculated using the private key and the second sub-ciphertext. Based on the lifting mapping relationship between the twisted Edwards curve on the finite field and the twisted Edwards curve on the residual ring, the first decryption curve point is lifted and mapped to the second decryption curve point on the twisted Edwards curve on the residual ring. Algebraic features are extracted from the second decryption curve point using a mapping function, and inverse transformation is performed on the algebraic features to obtain the class function of the second decryption curve point. The first sub-ciphertext is decrypted using the class function of the second decryption curve point to obtain the first data to be encrypted.

8. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1-7.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method according to any one of claims 1-7.

10. A computer program product, characterized in that, Includes a computer program / instruction that, when executed by a processor, causes the processor to perform the steps of the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Data encryption method and data decryption method

    CN115834185A

  • Apparatus and method for generating public key and generating and verifying signature

    CN120226006A