Information encryption method and device
By using hash functions and elliptic curve encryption technology within the preset time period, combining blockchain and smart contracts, the security problems of time-sensitive information in a specific time period are solved, and efficient encryption and decryption of information is achieved, improving the efficiency of information security and collaboration efficiency.
Patent Information
- Application Number
- CN202011121797.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-20
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2040-10-20
AI Technical Summary
The prior art is difficult to effectively protect the security of time-sensitive information, especially to prevent leakage within a specific time period.
By receiving participant input information within the preset time period, using the preset hash function to determine the target point of the target sequence on the semi-trusted elliptic curve as the public key, and obtain the private key by solving the discrete logarithmic problem, and then encrypting and Decrypt information and use blockchain technology and smart contracts to improve the security of information encryption.
It improves the security of ciphertexts during the expected encryption time, ensures the security and reliability of information during a specific time period, and realizes the collaboration and reward mechanism of multiple participants through blockchain technology.
Smart Images

Figure CN113765666B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and specifically to an information encryption method and device. Background Art
[0002] Time-sensitive information refers to information that is highly sensitive or important within a specific time period. After a specific period of time, its sensitivity or importance will gradually decrease, or even become zero. At present, time-sensitive information is generally stored by a third party to prevent it from being leaked within a specific time period. For example, in an online auction system, the bidding information of each participant is recorded by a trusted middleman and will not be made public until the end of the auction. For another example, in an electronic voting system, voting information during the counting stage is counted by a trusted third party (such as a relevant agency or administrator). Summary of the invention
[0003] The embodiments of the present application provide an information encryption method and device.
[0004] In a first aspect, an embodiment of the present application provides an information encryption method, comprising: receiving input information from each participant in a participant set within a preset time period to obtain a target sequence; determining a target point corresponding to the target sequence on a predetermined semi-trusted elliptic curve through a preset hash function, and determining the target point as a public key, wherein the semi-trusted elliptic curve characterizes that the computational time used to solve its discrete logarithm problem matches the expected encryption time of the information to be encrypted, and a private key corresponding to the public key can be obtained by solving the discrete logarithm problem; encrypting the information to be encrypted through the public key to obtain a ciphertext.
[0005] In some embodiments, the above-mentioned receiving input information of each participant in the participant set within a preset time period to obtain the target sequence includes: obtaining the input information of each participant through the blocks in the blockchain within the preset time period; connecting the input information of each participant through the smart contract of the blockchain to obtain the target sequence.
[0006] In some embodiments, before determining the target point corresponding to the target sequence on a predetermined semi-trusted elliptic curve through a preset hash function and determining the target point as a public key, it also includes: determining a semi-trusted elliptic curve from a set of semi-trusted elliptic curves based on the computing time used to solve the discrete logarithm problem.
[0007] In some embodiments, the above method further includes: adjusting the order of the semi-trusted elliptic curve according to the actual computing time used to solve the discrete logarithm problem of the semi-trusted elliptic curve, so as to make the actual computing time tend to the expected encryption time of the information to be encrypted.
[0008] In some embodiments, the above method further includes: publicly announcing the public key to instruct multiple target persons to solve the discrete logarithm problem by collision calculation to obtain the private key corresponding to the public key.
[0009] In some embodiments, the above method also includes: in response to determining that a target person among multiple target persons calculates a private key, and verifies whether the private key is correct; in response to determining that the private key is correct, decrypting the ciphertext using the private key to obtain the information to be encrypted.
[0010] In some embodiments, the above method also includes: linking the block generated by the target person who calculates the private key to the end of the blockchain; and rewarding the target person who calculates the private key according to a preset reward method.
[0011] In the second aspect, an embodiment of the present application provides an information encryption device, including: an obtaining unit, configured to receive input information from each participant in a participant set within a preset time period, and obtain a target sequence; a first determination unit, configured to determine the target point corresponding to the target sequence on a predetermined semi-trusted elliptic curve through a preset hash function, and determine the target point as a public key, wherein the semi-trusted elliptic curve characterizes that the computing time used to solve its discrete logarithm problem matches the expected encryption time of the information to be encrypted, and a private key corresponding to the public key can be obtained by solving the discrete logarithm problem; an encryption unit, configured to encrypt the information to be encrypted through the public key to obtain a ciphertext.
[0012] In some embodiments, the obtaining unit is further configured to: obtain the input information of each participant through the blocks in the blockchain within a preset time period; connect the input information of each participant through the smart contract of the blockchain to obtain the target sequence.
[0013] In some embodiments, the apparatus further comprises: a second determining unit configured to determine a semi-trusted elliptic curve from a set of semi-trusted elliptic curves according to a computing time used to solve a discrete logarithm problem.
[0014] In some embodiments, the above-mentioned device also includes: an adjustment unit, configured to adjust the order of the semi-trusted elliptic curve according to the actual computing time used to solve the discrete logarithm problem of the semi-trusted elliptic curve, so as to make the actual computing time tend to the expected encryption time of the information to be encrypted.
[0015] In some embodiments, the above-mentioned device also includes: a publicizing unit, configured to publicly announce the public key to instruct multiple target persons to solve the discrete logarithm problem through collision calculation to obtain the private key corresponding to the public key.
[0016] In some embodiments, the above-mentioned device also includes: a verification unit, configured to calculate a private key in response to determining that one of multiple target persons is a target person, and verify whether the private key is correct; a decryption unit, configured to decrypt the ciphertext by the private key in response to determining that the private key is correct to obtain the information to be encrypted.
[0017] In some embodiments, the above-mentioned device also includes: a linking unit, configured to link the block generated by the target person who calculates the private key to the end of the blockchain; and a reward unit, configured to reward the target person who calculates the private key according to a preset reward method.
[0018] In a third aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the first aspect is implemented.
[0019] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation manner of the first aspect.
[0020] The information encryption method and device provided by the embodiment of the present application obtain a target sequence by receiving input information from each participant in a participant set within a preset time period; determining the target point corresponding to the target sequence on a predetermined semi-trusted elliptic curve by a preset hash function, and determining the target point as a public key, wherein the semi-trusted elliptic curve characterizes that the computing time used to solve its discrete logarithm problem matches the expected encryption time of the information to be encrypted, and the private key corresponding to the public key can be obtained by solving the discrete logarithm problem; encrypting the information to be encrypted by the public key to obtain a ciphertext, thereby providing an information encryption method using the semi-trusted elliptic curve, and improving the security of the ciphertext within the expected encryption time. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0022] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present application may be applied;
[0023] Figure 2 is a flow chart of an embodiment of the information encryption method according to the present application;
[0024] Figure 3 is a schematic diagram of an elliptic curve according to this embodiment;
[0025] Figure 4 is a schematic diagram of an application scenario of the information encryption method according to this embodiment;
[0026] Figure 5 is a flow chart of another embodiment of the information encryption method according to the present application;
[0027] Figure 6 is a structural diagram of an embodiment of an information encryption device according to the present application;
[0028] Figure 7 It is a schematic diagram of the structure of a computer system suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION
[0029] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0030] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0031] Figure 1 An exemplary architecture 100 to which the information encryption method and apparatus of the present application can be applied is shown.
[0032] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0033] Terminal devices 101, 102, 103 may be hardware devices or software that support network connection for data interaction and data processing. When terminal devices 101, 102, 103 are hardware, they may be various electronic devices that support network connection, information interaction, display, processing and other functions, including but not limited to smart phones, tablet computers, e-book readers, laptop computers and desktop computers, etc. When terminal devices 101, 102, 103 are software, they may be installed in the electronic devices listed above. They may be implemented as multiple software or software modules for providing distributed services, or they may be implemented as a single software or software module. No specific limitation is made here.
[0034] Server 105 may be a server that provides various services, such as a background processing server that receives input information from participants on terminal devices 101, 102, and 103 and performs information encryption. The background processing server receives input information from each participant in the participant set within a preset time period to obtain a target sequence; determines the target point corresponding to the target sequence on a predetermined semi-trusted elliptic curve through a preset hash function, and determines the target point as a public key, wherein the semi-trusted elliptic curve characterizes that the computing time used to solve its discrete logarithm problem matches the expected encryption time of the information to be encrypted, and the private key corresponding to the public key can be obtained by solving the discrete logarithm problem; encrypts the information to be encrypted through the public key to obtain a ciphertext. As an example, server 105 may be a cloud server.
[0035] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0036] It should also be noted that the information encryption method provided in the embodiments of the present disclosure can be executed by a server, or by a terminal device, or by a server and a terminal device in cooperation with each other. Accordingly, the various parts (such as various units, sub-units, modules, and sub-modules) included in the information encryption device can be all arranged in the server, or all arranged in the terminal device, or respectively arranged in the server and the terminal device.
[0037] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the system is only illustrative. Any number of terminal devices, networks, and servers may be provided as required. When the electronic device on which the information encryption method is running does not need to perform data transmission with other electronic devices, the system architecture may only include the electronic device (e.g., server or terminal device) on which the information encryption method is running.
[0038] Continue to refer Figure 2 , shows a process 200 of an embodiment of an information encryption method, comprising the following steps:
[0039] Step 201: receiving input information from each participant in a participant set within a preset time period to obtain a target sequence.
[0040] In this embodiment, the execution subject of the information encryption method (for example Figure 1The terminal device or server in the system can receive input information from each participant in the participant set within a preset time period to obtain a target sequence.
[0041] The preset time period is used to limit the time during which each participant in the participant set can input the corresponding input information. It can be understood that the preset time period can be specifically set according to actual conditions.
[0042] The participant set includes multiple participants, and multiple participants in the same participant set all have encryption requirements for information to be encrypted. The information to be encrypted may be any information, for example, the information to be encrypted may be time-sensitive information.
[0043] As an example, in an online auction system, all participants participating in the same auction activity can be regarded as being in the same participant set, and each participant can write his or her own bidding information (information to be encrypted) during the auction stage.
[0044] As another example, in an electronic voting system, multiple participants in the same voting activity can be considered to be in the same participant set, and each participant can write his or her own voting information (information to be encrypted) during the voting phase.
[0045] It should be noted that, within a preset time period, each participant in the participant set can write multiple input information.
[0046] In this embodiment, the execution subject may combine the input information of each participant in a preset combination mode to obtain the target sequence. As an example, the execution subject may connect the input information according to the input time corresponding to each input information to obtain the target sequence.
[0047] In some optional implementations of this embodiment, the execution subject may perform step 201 in the following manner:
[0048] First, the input information of each participant is obtained through the blocks in the blockchain within a preset time period.
[0049] In this implementation, the blockchain used is essentially a shared database, and the data or information stored therein has the characteristic of being unforgeable. Based on this, the above-mentioned execution entity can ensure that the input information in the blocks in the blockchain cannot be forged.
[0050] Then, the input information of each participant is connected through the blockchain's smart contract to obtain the target sequence.
[0051] In this embodiment, within a preset time period, each participant in the participant set can randomly write input information. Therefore, before the end of the preset time period, there is uncertainty in the target sequence, thereby improving the security of information encryption in subsequent steps.
[0052] Step 202: determine the target point corresponding to the target sequence on the predetermined semi-trusted elliptic curve through a preset hash function, and determine the target point as a public key.
[0053] In this embodiment, the execution subject can determine the target point corresponding to the target sequence obtained in step 201 on a predetermined semi-trusted elliptic curve through a preset hash function, and determine the target point as a public key. The semi-trusted elliptic curve characterizes that the computation time used to solve its discrete logarithm problem matches the expected encryption time of the information to be encrypted, and the private key corresponding to the public key can be obtained by solving the discrete logarithm problem.
[0054] In this embodiment, in general, the elliptic curve can be expressed by the following formula:
[0055] y 2 =x 3 +ax+b
[0056] Among them, a and b are coefficients, and 4a 3 +27b 2 ≠0.
[0057] As an example, Figure 3 As shown, the formula y 2 =x 3 Elliptic curve 301 represented by -2x+4.
[0058] In the elliptic curve, the addition operation is defined as follows: suppose there are two points on the elliptic curve, points A and B, then the straight line through these two points intersects the elliptic curve at a third point (point C); then, on the elliptic curve, take point D, which is the symmetric point of point C about the X axis, then point D is the sum of points A and B, and is written as D=A+B. It can be understood that point D is also on the elliptic curve. Therefore, the sum of two points on the elliptic curve is also a point on the elliptic curve.
[0059] In particular, if the two points coincide (that is, they are the same point E), then draw a tangent to the elliptic curve at point E; the tangent intersects the elliptic curve at the second point (point F), and then take point G, the symmetric point of point F about the X-axis, then point G is the sum of point E and itself, and is recorded as G=E+E.
[0060] It can be understood that addition in the elliptic curve satisfies the commutative law (for example, A+B=B+A) and the associative law (for example, (A+B)+C=A+(B+C)).
[0061] On this basis, the multiplication kP for any point P in the elliptic curve can be obtained by As an example, 23P can be calculated as follows:
[0062] P+P=2P, 2P+2P=4P, 4P+4P=8P, 8P+8P=16P;
[0063]
[0064] Understandably, through The addition operation can get the corresponding multiplication result. It should be noted that through the above-mentioned fast power algorithm, the result of kP can be quickly calculated under the premise of knowing k and P. However, it is difficult to calculate the value of k under the premise of knowing kP and P. As a result, the mathematical problem that the elliptic curve encryption algorithm relies on appears: k is a positive integer, P is the base point on the elliptic curve, k is calculated when kP and P are known.
[0065] Similarly, if we compare the addition operation of the above elliptic curve to the multiplication operation of the elliptic curve, the above mathematical problem can be deduced as follows: k is a positive integer, P is the base point on the elliptic curve, and P is known. k and P, calculate k. This mathematical puzzle is known as the discrete logarithm problem of elliptic curves.
[0066] In this embodiment, the semi-trusted elliptic curve represents an elliptic curve whose discrete logarithm problem can be solved within an expected time. It should be noted that even if the discrete logarithm problem of the semi-trusted elliptic curve can be solved, its optimal calculation method is still collision calculation.
[0067] It can be understood that the above-mentioned execution entity can select a semi-trusted elliptic curve whose computing time for solving its discrete logarithm problem matches the expected encryption time of the information to be encrypted, so as to encrypt the information to be encrypted using the discrete logarithm problem.
[0068] In this embodiment, the hash function represents a function that can transform an input of any length into an output of a fixed length through a hash algorithm. Taking the SHA256 function as an example, the function can transform an input of any length into an output of length 256 through a hash algorithm. By presetting the hash function, the target sequence can be mapped to a target point on a semi-trusted elliptic curve, and the target point can be used as a public key.
[0069] Taking the above discrete logarithm problem as an example, the point P obtained by mapping the target sequence to the elliptic curve through the hash function is k It can be used as a public key. It should be noted that this embodiment adopts an asymmetric encryption method. That is, the encrypted information is encrypted by the public key, and the encrypted information can be decrypted by the private key corresponding to the public key.
[0070] As an example, the execution entity may determine k obtained by solving the discrete logarithm problem of a semi-trusted elliptic curve as the private key corresponding to the public key.
[0071] Step 203: Encrypt the information to be encrypted using the public key to obtain a ciphertext.
[0072] In this embodiment, the execution subject may encrypt the information to be encrypted using the public key obtained in step 202 to obtain a ciphertext.
[0073] In this embodiment, the ciphertext obtained by public key encryption can only be decrypted by the private key. However, relevant research shows that there is no more effective calculation method for solving the discrete logarithm problem of semi-trusted elliptic curves than the collision calculation method. Therefore, the above-mentioned execution subject encrypts the information to be encrypted by the public key, so that the information to be encrypted is effectively encrypted within the calculation time of solving the discrete logarithm problem.
[0074] Continue to see Figure 4 , Figure 4 FIG4 is a schematic diagram 400 of an application scenario of the information encryption method according to this embodiment. Figure 4 In the application scenario, multiple bidders (participants) participated in a bidding activity. Among them, each bidder in the bidder set (participant set) corresponding to the bidding activity (including bidders 401, 402, and 403) inputs the bidding price information (information to be encrypted) through their respective terminal devices (including terminal devices 404, 405, and 406). Since the bidding price information of each bidder needs to be encrypted before the bidding activity is publicized, each bidder writes the input information on the terminal device. The server 407 receives the input information of each bidder in the bidder set and obtains the target sequence 409. Then, the server 407 determines the target point 4091 corresponding to the target sequence 408 on the predetermined semi-trusted elliptic curve 409 through a preset hash function, and determines the target point 4091 as the public key. Among them, the semi-trusted elliptic curve characterizes that the computing time used to solve its discrete logarithm problem matches the expected encryption time of the information to be encrypted, and the private key corresponding to the public key can be obtained by solving the discrete logarithm problem. Finally, the information to be encrypted 410 is encrypted by the public key to obtain the ciphertext 411.
[0075] The method provided by the above-mentioned embodiment of the present disclosure obtains a target sequence by receiving input information from each participant in a set of participants within a preset time period; determines the target point corresponding to the target sequence on a predetermined semi-trusted elliptic curve by a preset hash function, and determines the target point as a public key, wherein the semi-trusted elliptic curve characterizes that the computing time used to solve its discrete logarithm problem matches the expected encryption time of the information to be encrypted, and the private key corresponding to the public key can be obtained by solving the discrete logarithm problem; encrypts the information to be encrypted by the public key to obtain a ciphertext, thereby providing an information encryption method using the semi-trusted elliptic curve, which improves the security of the ciphertext within the expected encryption time.
[0076] In some optional implementations of the present embodiment, before determining the target point corresponding to the target sequence on a predetermined semi-trusted elliptic curve through a preset hash function and determining the target point as a public key, the above-mentioned execution entity may also determine the semi-trusted elliptic curve from the set of semi-trusted elliptic curves based on the computing time used to solve the discrete logarithm problem.
[0077] The semi-trusted elliptic curve set includes various semi-trusted elliptic curves. For each semi-trusted elliptic curve in the semi-trusted elliptic curve set, the execution subject can determine the computation time for solving the discrete logarithm problem of the semi-trusted elliptic curve according to the parameters of the semi-trusted elliptic curve and the computing power of the current computer. In this way, the execution subject can determine the semi-trusted elliptic curve used for the encryption operation according to the encryption time expected by the information to be encrypted and the computation time for solving the discrete logarithm problem of each semi-trusted elliptic curve.
[0078] As an example, the execution subject may determine the semi-trusted elliptic curve corresponding to the calculation time closest to the encryption time as the semi-trusted elliptic curve used for the encryption operation.
[0079] In some optional implementations of this embodiment, there is an error between the computation time estimated by the execution subject to solve the discrete logarithm problem of the semi-trusted elliptic curve and the actual computation time to solve the discrete logarithm problem, so that the actual encryption time of the information to be encrypted is different from the expected encryption time. In view of the above situation, the execution subject may adjust the order of the semi-trusted elliptic curve according to the actual computation time used to solve the discrete logarithm problem of the semi-trusted elliptic curve, so as to make the actual computation time approach the expected encryption time of the information to be encrypted.
[0080] It can be understood that by adjusting the order of the semi-trusted elliptic curve, the difficulty of solving the discrete logarithm problem of the semi-trusted elliptic curve can be adjusted, so that the actual calculation time can be adjusted to tend to the expected encryption time of the information to be encrypted.
[0081] In some optional implementations of this embodiment, after obtaining the ciphertext, the above-mentioned execution entity may publicly announce the public key to instruct multiple target persons to solve the discrete logarithm problem through collision calculation to obtain the private key corresponding to the public key.
[0082] In this implementation, the target person can be any person who can solve the discrete logarithm problem. As an example, this implementation is combined with blockchain technology, and its target person can be a miner in blockchain technology.
[0083] In some optional implementations of this embodiment, the above-mentioned execution entity calculates a private key in response to determining that one of the multiple target persons is a target person, and verifies whether the private key is correct; in response to determining that the private key is correct, the ciphertext is decrypted by the private key to obtain the information to be encrypted.
[0084] Continue with the above P k For example, if is the public key and k is the private key, the private key can be quickly verified to be correct by comparing it with the base point P of the elliptic curve. In response to determining that the private key is correct, the ciphertext is decrypted by the private key to obtain the encrypted information. In this implementation, the technology of decrypting the ciphertext encrypted by the public key by the private key is a relatively mature prior art and will not be described in detail here.
[0085] In some optional implementations of this embodiment, the above-mentioned execution entity may also link the block generated by the target person who calculates the private key to the end of the blockchain; and reward the target person who calculates the private key according to a preset reward method.
[0086] This implementation is combined with blockchain technology. As an example, a miner who has calculated a private key can link the generated block to the end of the blockchain. And according to a preset reward method (such as a preset amount of virtual currency), the miner who has calculated the private key is rewarded.
[0087] Continue to refer Figure 5 , shows a schematic process 500 of another embodiment of the information encryption method according to the present application, comprising the following steps:
[0088] Step 501, within a preset time period, obtain the input information of each participant through the blocks in the blockchain.
[0089] Step 502, connect the input information of each participant through the smart contract of the blockchain to obtain the target sequence.
[0090] Step 503: determine the target point corresponding to the target sequence on the predetermined semi-trusted elliptic curve through a preset hash function, and determine the target point as a public key.
[0091] Among them, the computation time used to solve the discrete logarithm problem of the semi-trusted elliptic curve representation matches the expected encryption time of the information to be encrypted, and the private key corresponding to the public key can be obtained by solving the discrete logarithm problem.
[0092] Step 504: encrypt the information to be encrypted using the public key to obtain a ciphertext.
[0093] Step 505, publicly announcing the public key to instruct multiple target persons to solve the discrete logarithm problem by collision calculation to obtain the private key corresponding to the public key.
[0094] Step 506, in response to determining that one of the multiple target persons has calculated a private key, verify whether the private key is correct.
[0095] Step 507, in response to determining that the private key is correct, the ciphertext is decrypted using the private key to obtain the information to be encrypted.
[0096] It can be seen from this embodiment that Figure 2 Compared with the corresponding embodiment, the process 500 of the information encryption method in this embodiment specifically illustrates the encryption and decryption process combined with the blockchain technology. In this way, the security of the information encryption in this embodiment is further improved.
[0097] Continue to refer Figure 6 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an information encryption device. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0098] like Figure 6 As shown, the information encryption device includes: including: an obtaining unit 601, which is configured to receive input information from each participant in a participant set within a preset time period to obtain a target sequence; a first determining unit 602, which is configured to determine the target point corresponding to the target sequence on a predetermined semi-trusted elliptic curve through a preset hash function, and determine the target point as a public key, wherein the semi-trusted elliptic curve represents that the computing time used to solve its discrete logarithm problem matches the expected encryption time of the information to be encrypted, and the private key corresponding to the public key can be obtained by solving the discrete logarithm problem; an encryption unit 603, which is configured to encrypt the information to be encrypted through the public key to obtain a ciphertext.
[0099] In some embodiments, the obtaining unit 601 is further configured to: obtain the input information of each participant through the blocks in the blockchain within a preset time period; connect the input information of each participant through the smart contract of the blockchain to obtain the target sequence.
[0100] In some embodiments, the above-mentioned apparatus further includes: a second determination unit (not shown in the figure), configured to determine a semi-trusted elliptic curve from a set of semi-trusted elliptic curves according to a computation time used to solve a discrete logarithm problem.
[0101] In some embodiments, the above-mentioned device also includes: an adjustment unit (not shown in the figure), which is configured to adjust the order of the semi-trusted elliptic curve according to the actual computing time used to solve the discrete logarithm problem of the semi-trusted elliptic curve, so as to make the actual computing time tend to the expected encryption time of the information to be encrypted.
[0102] In some embodiments, the above-mentioned device also includes: a public disclosure unit (not shown in the figure), which is configured to publicly disclose the public key to instruct multiple target persons to solve the discrete logarithm problem through collision calculation to obtain the private key corresponding to the public key.
[0103] In some embodiments, the above-mentioned device also includes: a verification unit (not shown in the figure), which is configured to calculate a private key in response to determining that one of multiple target persons is a target person, and verify whether the private key is correct; a decryption unit (not shown in the figure), which is configured to decrypt the ciphertext by the private key in response to determining that the private key is correct, to obtain the information to be encrypted.
[0104] In some embodiments, the above-mentioned device also includes: a linking unit (not shown in the figure), configured to link the block generated by the target person who calculates the private key to the end of the blockchain; a reward unit (not shown in the figure), configured to reward the target person who calculates the private key according to a preset reward method.
[0105] In this embodiment, the obtaining unit in the information encryption device receives input information from each participant in the participant set within a preset time period to obtain a target sequence; the first determination unit determines the target point corresponding to the target sequence on a predetermined semi-trusted elliptic curve through a preset hash function, and determines the target point as a public key, wherein the semi-trusted elliptic curve characterizes that the computing time used to solve its discrete logarithm problem matches the expected encryption time of the information to be encrypted, and the private key corresponding to the public key can be obtained by solving the discrete logarithm problem; the encryption unit encrypts the information to be encrypted through the public key to obtain a ciphertext, thereby providing an information encryption method using the semi-trusted elliptic curve, which improves the security of the ciphertext within the expected encryption time.
[0106] Reference below Figure 7 , which shows a device suitable for implementing the embodiments of the present application (eg Figure 1 Schematic diagram of the structure of a computer system 700 of devices 101, 102, 103, 105) shown. Figure 7 The device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0107] like Figure 7 As shown, the computer system 700 includes a processor (e.g., CPU, central processing unit) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The processor 701, ROM 702, and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0108] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0109] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 709, and / or installed from a removable medium 711. When the computer program is executed by the processor 701, the above-mentioned functions defined in the method of the present application are executed.
[0110] It should be noted that the computer-readable medium of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0111] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the client computer, partially on the client computer, as a separate software package, partially on the client computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the client computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0112] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the device, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0113] The units involved in the embodiments described in the present application may be implemented by software or by hardware. The units described may also be provided in a processor, for example, may be described as: a processor comprising an obtaining unit, a first determining unit, and an encryption unit. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the encryption unit may also be described as "a unit for encrypting encrypted information by a public key to obtain a ciphertext".
[0114] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by the device, the computer device: receives input information from each participant in the participant set within a preset time period to obtain a target sequence; determines the target point corresponding to the target sequence on a predetermined semi-trusted elliptic curve through a preset hash function, and determines the target point as a public key, wherein the semi-trusted elliptic curve characterizes that the computing time used to solve its discrete logarithm problem matches the expected encryption time of the information to be encrypted, and the private key corresponding to the public key can be obtained by solving the discrete logarithm problem; encrypts the information to be encrypted through the public key to obtain a ciphertext.
[0115] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
Claims
1. An information encryption method, comprising: Within a preset time period, receiving input information from each participant in the participant set to obtain a target sequence; Determine a semi-trusted elliptic curve from a set of semi-trusted elliptic curves based on a computation time used to solve a discrete logarithm problem; Determine the target point corresponding to the target sequence on the semi-trusted elliptic curve by a preset hash function, and determine the target point as a public key, wherein the semi-trusted elliptic curve represents that the computation time used to solve its discrete logarithm problem matches the expected encryption time of the information to be encrypted, and the private key corresponding to the public key can be obtained by solving the discrete logarithm problem; The information to be encrypted is encrypted by using the public key to obtain a ciphertext, wherein the private key can be used to decrypt the ciphertext after being verified according to the base point of the semi-trusted elliptic curve.
2. The method according to claim 1, wherein: The step of receiving input information from each participant in the participant set within a preset time period to obtain a target sequence includes: During the preset time period, obtaining input information of each participant through blocks in the blockchain; The target sequence is obtained by connecting the input information of each participant through the smart contract of the blockchain.
3. The method according to claim 1, wherein: Also includes: According to the actual calculation time used to solve the discrete logarithm problem of the semi-trusted elliptic curve, the order of the semi-trusted elliptic curve is adjusted to make the actual calculation time tend to the expected encryption time of the information to be encrypted.
4. The method according to claim 1, wherein: Also includes: The public key is made public to instruct multiple target persons to solve the discrete logarithm problem by collision calculation to obtain the private key corresponding to the public key.
5. The method according to claim 4, wherein: Also includes: In response to determining that one of the plurality of target persons has calculated the private key, verifying whether the private key is correct; In response to determining that the private key is correct, the ciphertext is decrypted using the private key to obtain the information to be encrypted.
6. The method according to claim 4, wherein: Also includes: Linking the block generated by the target person who calculated the private key to the end of the blockchain; According to a preset reward method, the target person who calculates the private key is rewarded.
7. An information encryption device, comprising: An obtaining unit is configured to receive input information from each participant in the participant set within a preset time period to obtain a target sequence; A second determining unit is configured to determine a semi-trusted elliptic curve from a set of semi-trusted elliptic curves based on a computation time used to solve a discrete logarithm problem; A first determination unit is configured to determine a target point corresponding to the target sequence on the semi-trusted elliptic curve by a preset hash function, and determine the target point as a public key, wherein the semi-trusted elliptic curve represents that a computation time used to solve its discrete logarithm problem matches an expected encryption time of the information to be encrypted, and a private key corresponding to the public key can be obtained by solving the discrete logarithm problem; The encryption unit is configured to encrypt the information to be encrypted by using the public key to obtain a ciphertext, wherein the private key can be used to decrypt the ciphertext after being verified according to the base point of the semi-trusted elliptic curve.
8. The device according to claim 7, wherein: The obtaining unit is further configured to: Within the preset time period, the input information of each participant is obtained through the blocks in the blockchain; the input information of each participant is connected through the smart contract of the blockchain to obtain the target sequence.
9. The device according to claim 7, wherein: Also includes: The adjustment unit is configured to adjust the order of the semi-trusted elliptic curve according to the actual calculation time used to solve the discrete logarithm problem of the semi-trusted elliptic curve, so as to make the actual calculation time tend to the expected encryption time of the information to be encrypted.
10. The device according to claim 7, wherein: Also includes: The publicizing unit is configured to publicly announce the public key to instruct multiple target persons to solve the discrete logarithm problem by collision calculation to obtain the private key corresponding to the public key.
11. The device according to claim 10, wherein: Also includes: A verification unit configured to verify whether the private key is correct in response to determining that one of the plurality of target persons has calculated the private key; The decryption unit is configured to, in response to determining that the private key is correct, decrypt the ciphertext using the private key to obtain the information to be encrypted.
12. The device according to claim 10, wherein: Also includes: a linking unit configured to link a block generated by a target person who calculates the private key to the end of the blockchain; The reward unit is configured to reward the target person who calculates the private key according to a preset reward method.
13. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
14. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Voting method, device and equipment based on Blockchain, and medium
CN108768607A