Point pre-storage table generation method, decryption method and device, equipment and medium
Patent Information
- Application Number
- CN202311845273.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-12-28
AI Technical Summary
[0005]但是,若为安全性增加密码的复杂度,则椭圆曲线上点的数量较多,所以导致椭圆曲线存储点的预存表占用空间较大
Smart Images

Figure CN117792643B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to cryptography and cloud computing technologies. Specifically, it relates to a method for generating a point-based pre-stored table, a decryption method, and the apparatus, device, and medium thereof. Background Technology
[0002] Data security and privacy are currently hot topics in the field of data processing technology. To improve data privacy, encryption and decryption using keys are common methods in existing technologies. Among these, Elliptic Curve Cryptography (ECC) has seen rapid development in cryptography. ECC technology can be applied to homomorphic encryption to ensure the security of the data computation process and results.
[0003] An elliptic curve is a special type of curve that can be represented by an equation. A finite number of points satisfying this equation lie on the elliptic curve. These finite number of points constitute the finite field of the elliptic curve, which can be used for encryption and decryption operations. The Discrete Logarithm Problem (DLP) is to find the power of a given element in a finite group that equals the exponent of another given element. For the elliptic curve discrete logarithm problem, it is to determine the points on the elliptic curve and their multiples.
[0004] Because DLP computation on elliptic curves is computationally intensive, points on the elliptic curve are pre-calculated and stored to improve encryption and decryption efficiency. This allows the pre-calculated points to be used directly during encryption and decryption, reducing real-time computation and thus accelerating the process.
[0005] However, if the complexity of the password is increased for security, the number of points on the elliptic curve is large, which results in a large space occupied by the pre-stored table of elliptic curve storage points. Summary of the Invention
[0006] This disclosure provides a method for generating a point pre-stored table, a method for decrypting the table, and the apparatus, device, and medium thereof.
[0007] According to one aspect of this disclosure, a method for generating an elliptic curve point pre-store table is provided, comprising:
[0008] Calculate the coordinate data of all base points within a basic discrete interval on the elliptic curve and store them in a pre-stored table of base points;
[0009] Calculate the identifier data of interval points within each of one or more mapped discrete intervals on an elliptic curve, and store them in a pre-stored interval point table;
[0010] The base discrete interval and all points in each mapped discrete interval form the finite field of the elliptic curve; the points in the mapped discrete interval include interval points and multiple non-interval points; the difference between the coordinate data of any non-interval point in the mapped discrete interval and the coordinate data of the base point has a mapping relationship with the identification data of the interval point.
[0011] According to another aspect of this disclosure, an elliptic curve-based decryption method is provided, comprising:
[0012] Calculate the public key multiplier based on the private key generated from the elliptic curve and the first point in the ciphertext;
[0013] Calculate the encryption point based on the public key dot and the second point of the ciphertext;
[0014] Based on the pre-stored table of base points and the pre-stored table of mapped point intervals, determine whether the encrypted point is a point on the elliptic curve;
[0015] If the encryption point is a point on an elliptic curve, the ciphertext is decrypted based on the pre-stored table of base points, the pre-stored table of mapped point intervals, and the encryption point.
[0016] The base point pre-store table and the mapping point interval point pre-store table are generated using the elliptic curve point pre-store table generation method provided in any embodiment of this disclosure.
[0017] According to another aspect of this disclosure, an apparatus for generating an elliptic curve point pre-store table is provided, comprising:
[0018] The base point storage module is used to calculate the coordinate data of all base points within a basic discrete interval on the elliptic curve and store them in the base point pre-stored table.
[0019] The interval point storage module is used to calculate the identification data of interval points within each of one or more mapped discrete intervals on an elliptic curve and store them in the interval point pre-store table.
[0020] The base discrete interval and all points in each mapped discrete interval form the finite field of the elliptic curve; the points in the mapped discrete interval include interval points and multiple non-interval points; the difference between the coordinate data of any non-interval point in the mapped discrete interval and the coordinate data of the base point has a mapping relationship with the identification data of the interval point.
[0021] According to another aspect of this disclosure, an elliptic curve-based decryption apparatus is provided, comprising:
[0022] The public key multiplier determination module is used to calculate the public key multiplier based on the private key generated based on the elliptic curve and the first point in the ciphertext;
[0023] The encryption point determination module is used to calculate the encryption point based on the public key multiplier and the second point of the ciphertext;
[0024] The curve point determination module is used to determine whether the encrypted point is a point on the elliptic curve based on the base point pre-stored table and the interval point pre-stored table.
[0025] The ciphertext decryption module is used to decrypt ciphertext based on the base point pre-stored table, the interval point pre-stored table, and the encryption point if the encryption point is a point on an elliptic curve.
[0026] The base point pre-store table and the interval point pre-store table are generated using the elliptic curve point pre-store table generation device provided in any embodiment of this disclosure.
[0027] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0028] At least one processor; and
[0029] A memory that is communicatively connected to at least one processor; wherein,
[0030] The memory stores instructions that can be executed by at least one processor to enable the at least one processor to perform the methods provided in any embodiment of this disclosure.
[0031] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform the methods provided in any embodiment of this disclosure.
[0032] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0033] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0034] Figure 1 This is a flowchart of a method for generating an elliptic curve point pre-store table according to an embodiment of this disclosure;
[0035] Figure 2 This is a flowchart of another method for generating an elliptic curve point pre-store table according to an embodiment of this disclosure;
[0036] Figure 3 This is a flowchart of another method for generating an elliptic curve point pre-store table according to an embodiment of this disclosure;
[0037] Figure 4This is a flowchart of an elliptic curve-based decryption method provided according to an embodiment of the present disclosure;
[0038] Figure 5 This is a flowchart of another elliptic curve-based decryption method provided according to an embodiment of this disclosure;
[0039] Figure 6 This is a flowchart of another elliptic curve-based decryption method provided according to an embodiment of this disclosure;
[0040] Figure 7 This is a schematic diagram of another elliptic curve-based decryption device provided according to an embodiment of the present disclosure;
[0041] Figure 8 This is a schematic diagram of another elliptic curve-based decryption device provided according to an embodiment of the present disclosure;
[0042] Figure 9 This is a block diagram of an electronic device used to implement the methods provided in the embodiments of this disclosure. Detailed Implementation
[0043] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0044] Figure 1 This is a flowchart illustrating a method for generating an elliptic curve point pre-store table according to an embodiment of this disclosure. This embodiment is applicable to situations where, to meet elliptic curve-based encryption / decryption requirements, multiple points within a finite domain of an elliptic curve are pre-calculated. The pre-generated point pre-store table can be used to quickly determine points and their multiples during decryption, addressing DLP requirements. This method can be executed by an elliptic curve point pre-store table generation device, which can be implemented in hardware and / or software and can be configured in an electronic device. (Reference) Figure 1 The method specifically includes the following:
[0045] S101. Calculate the coordinate data of all base points within a basic discrete interval on the elliptic curve and store them in the base point pre-stored table.
[0046] S102. Calculate the identification data of interval points within each of one or more mapped discrete intervals on the elliptic curve, and store them in the interval point pre-stored table.
[0047] The base discrete interval and all points in each mapped discrete interval form the finite field of the elliptic curve; the points in the mapped discrete interval include interval points and multiple non-interval points; the difference between the coordinate data of any non-interval point in the mapped discrete interval and the coordinate data of the base point has a mapping relationship with the identification data of the interval point.
[0048] In elliptic curve encryption and decryption, it is necessary to calculate the multiples of the elliptic curve's base point. The base point can be a point within a predefined finite field of the elliptic curve. All points within this finite field can be considered as multiples of the base point (n times). An n-times multiple point can be understood as a point whose multiple from the base point is n; the base point is itself (1 times its own value). Elliptic curves also contain the concept of a point at infinity. This is a mathematical concept that allows points on the elliptic curve to participate in operations, but it is not a real point on the curve. The point at infinity can be understood as a point whose multiple from the base point is zero; that is, multiplying zero by the base point results in the point at infinity. For any point on the elliptic curve, adding that point to the point at infinity on the elliptic curve yields the point itself.
[0049] The number of points in the finite field of an elliptic curve can be used as the maximum multiple between the points in the finite field and the base point, thus determining the range of multiples of the points in the finite field with respect to the base point. For example, if there are 100 points in the finite field, these points can be used as the base point, and points that are 1, 2, ..., 98, and 99 times the base point. It should be noted that the example of 100 points is for ease of explanation. In practical implementations, to ensure encryption and decryption security, the number of points in the finite field is usually much larger; for example, the number of points in the finite field could be 2 to the power of 32, or 4,294,967,296 points.
[0050] In this embodiment, the finite field of the elliptic curve is divided into at least two discrete intervals. One discrete interval is selected as the base discrete interval, and the remaining discrete intervals are used as the mapping discrete intervals. Base points are points within the range of the base discrete interval. Points in the mapping discrete interval can be of two types, denoted as interval points and non-interval points. Non-interval points can be points in the mapping discrete interval other than interval points. The coordinate data of any non-interval point has a mapping relationship with the identifier data of a corresponding interval point and the coordinate data of a corresponding base point. Specifically, for any non-interval point, the difference between its coordinate data and the coordinate data of its corresponding base point has a unique scalar multiplication mapping relationship with the identifier data of its corresponding interval point. This scalar multiplication mapping relationship, i.e., the difference and the interval point have a scalar multiplication transformation relationship, is also a linear transformation relationship. Multiplying the coordinate data of the interval point by a set integer yields the difference. The base point pre-stored table is a data table that pre-stores the coordinate data of base points, and also stores the multiples of the points corresponding to the coordinate data. The interval point pre-stored table is a data table that pre-stores the identifier data of interval points, and also stores the multiples of the points corresponding to the identifier data, reflecting the discrete interval position corresponding to the interval point. The identifier data is the data that can uniquely identify the coordinate data of the interval point. The coordinate data of non-interval points does not need to be pre-stored. Therefore, for the basic discrete interval, it is equivalent to pre-store the coordinate data of continuously existing base points, and for each mapped discrete interval, it is equivalent to pre-store the coordinate data of the interval points that exist discretely in each mapped discrete interval. Based on different mapping relationships, all points in the basic discrete interval can be selected as base points, or some points in the basic discrete interval can be selected as base points. For example, the interval between base points can be set as a multiple distance. As long as the following non-interval point mapping condition is met: any non-interval point has a set mapping relationship with an interval point and a base point, and thus the multiple of the non-interval point can be calculated based on the set mapping relationship and the multiples of the interval point and the base point. Usually, the point at infinity is regarded as the 0 multiple point and can also be included in the basic discrete interval.
[0051] Specifically, a predefined algorithm is used to calculate the coordinate data of all base points within a basic discrete interval on the elliptic curve and store them in a pre-stored base point table. Another predefined algorithm is used to calculate the identifier data of interval points within each of one or more mapped discrete intervals on the elliptic curve and store them in a pre-stored interval point table. The predefined algorithm is one that can calculate the coordinate data of any point based on the coordinate data of the elliptic curve's base points and a multiple of any given point.
[0052] In this embodiment, the number of interval points in each mapped discrete interval can be one or more, and the interval points can be any point within the mapped discrete interval. For example, the number of interval points in each mapped discrete interval can be two, where one interval point is the first point within the mapped discrete interval, and the other interval point is the middle point within the mapped discrete interval. Having two interval points improves the efficiency of determining the interval point identifier data corresponding to the non-interval point coordinate data during the elliptic curve encryption / decryption process. For example, if the base points include 0x points (taking infinity as the 0x point), 1x points, 3x points, ..., 8x points and 9x points, and there are interval points of 80x points and 85x points in the mapped discrete interval, then the difference between the non-interval point coordinate data of the 86x point and the base point coordinate data of the 6x point has a mapping relationship with the interval point identifier data of the 80x point; the difference between the non-interval point coordinate data of the 86x point and the base point coordinate data of the 1x point has a mapping relationship with the interval point identifier data of the 85x point. In the encryption and decryption process of elliptic curves, when the base points are traversed to the 1-fold point, the 85-fold point with a mapping relationship can be determined. Compared to the case where the 85-fold point is not an interval point, it is necessary to traverse to the 6-fold point to determine the 80-fold point with a mapping relationship, thus improving the efficiency of determining interval points. Furthermore, consistency checks can be performed on the coordinate data of non-interval points determined by two interval points within the same mapping discrete interval to improve the accuracy of non-interval coordinate data.
[0053] Preferably, each mapped discrete interval has only one interval point, thereby minimizing the space occupied by the pre-stored table. For ease of calculation, the interval point is the first point within the mapped discrete interval range. This reduces the number of interval points while ensuring the storage of the identifier data for the interval points in the mapped discrete interval, thereby reducing the computational load of the identifier data and the storage space of the interval point pre-stored table.
[0054] In one optional embodiment, the finite field of the elliptic curve is divided into at least two discrete intervals of equal length, the length of which is equal to the number of points in the interval. A basic discrete interval and a mapped discrete interval are selected from the discrete intervals, such that each mapped discrete interval contains the same number of points as the basic discrete interval.
[0055] In one alternative embodiment, the sum of the number of intervals in the mapped discrete interval and the basic discrete interval is equal to the number of points in the mapped discrete interval. Assume the number of points in the finite field is the square of k, where k is a positive natural number. The square root of the number of points, k, can be used as the interval length of the discrete interval, and the number of discrete intervals is also k. Of course, the rule for dividing the discrete intervals is not limited to equal interval lengths; it only needs to satisfy the mapping condition for non-interval points and be able to calculate the multiples of non-interval points in reverse.
[0056] In one optional embodiment, the mapping relationship between the difference between the coordinate data of a non-interval point in the mapped discrete interval and the coordinate data of a base point, and the identification data of an interval point, can be a linear mapping relationship or a complex nonlinear mapping relationship. Through the mapping relationship, the identification data of the interval point, and the coordinate data of the base point, the coordinate data of any non-interval point can be mapped. Preferably, the mapping relationship between the difference between the coordinate data of a non-interval point in the mapped discrete interval and the coordinate data of a base point, and the identification data of an interval point, is such that the scalar multiplication of the difference with a positive integer corresponds one-to-one with the identification data of the interval point; the positive integer represents the position of the mapped discrete interval in a finite field, thereby achieving a lower complexity mapping and improving the efficiency of determining non-interval points.
[0057] For example, the mapping relationship can be represented by the following formula:
[0058] ab = w*e;
[0059] Where a represents the coordinate data of non-interval points in the mapped discrete interval; b represents the coordinate data of the base point; w represents the identification data of the interval point; e represents a positive integer; and * represents scalar multiplication.
[0060] In the technical solution of this disclosure, the coordinate data of non-interval points have a predetermined mapping relationship with a base point and an interval point. This solution can map the coordinate data of any non-interval point to the identifier data of the interval point and the coordinate data of the base point. In the encryption and decryption scheme using a key generated by an elliptic curve, the pre-stored table in this disclosure is used to calculate the multiple of any non-interval point based on the coordinate data of the interval point and the base point, the multiple in the table, and the predetermined mapping relationship. The multiple of the non-interval point is used for decryption. Therefore, it is not necessary to store a large amount of non-interval point coordinate data in the pre-stored table. The multiple of the non-interval point can be quickly calculated using the coordinate data of the interval point and the base point, and the predetermined mapping relationship, for subsequent decryption. Compared with the prior art scheme that pre-stores the coordinates of all points on the elliptic curve, this solution reduces the storage space of the pre-stored table while still being able to obtain the coordinate data of any elliptic curve point.
[0061] Figure 2 This is a flowchart illustrating another method for generating an elliptic curve point pre-stored table according to an embodiment of this disclosure. This embodiment is an optional solution proposed based on the above embodiments. See also Figure 2 The method for generating the elliptic curve point pre-store table in this embodiment includes:
[0062] S201. Calculate the coordinate data of all base points within a basic discrete interval on the elliptic curve and store them in the base point pre-stored table.
[0063] S202. Set the range of the loop counter value to [1, k); where k is the sum of the number of the basic discrete interval and all mapped discrete intervals.
[0064] S203. Set the cycle count value to vary from 1 to k. For each current cycle count value, calculate the product of the current cycle count value and the number of points in the mapped discrete interval, and use it as the index of the interval point. The current cycle count value is the index of the mapped discrete interval to which the currently calculated interval point belongs in the finite field.
[0065] S204. Calculate the coordinate data of the interval points based on the base point of the elliptic curve and the index of the interval points.
[0066] S205. Convert the coordinate data of the interval points into a string using a set rule, and perform a hash operation on the string using a set hash algorithm to obtain a hash result. Use the hash result as the identifier data of the interval points.
[0067] In this embodiment, the identifier data of the interval point is a hash result calculated based on the coordinate data of the interval point. Compared with storing the coordinate data of the interval point, using the hash result as the identifier data can ensure the uniqueness of the identifier data while unifying the identifier data of each interval point into a hash result of fixed length, which is convenient for finding the interval point during the encryption and decryption process.
[0068] Furthermore, the interval point pre-store table is a key-value pair structure. The key field of the key-value pair structure stores the identifier data of the interval point, and the value field of the key-value pair structure stores the interval index. The interval index is the index of the mapped discrete interval to which the interval point belongs in the finite field, so as to improve the efficiency of finding the interval point in the encryption and decryption process.
[0069] The sequence number can be used to characterize the position of the mapped discrete interval in the finite field. Specifically, the scalar multiplication result between the base point of the elliptic curve and the sequence number of the interval point is calculated, and the calculated scalar multiplication result is used as the coordinate data of the interval point; the coordinate data of the interval point is converted into a string according to a set rule; the set rule can be concatenating the coordinate data of the interval point or any other algorithm rule that can convert coordinate data into a string; the string is processed by a set hash algorithm to obtain a hash result, and the hash result is used as the identifier data of the interval point; the interval sequence number is stored in the value field of the key-value pair of the interval point pre-stored table, and the identifier data of the interval point is stored in the key field of the key-value pair of the interval point pre-stored table, thus completing the storage of the interval point.
[0070] For example, if the number of points within the mapped discrete interval is 10, and the current cycle count is 1, the product of the current cycle count 1 and the number of points within the mapped discrete interval is calculated to be 10. This 10 is used as the index of the interval point; the 1 is used as the index of the mapped discrete interval to which interval point 10 belongs in the finite field. The scalar multiplication result between the interval point index 10 and the base point of the elliptic curve is calculated, and this result is used as the coordinate data of interval point 10. The coordinate data of interval point 10 is converted into a string using a set rule, and the string is then processed using a set hash algorithm to obtain a hash result. This hash result is used as the identifier data of the interval point.
[0071] Optionally, the base point pre-stored table is a key-value pair structure. The key field of the key-value pair structure stores the base index, which is the index of the base point in the base discrete interval. The value field of the key-value pair structure stores the coordinate data of the base point to improve the efficiency of finding the base point during the encryption and decryption process.
[0072] Optionally, the range of the loop count value is set to [1, k); where k is the sum of the number of the base discrete interval and all mapped discrete intervals; the loop count value is set to change from 1 to k, and for each current loop count value, the current loop count value is used as the index of the current calculation base point; the coordinate data of the base point are calculated based on the base point of the elliptic curve and the index of the base point.
[0073] Specifically, the scalar multiplication of the coordinates of the base point and the index of the base point is calculated, and the calculated scalar multiplication result is used as the coordinate data of the base point. The base index is stored in the value field of the key-value pair in the base point pre-stored table, and the identifier data of the interval points is stored in the key field of the key-value pair in the base point pre-stored table, thus completing the storage of the interval points. The index of the base point reflects the multiple of the base point in the elliptic curve.
[0074] For example, the calculation logic of the base point pre-stored table (babyStepMap) is as follows:
[0075]
[0076]
[0077] For example, the calculation logic of the interval point pre-store table (giantStepMap) is as follows:
[0078]
[0079] The technical solution of this disclosure embodiment can store the hash result of the interval point coordinate data and the sequence number of the interval point as identifier data in the interval point pre-store table of key-value pair structure, and store the base point coordinate data and the sequence number of the base point in the base point pre-store table of key-value pair structure, thereby improving the search efficiency of searching the base point coordinate data in the base point pre-store table and the interval point identifier data in the interval point pre-store table during the encryption and decryption process based on elliptic curves.
[0080] The following describes a technical solution for encryption and decryption operations based on the pre-stored table generated by the elliptic curve point pre-stored table generation method disclosed in this paper.
[0081] The key generated based on elliptic curves can be encrypted using any encryption algorithm, and is optionally suitable for homomorphic encryption operations. Encryption methods include:
[0082] S1. Based on the elliptic curve and a set multiple, calculate the point located on the elliptic curve and use it as the public key;
[0083] S2. Generate a random number, and determine the public key multiplier point located on the elliptic curve based on the random number and the public key;
[0084] S3. Based on the base point of the elliptic curve and a random number, calculate the first point located on the elliptic curve;
[0085] S4. Based on the data to be encrypted and the base point, calculate the encryption point located on the elliptic curve; where the data to be encrypted is an integer;
[0086] S5. Calculate the second point on the elliptic curve based on the encryption point and the public key multiplier point; the first and second points are used as the ciphertext after the data to be encrypted is encrypted.
[0087] Specifically, based on the base point of the elliptic curve and a set multiple, the scalar multiplication result of the base point and the set multiple is calculated, and the calculated scalar multiplication result is used as the public key; a random number is generated, and the scalar multiplication result between the random number and the public key is calculated to obtain the public key multiplier; for example, the public key multiplier can be determined by the following formula:
[0088] s = r * p;
[0089] Where s represents the public key multiplier; r represents the random number; and p represents the public key.
[0090] The first point on the elliptic curve is obtained by calculating the scalar multiplication between the base point of the elliptic curve and a random number; for example, the first point can be determined by the following formula:
[0091] c1 = r * G;
[0092] Where c1 represents the first point; r represents a random number; and G represents the base point of the elliptic curve.
[0093] Using a predefined algorithm, based on the data to be encrypted and the base point, the encryption point located on the elliptic curve is calculated. For example, the calculation formula for the first point mentioned above can employ a scalar multiplication algorithm. The encryption point and the public key multiplier point are then added using an elliptic curve algorithm to obtain the second point on the elliptic curve. For example, the second point can be determined using the following formula:
[0094] c2 = t + s;
[0095] Where c2 represents the second point; t represents the encryption point; s represents the public key multiplication point; and + represents the addition operation on the elliptic curve.
[0096] The point pair (c1, c2) formed by the first and second points is used as the ciphertext after encrypting the data to be encrypted.
[0097] In an optional embodiment, if the data to be encrypted is greater than zero, the scalar multiplication of the data to be encrypted with the base point is calculated, and this result is used as the encryption point located on the elliptic curve; for example, the encryption point can be determined by the following formula:
[0098] t = m * G;
[0099] Where t represents the encryption point; m represents the data to be encrypted; and G represents the base point of the elliptic curve.
[0100] If the data to be encrypted is less than zero, calculate the scalar multiplication result between the data to be encrypted and the base point, and update the y-coordinate in the scalar multiplication result according to the following formula:
[0101] y' = -1*y mod P;
[0102] Where y' represents the y-coordinate in the updated scalar multiplication result; y represents the y-coordinate in the original scalar multiplication result; and P is the order of the finite field in the elliptic curve.
[0103] Figure 3 This is a flowchart illustrating an elliptic curve-based decryption method according to an embodiment of this disclosure. This disclosure is applicable to decrypting ciphertext using elliptic curves. The method can be executed by an elliptic curve-based decryption device, which can be implemented in hardware and / or software and configured in an electronic device. (Reference) Figure 3 The method specifically includes the following:
[0104] S301. Calculate the public key multiplier based on the private key generated based on the elliptic curve and the first point in the ciphertext.
[0105] S302. Calculate the encryption point based on the public key dot and the second point of the ciphertext.
[0106] S303. Based on the pre-stored table of base points and the pre-stored table of interval points, determine whether the densified points are points on the elliptic curve.
[0107] S304. If the encryption point is a point on an elliptic curve, then the ciphertext is decrypted according to the base point pre-stored table, the interval point pre-stored table, and the encryption point.
[0108] The base point pre-store table and the interval point pre-store table can be generated using the elliptic curve point pre-store table generation method provided in any embodiment of this disclosure.
[0109] In this embodiment, the ciphertext can be represented as a point pair (c1, c2) consisting of a first point and a second point. The public key multiple point can be a point on an elliptic curve corresponding to the public key.
[0110] Specifically, the public key multiplier is obtained by performing a scalar multiplication operation between the private key generated by the elliptic curve and the first point in the ciphertext; for example, the public key multiplier can be determined by the following formula:
[0111] s = pk * c1;
[0112] Where c1 represents the first point; s represents the public key multiplication point; pk represents the private key; and * represents scalar multiplication.
[0113] The encryption point is obtained by subtracting the second point of the ciphertext from the public key multiple point using an elliptic curve method; for example, the encryption point can be determined by the following formula:
[0114] t = c² - s;
[0115] Where t represents the encryption point; c2 represents the second point; and s represents the public key multiplier point.
[0116] Based on the pre-stored table of base points and the pre-stored table of interval points, determine whether the encryption point is a point on the elliptic curve; if the encryption point is a point on the elliptic curve, then decrypt the ciphertext based on the pre-stored table of base points, the pre-stored table of interval points, and the encryption point.
[0117] The technical solution of this disclosure determines whether the encryption point is a point on an elliptic curve based on the base point pre-stored table and the interval point pre-stored table. If the encryption point is a point on an elliptic curve, the ciphertext is decrypted based on the base point pre-stored table, the interval point pre-stored table, and the encryption point. Compared with the prior art, which queries the encryption point and the multiple of the encryption point in the full point pre-stored table, the encryption point is queried in the base point pre-stored table and the interval point pre-stored table, which occupy less space, thus improving the decryption efficiency.
[0118] Figure 4 This is a flowchart of another elliptic curve-based decryption method provided according to an embodiment of this disclosure. This embodiment is an optional solution proposed based on the above embodiments. See also... Figure 4 The decryption method in this embodiment includes:
[0119] S401. Calculate the public key multiplier based on the private key generated based on the elliptic curve and the first point in the ciphertext.
[0120] S402. Calculate the encryption point based on the public key dot and the second point of the ciphertext.
[0121] S403. Match the coordinate data of the encrypted point with the pre-stored table of base points; if the match is successful in the pre-stored table of base points, then determine that the encrypted point is a point on the elliptic curve.
[0122] S404. If a match is not found in the pre-stored table of base points, calculate the difference between the coordinate data of the encrypted point and each base point in the pre-stored table of base points, and determine the interval points that have a mapping relationship with the difference based on the pre-stored table of interval points.
[0123] S405. If the interval points with a mapping relationship can be determined, then the encryption point is determined to be a point on the elliptic curve.
[0124] S406. If the encryption point is a point on an elliptic curve, then the ciphertext is decrypted according to the base point pre-stored table, the interval point pre-stored table, and the encryption point.
[0125] Specifically, in the base point coordinate data stored in the base point pre-stored table, it is determined whether there is a point with the same coordinate data as the encrypted point; if there is a base point coordinate data with the same coordinate data as the encrypted point in the base point pre-stored table, it is determined that the encrypted point is successfully matched in the base point pre-stored table, and the encrypted point is determined to be a point on the elliptic curve.
[0126] If no base point coordinates matching the encrypted point's coordinates exist in the base point pre-stored table, then the encrypted point is determined to be unmatched in the base point pre-stored table. The difference between the encrypted point and the coordinates of each base point in the base point pre-stored table is calculated, and the interval points that have a mapping relationship with the differences are determined based on the interval point pre-stored table.
[0127] In an optional embodiment, before determining whether the encrypted point is a point on the elliptic curve based on the base point pre-stored table and the interval point pre-stored table, the method further includes: if the encrypted point is a negative point with a negative y-coordinate, then converting the encrypted point to a positive point.
[0128] Here, a positive point can be a point with a positive y-coordinate, and a negative point is a point with a negative y-coordinate. Specifically, negative encrypted points are converted to positive points to avoid incorrectly determining that an encrypted point is not on the elliptic curve when its y-coordinate is negative, thus improving the accuracy of determining whether an encrypted point is on the elliptic curve.
[0129] In one optional embodiment, converting the encrypted point to a positive point includes: symmetrically converting the negative y-coordinate of the encrypted point to a positive y-coordinate. Specifically, the negative y-coordinate of the encrypted point is converted to its opposite, resulting in a positive point after the encryption point conversion.
[0130] In one optional embodiment, the difference between the coordinate data of the encrypted point and each base point in the pre-stored base point table is calculated; the difference is converted into a string according to a set rule, and the string is hashed using a set hash algorithm to obtain a hash result; the hash result is matched against the pre-stored interval point table; if a match is found in the pre-stored interval point table, the encrypted point is determined to be a point on the elliptic curve. Specifically, for each base point, the difference between the encrypted point and the coordinate data of that base point is determined; the difference is converted into a string according to a set rule, and the string is hashed using a set hash algorithm to obtain a hash result; the pre-stored interval point table is checked to see if there is a matching hash result; if so, a match is found in the pre-stored interval point table, and the encrypted point is determined to be a point on the elliptic curve.
[0131] The technical solution of this disclosure embodiment, if the coordinate data of the encrypted point is matched in the pre-stored table of basic points, then the encrypted point is determined to be a point on the elliptic curve; otherwise, the difference between the encrypted point and the coordinate data of each basic point in the pre-stored table of basic points is calculated, and the interval points that have a mapping relationship with the difference are determined based on the pre-stored table of interval points. Compared with the prior art of traversing the coordinate data of the encrypted point in the full pre-stored table of points, this disclosure embodiment matches the encrypted point in the pre-stored table of interval points with a smaller space based on the difference between the encrypted point and the coordinate data of each basic point in the pre-stored table of basic points, thereby improving the decryption efficiency.
[0132] Figure 5 This is a flowchart of another elliptic curve-based decryption method provided according to an embodiment of this disclosure. This embodiment is an optional solution proposed based on the above embodiments. See also Figure 5 The elliptic curve-based decryption method in this embodiment includes:
[0133] S501. Calculate the public key multiplier based on the private key generated based on the elliptic curve and the first point in the ciphertext.
[0134] S502. Calculate the encryption point based on the public key dot and the second point of the ciphertext.
[0135] S503. Based on the pre-stored table of base points and the pre-stored table of interval points, determine whether the densified points are points on the elliptic curve.
[0136] S504. Determine the corresponding data to be encrypted based on the index of the point matched by the encryption point in the base point pre-stored table and the interval point pre-stored table.
[0137] In this embodiment, the index can be the point number. Specifically, the corresponding data to be encrypted is determined based on the index number of the base point that matches the encryption point in the base point pre-stored table and the index number of the interval point that matches the encryption point in the interval point pre-stored table.
[0138] Optionally, the corresponding data to be encrypted is determined based on the index of the point matched by the encryption point in the base point pre-stored table and the interval point pre-stored table. This includes: calculating the product between the number of points in the mapped discrete interval and the index number of the interval point matched by the encryption point in the interval point pre-stored table; calculating the sum between the product and the index number of the base point matched by the encryption point in the base point mapping table, and using this sum as the data to be encrypted.
[0139] For example, the data to be encrypted is determined according to the following formula:
[0140] m = i + (k * j)
[0141] Where m is the data to be encrypted, i is the index number of the base point matched in the base point mapping table, k is the number of points in the mapped discrete interval, and j is the index number of the interval point matched in the interval point pre-stored table. The index number of the interval point indicates which mapped discrete interval the matched interval point is located in. Through the above calculation, the multiple of the encrypted point in the finite field of the elliptic curve can be calculated, which is usually a large integer, representing the data to be encrypted.
[0142] The technical solution of this disclosure determines the corresponding data to be encrypted based on the index of the encrypted point in the pre-stored table of basic points and the pre-stored table of interval points. This allows for quick retrieval of the corresponding data to be encrypted based on the index, without the need for recalculation each time, thus improving the efficiency of decryption based on elliptic curves.
[0143] The logic for matching encrypted points during the decryption process is as follows:
[0144]
[0145]
[0146] Figure 6 This is a flowchart of another elliptic curve-based decryption method provided according to an embodiment of this disclosure. This embodiment is an optional solution proposed based on the above embodiments. See also Figure 6 The elliptic curve-based decryption method in this embodiment includes:
[0147] S601. Obtain the ciphertext of the result generated based on homomorphic operation;
[0148] The encrypted result includes at least one of the following cases:
[0149] If it is necessary to sum two ciphertexts, then sum the first points of each of the two ciphertexts to obtain the first summation point, sum the second points to obtain the second summation point, and use the first summation point and the second summation point as the summation result ciphertext of the homomorphic operation;
[0150] If it is necessary to sum the ciphertext and plaintext, the plaintext is encrypted as the data to be encrypted. Then, the first point of each of the two ciphertexts is summed to obtain the first summation point, and the second point is summed to obtain the second summation point. The first summation point and the second summation point are used as the summation result ciphertext of the homomorphic operation.
[0151] If it is necessary to perform a multiplication calculation between ciphertext and plaintext, the first point of the ciphertext is multiplied by the plaintext to obtain the first product point, the second point of the ciphertext is multiplied by the plaintext to obtain the second product point, and the first product point and the second product point are used as the ciphertext of the multiplication result of the homomorphic operation.
[0152] S602. Calculate the public key multiplier based on the private key generated based on the elliptic curve and the first point in the ciphertext;
[0153] S603. Calculate the encryption point based on the public key dot and the second point of the ciphertext;
[0154] S604. Based on the pre-stored table of base points and the pre-stored table of interval points, determine whether the densified points are points on the elliptic curve.
[0155] S605. If the encryption point is a point on an elliptic curve, then the ciphertext is decrypted according to the base point pre-stored table, the interval point pre-stored table, and the encryption point.
[0156] In this embodiment, the resulting ciphertext can refer to the ciphertext generated after performing a homomorphic operation on the ciphertext obtained based on elliptic curve encryption.
[0157] In this embodiment, the summation operation can be an elliptic curve addition operation. The multiplication operation can be a scalar multiplication operation. The plaintext can be represented in integer form. Specifically, if it is necessary to sum two ciphertexts, then the first points in each of the two ciphertexts are added using an elliptic curve to obtain the first summation point; the second points in each of the two ciphertexts are added using an elliptic curve to obtain the second summation point; the point pair formed by the first summation point and the second summation point is used as the summation result ciphertext of the homomorphic operation.
[0158] If it is necessary to sum the ciphertext and plaintext, the plaintext is treated as the data to be encrypted and encrypted using elliptic curve cryptography. Then, the first point in each of the two ciphertexts is added using elliptic curve cryptography to obtain the first summation point. The second point is added using elliptic curve cryptography to obtain the second summation point. The point pair formed by the first summation point and the second summation point is used as the summation result ciphertext of the homomorphic operation.
[0159] If a multiplication calculation is required between ciphertext and plaintext, the first product point is obtained by calculating the scalar multiplication result between the first point of the ciphertext and the plaintext. For example, the first product point can be determined using the following formula:
[0160] d1 = c1 * z;
[0161] Where d1 represents the first product point; c1 represents the first point; and z represents the plaintext.
[0162] Calculate the scalar multiplication result between the second point of the ciphertext and the plaintext, and use the calculated scalar multiplication result as the second product point; for example, the second product point can be determined by the following formula:
[0163] d2 = c2 * z;
[0164] Where d represents the second product point; c2 represents the first point; and z represents the plaintext.
[0165] The point pair (d1, d2) formed by the first and second product points is used as the ciphertext of the multiplication result of the homomorphic operation.
[0166] For example, if it is necessary to sum two ciphertexts, the logic for determining the ciphertext of the summation result of the homomorphic operation is as follows:
[0167]
[0168]
[0169] The ciphertext resulting from the technical solution of this embodiment can be obtained by summing two ciphertexts, summing the ciphertext and plaintext, or multiplying the ciphertext and plaintext. Without decrypting the ciphertext, the ciphertext can be obtained by performing homomorphic operations on the ciphertext, thus improving the security of the ciphertext.
[0170] Figure 7 This is a schematic diagram of an apparatus for generating an elliptic curve point pre-store table according to an embodiment of this disclosure. This embodiment is applicable to the generation of elliptic curve point pre-store tables. The apparatus can be implemented in hardware and / or software and can be configured in an electronic device. (Reference) Figure 7 The device 700 for generating the elliptic curve point pre-store table specifically includes the following:
[0171] The basic point storage module 701 is used to calculate the coordinate data of all basic points within a basic discrete interval on the elliptic curve and store them in the basic point pre-stored table.
[0172] The interval point storage module 702 is used to calculate the identification data of interval points within each of one or more mapped discrete intervals on an elliptic curve and store them in the interval point pre-store table.
[0173] The base discrete interval and all points in each mapped discrete interval form the finite field of the elliptic curve; the points in the mapped discrete interval include interval points and multiple non-interval points; the difference between the coordinate data of any non-interval point in the mapped discrete interval and the coordinate data of the base point has a mapping relationship with the identification data of the interval point.
[0174] In one optional embodiment, the number of interval points for each mapped discrete interval is one; the interval point is the first point within the range of the mapped discrete interval.
[0175] In one alternative embodiment, each mapped discrete interval contains the same number of points as the base discrete interval.
[0176] In one alternative embodiment, the sum of the number of intervals of the mapped discrete interval and the basic discrete interval is equal to the number of points in the mapped discrete interval.
[0177] In one optional embodiment, the mapping relationship between the difference and the identification data of an interval point is that the result of the scalar multiplication of the difference and a positive integer corresponds one-to-one with the identification data of the interval point; the positive integer represents the position of the mapped discrete interval in the finite field.
[0178] In one alternative embodiment, the identifier data of the interval point is a hash result calculated based on the coordinate data of the interval point.
[0179] In one optional embodiment, the interval point pre-store table is a key-value pair structure. The key field of the key-value pair structure stores the interval index, which is the identifier data of the interval point. The value field of the key-value pair structure stores the index of the mapped discrete interval to which the interval point belongs in the finite field.
[0180] In an optional embodiment, the interval point storage module 702 includes:
[0181] The value range setting unit is used to set the value range of the loop count value to [1, k); where k is the sum of the number of the basic discrete interval and all mapped discrete intervals;
[0182] The sequence number determination unit is used to set the change of the loop count value from 1 to k. For each current loop count value, the product of the current loop count value and the number of points in the mapped discrete interval is calculated as the sequence number of the interval point. The current loop count value is the sequence number of the mapped discrete interval to which the currently calculated interval point belongs in the finite field.
[0183] The coordinate data determination unit is used to calculate the coordinate data of the interval points based on the base point of the elliptic curve and the index of the interval points.
[0184] The identification data determination unit is used to convert the coordinate data of the interval points into a string according to a set rule, and to perform a hash operation on the string using a set hash algorithm to obtain a hash result, and to use the hash result as the identification data of the interval points.
[0185] In one optional embodiment, the base point pre-stored table is a key-value pair structure. The key field of the key-value pair structure stores the base index, which is the index of the base point in the base discrete interval. The value field of the key-value pair structure stores the coordinate data of the base point.
[0186] In the technical solution of this disclosure, the coordinate data of non-interval points have a predetermined mapping relationship with a base point and an interval point. This solution can map the coordinate data of any non-interval point to the identifier data of the interval point and the coordinate data of the base point. In the encryption and decryption scheme using a key generated by an elliptic curve, the pre-stored table in this disclosure is used to calculate the multiple of any non-interval point based on the coordinate data of the interval point and the base point, the multiple in the table, and the predetermined mapping relationship. The multiple of the non-interval point is used for decryption. Therefore, it is not necessary to store a large amount of non-interval point coordinate data in the pre-stored table. The multiple of the non-interval point can be quickly calculated using the coordinate data of the interval point and the base point, and the predetermined mapping relationship, for subsequent decryption. Compared with the prior art scheme that pre-stores the coordinates of all points on the elliptic curve, this solution reduces the storage space of the pre-stored table while still being able to obtain the coordinate data of any elliptic curve point.
[0187] Figure 8 This is a schematic diagram of a decryption device based on elliptic curves according to an embodiment of the present disclosure. This embodiment is applicable to the decryption of ciphertext based on elliptic curves. The device can be implemented in hardware and / or software and can be configured in an electronic device. (Reference) Figure 8 The elliptic curve-based decryption device 800 specifically includes the following:
[0188] The public key multiplier determination module 801 is used to calculate the public key multiplier based on the private key generated based on the elliptic curve and the first point in the ciphertext;
[0189] The encryption point determination module 802 is used to calculate the encryption point based on the public key multiplier and the second point of the ciphertext;
[0190] The curve point judgment module 803 is used to determine whether the encrypted point is a point on the elliptic curve based on the base point pre-stored table and the interval point pre-stored table.
[0191] The ciphertext decryption module 804 is used to decrypt the ciphertext based on the base point pre-stored table, the interval point pre-stored table, and the encryption point if the encryption point is a point on an elliptic curve.
[0192] The base point pre-store table and the interval point pre-store table are generated using the elliptic curve point pre-store table generation apparatus of any embodiment of this disclosure.
[0193] In an optional embodiment, the curve point determination module 803 includes:
[0194] The coordinate data matching unit is used to match the coordinate data of the encrypted point with the pre-stored table of base points; if the match is successful in the pre-stored table of base points, the encrypted point is determined to be a point on the elliptic curve.
[0195] The interval point determination unit is used to calculate the difference between the coordinate data of the encrypted point and each base point in the base point pre-stored table if the matching fails in the base point pre-stored table, and determine the interval points that have a mapping relationship with the difference based on the interval point pre-stored table.
[0196] The curve point determination unit is used to determine the encrypted point as a point on the elliptic curve if an interval point with a mapping relationship can be identified.
[0197] In an optional embodiment, the device further includes:
[0198] The encryption point conversion module is used to convert encryption points into positive points if the encryption point is a negative point with a negative y-coordinate.
[0199] In one optional embodiment, the encryption point conversion module includes:
[0200] The negative y-coordinate of the encrypted point is symmetrically converted into a positive y-coordinate.
[0201] In one optional embodiment, the interval point determination unit is specifically used for:
[0202] Calculate the difference between the coordinate data of the encrypted point and each base point in the pre-stored base point table;
[0203] The difference is converted into a string according to the set rules, and the string is hashed according to the set hash algorithm to obtain the hash result;
[0204] Match the hash results against the pre-stored table of interval points;
[0205] If a match is found in the pre-stored table of interval points, the encrypted point is determined to be a point on the elliptic curve.
[0206] In one optional embodiment, the ciphertext decryption module includes:
[0207] The ciphertext decryption unit is used to determine the corresponding data to be encrypted based on the index of the point matched by the encryption point in the base point pre-stored table and the interval point pre-stored table.
[0208] In one optional embodiment, the data to be encrypted is determined according to the following formula:
[0209] m = i + (k * j)
[0210] Where m is the data to be encrypted, i is the index number of the base point matched by the encryption point in the base point mapping table, k is the number of points in the mapped discrete interval, and j is the index number of the interval point matched by the encryption point in the interval point pre-stored table.
[0211] In an optional embodiment, the device further includes:
[0212] The ciphertext acquisition module is used to acquire the ciphertext result generated based on homomorphic operations; wherein the ciphertext result includes at least one of the following cases:
[0213] If it is necessary to sum two ciphertexts, then sum the first points of each of the two ciphertexts to obtain the first summation point, sum the second points to obtain the second summation point, and use the first summation point and the second summation point as the summation result ciphertext of the homomorphic operation;
[0214] If it is necessary to sum the ciphertext and plaintext, the plaintext is encrypted as the data to be encrypted. Then, the first point of each of the two ciphertexts is summed to obtain the first summation point, and the second point is summed to obtain the second summation point. The first summation point and the second summation point are used as the summation result ciphertext of the homomorphic operation.
[0215] If it is necessary to perform a multiplication calculation between ciphertext and plaintext, the first point of the ciphertext is multiplied by the plaintext to obtain the first product point, the second point of the ciphertext is multiplied by the plaintext to obtain the second product point, and the first product point and the second product point are used as the ciphertext of the multiplication result of the homomorphic operation.
[0216] The technical solution of this disclosure determines whether the encryption point is a point on an elliptic curve based on the base point pre-stored table and the interval point pre-stored table. If the encryption point is a point on an elliptic curve, the ciphertext is decrypted based on the base point pre-stored table, the interval point pre-stored table, and the encryption point. Compared with the prior art, which queries the encryption point and the multiple of the encryption point in the full point pre-stored table, the encryption point is queried in the base point pre-stored table and the interval point pre-stored table, which occupy less space, thus improving the decryption efficiency.
[0217] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in this technical solution comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0218] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0219] Figure 9 A schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0220] like Figure 9 As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 902 or a computer program loaded from storage unit 908 into random access memory (RAM) 903. RAM 903 may also store various programs and data required for the operation of device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.
[0221] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0222] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as the method for generating an elliptic curve point pre-stored table or an elliptic curve-based decryption method. For example, in some embodiments, the method for generating an elliptic curve point pre-stored table or an elliptic curve-based decryption method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the method for generating an elliptic curve point pre-stored table or an elliptic curve-based decryption method described above can be performed. Alternatively, in other embodiments, the computing unit 901 may be configured by any other suitable means (e.g., by means of firmware) to perform a method for generating an elliptic curve point pre-store table or a method for decrypting based on elliptic curves.
[0223] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0224] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0225] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0226] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0227] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0228] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is established by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem that addresses the management difficulties and weak business scalability inherent in traditional physical hosting and VPS services. Servers can also be servers for distributed systems or servers integrated with blockchain technology.
[0229] Artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies mainly include computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graph technologies.
[0230] Cloud computing refers to a technology system that enables access to a shared pool of physical or virtual resources via a network. These resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for applications such as artificial intelligence and blockchain, as well as for model training.
[0231] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution provided in this disclosure can be achieved, and this is not limited herein.
[0232] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for generating a pre-stored table of elliptic curve points, comprising: Calculate the coordinate data of all base points within a basic discrete interval on the elliptic curve and store them in a pre-stored table of base points; Calculate the identifier data of interval points within each of one or more mapped discrete intervals on an elliptic curve, and store them in a pre-stored interval point table; Wherein, all points in the basic discrete interval and each mapped discrete interval constitute the finite field of the elliptic curve; the points in the mapped discrete interval include the interval points and multiple non-interval points; the difference between the coordinate data of any non-interval point in the mapped discrete interval and the coordinate data of the basic point has a mapping relationship with the identification data of the interval point.
2. The method according to claim 1, wherein, The number of interval points in each mapped discrete interval is one; the interval point is the first point within the range of the mapped discrete interval.
3. The method according to claim 1, wherein, Each mapped discrete interval contains the same number of points as the basic discrete interval.
4. The method according to claim 3, wherein, The sum of the number of intervals in the mapped discrete interval and the basic discrete interval is equal to the number of points in the mapped discrete interval.
5. The method according to claim 1, wherein, The mapping relationship between the difference and the identification data of the interval point is that the result of multiplying the difference by a positive integer corresponds one-to-one with the identification data of the interval point; the positive integer represents the position of the mapped discrete interval in the finite field.
6. The method according to any one of claims 1-5, wherein, The identifier data of the interval point is a hash result calculated based on the coordinate data of the interval point.
7. The method according to claim 6, wherein, The interval point pre-store table is a key-value pair structure. The key field of the key-value pair structure stores the identification data of the interval point, and the value field of the key-value pair structure stores the interval index. The interval index is the index of the mapped discrete interval to which the interval point belongs in the finite field.
8. The method according to claim 7, wherein, The identification data of interval points within each of one or more mapped discrete intervals on the elliptic curve is calculated and stored in an interval point pre-stored table, including: The range of the loop counter value is set to [1, k); where k is the sum of the number of the basic discrete interval and all mapped discrete intervals; The cycle count value is set to vary from 1 to k. For each current cycle count value, the product of the current cycle count value and the number of points in the mapped discrete interval is calculated, which is used as the index of the interval point. The current cycle count value is the index of the mapped discrete interval to which the currently calculated interval point belongs in the finite field. Calculate the coordinate data of the interval points based on the base point of the elliptic curve and the index of the interval points; The coordinate data of the interval points are converted into strings according to a set rule, and the strings are processed by a set hash algorithm to obtain a hash result. The hash result is used as the identifier data of the interval points.
9. The method according to claim 1, wherein, The pre-stored table of base points is a key-value pair structure. The key field of the key-value pair structure stores the base index, which is the index of the base point in the base discrete interval. The value field of the key-value pair structure stores the coordinate data of the base point.
10. A decryption method based on elliptic curves, comprising: Calculate the public key multiplier based on the private key generated from the elliptic curve and the first point in the ciphertext; Calculate the encryption point based on the public key multiplier and the second point of the ciphertext; Based on the base point pre-stored table and the interval point pre-stored table, determine whether the encrypted point is a point on the elliptic curve; If the encryption point is a point on an elliptic curve, then the ciphertext is decrypted according to the base point pre-stored table, the interval point pre-stored table, and the encryption point; The base point pre-store table and the interval point pre-store table are generated using the method for generating elliptic curve point pre-store tables as described in any one of claims 1-9.
11. The method according to claim 10, wherein, The step of determining whether the encrypted point is a point on the elliptic curve based on the pre-stored table of base points and the pre-stored table of interval points includes: The coordinate data of the encrypted point is matched with the pre-stored table of base points; if a match is found in the pre-stored table of base points, the encrypted point is determined to be a point on the elliptic curve. If a match is not found in the pre-stored table of base points, the difference between the encrypted point and the coordinate data of each base point in the pre-stored table of base points is calculated, and the interval points that have a mapping relationship with the difference are determined based on the pre-stored table of interval points. If a range of points with a mapping relationship can be determined, then the encrypted point is determined to be a point on the elliptic curve.
12. The method according to claim 10 or 11, before determining whether the encrypted point is a point on the elliptic curve based on the base point pre-stored table and the interval point pre-stored table, the method further includes: If the encrypted point is a negative point with a negative y-coordinate, then the encrypted point is converted to a positive point.
13. The method according to claim 12, wherein, Converting the encrypted points to positive points includes: The negative y-coordinate of the encrypted point is symmetrically converted into a positive y-coordinate.
14. The method according to claim 11, wherein, The step of calculating the difference between the coordinate data of the encrypted point and each base point in the pre-stored base point table, and determining the interval points that have a mapping relationship with the difference based on the pre-stored interval point table, includes: Calculate the difference between the coordinate data of the encrypted point and each base point in the pre-stored base point table; The difference is converted into a string according to a set rule, and the string is hashed according to a set hash algorithm to obtain a hash result; The hash result is matched against the interval point pre-stored table; If a match is found in the pre-stored table of interval points, the encrypted point is determined to be a point on the elliptic curve.
15. The method according to claim 10, wherein, The step of decrypting the ciphertext based on the pre-stored table of base points, the pre-stored table of interval points, and the encryption points includes: The corresponding data to be encrypted is determined based on the index of the point that matches the encryption point in the base point pre-stored table and the interval point pre-stored table.
16. The method according to claim 15, wherein, The step of determining the corresponding data to be encrypted based on the index of the point matched by the encryption point in the base point pre-stored table and the interval point pre-stored table includes: The data to be encrypted is determined according to the following formula: m = i + (k * j) Where m is the data to be encrypted, i is the index number of the base point matched by the encryption point in the base point mapping table, k is the number of points in the mapped discrete interval, and j is the index number of the interval point matched by the encryption point in the interval point pre-stored table.
17. The method according to claim 10, further comprising: Obtain the ciphertext of the result generated based on homomorphic operations; wherein the ciphertext of the result includes at least one of the following cases: If it is necessary to sum two ciphertexts, then sum the first points of each of the two ciphertexts to obtain the first summation point, sum the second points to obtain the second summation point, and use the first summation point and the second summation point as the summation result ciphertext of the homomorphic operation; If it is necessary to sum the ciphertext and plaintext, the plaintext is encrypted as the data to be encrypted, and then the first points of each of the two ciphertexts are summed to obtain the first sum point. The second points are summed to obtain the second sum point. The first sum point and the second sum point are used as the sum result ciphertext of the homomorphic operation. If it is necessary to perform a multiplication calculation between ciphertext and plaintext, the first point of the ciphertext is multiplied by the plaintext to obtain the first product point, and the second point of the ciphertext is multiplied by the plaintext to obtain the second product point. The first product point and the second product point are used as the ciphertext of the multiplication result of the homomorphic operation.
18. An apparatus for generating an elliptic curve point pre-store table, comprising: The base point storage module is used to calculate the coordinate data of all base points within a basic discrete interval on the elliptic curve and store them in the base point pre-stored table. The interval point storage module is used to calculate the identification data of interval points within each of one or more mapped discrete intervals on an elliptic curve and store them in the interval point pre-store table. Wherein, all points in the basic discrete interval and each mapped discrete interval constitute the finite field of the elliptic curve; the points in the mapped discrete interval include the interval points and multiple non-interval points; the difference between the coordinate data of any non-interval point in the mapped discrete interval and the coordinate data of the basic point has a mapping relationship with the identification data of the interval point.
19. A decryption device based on elliptic curves, comprising: The public key multiplier determination module is used to calculate the public key multiplier based on the private key generated based on the elliptic curve and the first point in the ciphertext; The encryption point determination module is used to calculate the encryption point based on the public key multiplier and the second point of the ciphertext; The curve point determination module is used to determine whether the encrypted point is a point on the elliptic curve based on the base point pre-stored table and the interval point pre-stored table. The ciphertext decryption module is used to decrypt the ciphertext according to the base point pre-stored table, the interval point pre-stored table, and the encryption point if the encryption point is a point on an elliptic curve. The base point pre-store table and the interval point pre-store table are generated using the elliptic curve point pre-store table generation device described in claim 18.
20. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method for generating the elliptic curve point pre-store table according to any one of claims 1-9, or the elliptic curve-based decryption method according to any one of claims 10-17.
21. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method for generating the elliptic curve point pre-store table according to any one of claims 1-9, or the method for decryption based on elliptic curves according to any one of claims 10-17.
Citation Information
Patent Citations
Rapid decryption method for homomorphic encryption scheme
CN114124349A
Machine learning method and system based on private data sharing and encryption and decryption optimization
CN116527270A