WO2022068361A1 - Encryption method and apparatus based on amendment amount, and device, and medium - Google Patents

Encryption method and apparatus based on amendment amount, and device, and medium Download PDF

Info

Publication number
WO2022068361A1
WO2022068361A1 PCT/CN2021/109265 CN2021109265W WO2022068361A1 WO 2022068361 A1 WO2022068361 A1 WO 2022068361A1 CN 2021109265 W CN2021109265 W CN 2021109265W WO 2022068361 A1 WO2022068361 A1 WO 2022068361A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
target information
block
target
ciphertext
Prior art date
Application number
PCT/CN2021/109265
Other languages
French (fr)
Chinese (zh)
Inventor
贾牧
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2022068361A1 publication Critical patent/WO2022068361A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the present application relates to the field of blockchain technology, and in particular, to an encryption method, device, device and medium based on corrections.
  • the inventor realizes that at present, the Internet of Things has become an important part of the Internet, and the number of Internet of Things devices in the world maintains a rapid growth. In the future Internet of Things, due to any individual, group, community, organization, object, product, data, service , processes and activities will all be interconnected through the Internet of Things. Different IoT devices need to receive and store a large amount of information every day. For example, in the field of digital medical technology, hospital management equipment needs to receive and store a large number of patients' electronic information file information and medical treatment information every day. In practice, the inventor found that the information stored in the IoT device is easily tampered with by illegal users, which leads to information leakage, resulting in low information security.
  • Embodiments of the present application provide an encryption method, device, device, and medium based on a correction amount, which can improve the security of information.
  • an embodiment of the present application provides an encryption method based on a correction amount, and the method includes:
  • Correction processing is performed on the target information by using the correction amount to obtain the corrected target information
  • the ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
  • an embodiment of the present application provides an encryption device based on a correction amount, the device comprising:
  • the acquisition module is used to acquire the target function used to describe the information, and the target information to be processed;
  • a generating module configured to obtain block information corresponding to a block from the block chain network, and generate a correction amount for performing correction processing on the target information according to the block information;
  • a processing module configured to perform correction processing on the target information by using the correction amount to obtain the corrected target information
  • the obtaining module is further configured to obtain coordinate information corresponding to the modified target information according to the target function;
  • an encryption module configured to encrypt the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information
  • a determination module configured to determine the ciphertext of the coordinate information corresponding to the corrected target information as the ciphertext of the target information, and store the ciphertext of the target information in the blockchain network.
  • an embodiment of the present application provides an electronic device, the device comprising: a processor adapted to implement one or more instructions; and,
  • a computer storage medium storing one or more instructions adapted to be loaded by the processor and perform the following steps:
  • Correction processing is performed on the target information by using the correction amount to obtain the corrected target information
  • the ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
  • an embodiment of the present application provides a computer-readable storage medium, including: the computer-readable storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded and executed by a processor follows the steps below:
  • Correction processing is performed on the target information by using the correction amount to obtain the corrected target information
  • the ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
  • the present application can improve the security of the target information, and avoid the ciphertext of the target information being tampered with by illegal users, resulting in the problem that the target information cannot be obtained by decrypting the ciphertext of the target information.
  • FIG. 1 is a schematic structural diagram of an information processing system provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of an encryption method based on a correction amount provided by an embodiment of the present application
  • FIG. 3 is a schematic flowchart of an encryption method based on a correction amount provided by an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of a correction amount-based encryption device provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by another embodiment of the present application.
  • Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission (P2P transmission), consensus mechanism, encryption algorithm, etc. It is essentially a decentralized and highly transparent database; It consists of a series of transaction records (also known as blocks) that are connected and protected by cryptography.
  • the distributed ledger connected by the blockchain allows multiple parties to effectively record transactions, and can permanently verify this transaction (non-tampering ).
  • the consensus mechanism refers to the mathematical algorithm that realizes the establishment of trust between different nodes and the acquisition of rights and interests in the blockchain network; that is to say, the consensus mechanism is a mathematical algorithm recognized by all network nodes of the blockchain. This application utilizes the feature that the information in the blockchain cannot be tampered with.
  • the ciphertext of the target information is obtained, and the ciphertext of the target information is stored in the blockchain, so that the ciphertext of the target information can be avoided from being tampered with. Tampering, improve the security of target information.
  • This application can be used in digital medical scenarios, that is, the above-mentioned target information can refer to the patient's electronic information file, the patient's medical treatment information, etc.
  • Encrypting and storing the encrypted data in the blockchain network is conducive to realizing medical informatization, remote medical data sharing, remote medical treatment, and improving the security of information in digital medical scenarios.
  • the information processing system may include a blockchain network 10 and at least two terminals.
  • the information processing system includes two terminals as For example, they are terminal 20 and terminal 21, respectively.
  • the blockchain network is an end-to-end decentralized network composed of multiple node devices.
  • the blockchain network in FIG. 1 includes multiple node devices 101 .
  • Each node device can receive transaction data during normal work, and maintain the blockchain based on the received transaction data.
  • there can be a communication connection between each node device in the blockchain network and data transmission can be performed between the node devices through the above communication connection.
  • any node device in the blockchain network receives transaction data
  • other node devices in the blockchain network obtain the transaction data according to the consensus algorithm, and store the transaction data as the data in the blockchain, so that the region The data stored on all node devices in the blockchain network is consistent.
  • each node device in the blockchain network has its corresponding node ID, and each node device in the blockchain network can store the node IDs of other node devices in the blockchain network, so that Subsequently, according to the node identifiers of other node devices, the generated blocks are broadcast to other node devices in the blockchain network.
  • Each node device can maintain a node ID list as shown in the following table, and store the node device name and node ID correspondingly in the node ID list.
  • the node identifier may be an IP (Internet Protocol, a protocol for interconnection between networks) address and any other information that can be used to identify the node device. In Table 1, only the IP address is used as an example for description.
  • the terminal 20 and the terminal 21 can store the information in the blockchain network, and can also read the information from the blockchain network. Specifically, the terminal 20 and the terminal 21 can encrypt the target information to be processed, and encrypt the encrypted information of the target information. Alternatively, the terminal 20 and the terminal 21 can directly upload the target information to be processed to the blockchain network, and the target information is encrypted by the node device in the blockchain network, and the target information is encrypted. ciphertext storage.
  • the above node device may specifically be an independent server, or a server cluster composed of several servers, or a cloud computing center, tablet computer, notebook computer, handheld computer, smart audio, mobile Internet device (MID, mobile internet device). )and many more.
  • Both the terminal 20 and the terminal 21 can be computer devices, including mobile phones, tablet computers, notebook computers, handheld computers, smart speakers, POS (Point of sales, point of sale) machines, mobile Internet devices (MID, mobile Internet device), wearable A device (such as a smart watch, a smart bracelet, etc.), etc.; it may also refer to an independent server, a server cluster composed of several servers, or a cloud computing center.
  • FIG. 2 is a schematic flowchart of an encryption method based on a correction amount provided by an embodiment of the present application.
  • the embodiment of the present application is executed by an electronic device, and the electronic device may refer to a node device or a terminal in the above-mentioned information processing system.
  • the encryption method based on the correction amount includes the following steps S101-S106.
  • the electronic device can acquire the target function used to describe the information and the target information to be processed.
  • the objective function may refer to a function corresponding to an elliptic curve, or of course, it may refer to a function corresponding to other curves;
  • the target information may refer to transaction data, and the transaction data may refer to transaction amount, transaction time, etc.; or, the target Information can refer to the revenue data of a certain organization, such as turnover, number of shipments, number of purchases, and so on.
  • the objective function can only be used to describe the information belonging to the finite field, that is to say, if the target information exceeds the finite field, the objective function cannot be directly used to describe the target information. That is, if the target information exceeds the finite field, the target information needs to be corrected so that the corrected target information belongs to the finite field.
  • the finite field is determined according to the function type of the objective function. For example, if the objective function is a function corresponding to an elliptic curve with a length of 32 bytes, the finite field (marked as P) is 2 ⁇ 256-w, and w is a very small positive number; when the value corresponding to the target information is less than When P, it indicates that the target information belongs to the valid domain. Therefore, the electronic device can obtain the block information corresponding to the block from the block chain network, and generate a correction amount for correcting the target information according to the block information.
  • the block information includes the block height and block generation. time and so on.
  • the block information includes a block height
  • the above-mentioned generating a correction amount for performing correction processing on the target information according to the block information includes: obtaining the block height corresponding to each block in the block chain network. Obtain the maximum block height from , as the target block height, count the number of pieces of information stored in the block corresponding to the height of the target block from the blockchain network; perform random operations on the number of pieces of information to obtain a random number , and the random number is determined as a correction amount for performing correction processing on the target information.
  • the computer equipment can generate the correction amount used to correct the target information according to the block height.
  • the maximum block height can be obtained from the block heights corresponding to each block in the blockchain network as the target block height. , count the number of pieces of information stored in the block corresponding to the height of the target block from the blockchain network, use a random algorithm to perform random operations on the number of pieces of information to obtain a random number, and determine the random number as the The correction amount for the correction processing of the target information.
  • the random algorithm here includes, but is not limited to: Las Vegas algorithm, Monte Carlo algorithm, Sherwood algorithm, numerical probability algorithm and so on.
  • the block information includes a block generation time
  • generating a correction amount for performing correction processing on the target information according to the block information includes: acquiring the block corresponding to each block in the block chain network.
  • the sum of the block generation times is the sum of the time; the earliest block generation time is determined from the block generation times corresponding to each block in the blockchain network as the target block generation time; according to the target block generation time
  • a remainder operation is performed on the time sum to obtain a first numerical value, and the first numerical value is determined as a correction amount for performing correction processing on the target information.
  • the computer device can generate a correction amount for performing correction processing on the target information according to the block generation time, and specifically, obtain the sum of the block generation times corresponding to each block in the blockchain network, and obtain the time sum; Obtain the block generation time corresponding to each block in the blockchain network and determine the earliest block generation time as the target block generation time, that is, the target block generation time is the earliest generated block in the blockchain network. generation time. A remainder operation is performed on the time sum according to the target block generation time to obtain a first numerical value, and the first numerical value is determined as a correction amount for performing correction processing on the target information.
  • the electronic device can use the correction amount to perform correction processing on the target information to obtain corrected target information.
  • the correction amount can be used to perform correction processing on the value of the target information to obtain corrected target information.
  • the correction processing may refer to a modulo operation, a remainder operation, a subtraction operation, and the like. Correcting the target information by the correction amount can effectively improve the success rate of using the objective function to describe the target information.
  • the electronic device can use the coordinate points on the curve of the objective function to describe the corrected target information.
  • the corrected target information can be mapped to the first coordinate of the target point on the curve of the objective function, and according to the first coordinate of the target point.
  • the coordinates and the objective function obtain the second coordinate of the target point, and use the first coordinate and the second coordinate as coordinate information corresponding to the corrected target information.
  • the first coordinate may refer to the X coordinate
  • the second coordinate may refer to the Y coordinate
  • the first coordinate may refer to the Y coordinate
  • the second coordinate may refer to the X coordinate.
  • the electronic device can use an encryption algorithm to encrypt the coordinate information corresponding to the revised target information, and obtain the ciphertext of the coordinate information corresponding to the revised target information.
  • the encryption algorithm can include but is not limited to the Elgamal algorithm (an asymmetric encryption algorithm). ), Rabin algorithm (an asymmetric encryption algorithm), Diffie-Hellman algorithm (an asymmetric encryption algorithm), ECC algorithm (elliptic curve encryption algorithm).
  • the ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network; it can prevent the target information from being stored locally in the terminal, resulting in the target information being destroyed. Tampering, improve the security of target information.
  • the correction is obtained.
  • the obtained target information can effectively improve the success rate of using the objective function to describe the target information.
  • the ciphertext of the coordinate information corresponding to the modified target information is obtained, and the coordinate information corresponding to the modified target information is obtained.
  • the ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network. That is, by encrypting the coordinate information of the corrected target information, the security of the target information can be improved; by storing the ciphertext of the coordinate information of the corrected target information in the blockchain network, the ciphertext of the target information can be avoided. It is tampered with by illegal users, resulting in the problem that the target information cannot be obtained by decrypting the ciphertext of the target information.
  • FIG. 3 is a schematic flowchart of another correction amount-based encryption method provided by an embodiment of the present application.
  • the embodiment of the present application is executed by an electronic device.
  • the correction amount-based encryption method includes the following steps S201 to S205 .
  • S203 Determine a second value corresponding to the target information according to the information type of the target information.
  • the electronic device may use the correction amount to perform correction processing on the target information.
  • the second value corresponding to the target information may be determined according to the information type of the target information, and the difference between the second value and the correction amount may be calculated. The sum of the three values is obtained.
  • Obtain the function parameters of the objective function and generate the correction weight according to the function parameters. If the function parameter is the length of the curve of the objective function, if the length is 32 bytes, that is, 256 bits, the correction weight can be 2 ⁇ 256.
  • Modulo operation can be performed on the third numerical value according to the correction weight to obtain a fourth numerical value, and the fourth numerical value can be determined as the corrected target information.
  • the following formula (1) can be used to express the corrected target information.
  • formula (1) is the corrected target information
  • offset is the correction amount
  • M is the second value corresponding to the target information
  • mod is the modulo operator
  • the above-mentioned determining the second value corresponding to the target information according to the information type of the target information includes: if the information type of the target information is a non-numerical type, encoding the target information to obtain the encoded target information. , the encoded target information is determined as the second value corresponding to the target information; if the information type of the target information is a value type, the target information is determined as the second value corresponding to the target information.
  • the computer equipment can obtain the information type of the target information.
  • the information type of the target information includes a numerical type and a non-numerical type. at least one of the composition. If the information type of the target information is a non-numerical type, an encoding algorithm is used to numerically encode the target information to obtain the encoded target information, and the encoded target information is used as the second value corresponding to the target information; here the encoding algorithm It can include: pulse code modulation algorithm (Pulse Code Modulation, PCM), non-return zero code algorithm (Non Return Zero, NRZ) and Manchester coding algorithm and so on. If the information type of the target information is a numerical type, the target information may be determined as a second numerical value corresponding to the target information.
  • PCM Pulse Code Modulation
  • Non Return Zero Non Return Zero
  • S208 Encrypt the coordinate information corresponding to the corrected target information to obtain the ciphertext of the coordinate information corresponding to the corrected target information.
  • encrypting the coordinate information corresponding to the corrected target information above to obtain the ciphertext of the coordinate information corresponding to the corrected target information includes: obtaining attribute information of the terminal to which the target information belongs, and the target information.
  • the key corresponding to the information, the attribute information of the terminal includes at least one of the terminal identifier of the terminal, the password generated by the terminal, and the user information corresponding to the terminal; the private key of the terminal is generated according to the attribute information of the terminal; according to The private key and the key corresponding to the target information are encrypted with the coordinate information corresponding to the revised target information, and the ciphertext of the coordinate information corresponding to the revised target information is obtained.
  • the electronic device can obtain the key corresponding to the target information, and the key corresponding to the target information can be generated according to the attribute information of the target information.
  • the attribute information of the target information includes the organization to which the target information belongs, the generation time of the target information, and the information of the target information. length, etc. Further, attribute information of the terminal to which the target information belongs can be obtained, and the attribute information of the terminal includes at least one of a terminal identifier of the terminal, a password generated by the terminal, and user information corresponding to the terminal, and the terminal identifier may refer to the terminal.
  • At least one of the IP address, MAC address, serial number, etc., user information may refer to the user account, user phone number, etc.; the password generated by the terminal may be randomly generated, or generated according to certain rules. A random number is generated according to the attribute information of the terminal, and the random number is filled to obtain the private key of the terminal.
  • the private key of the terminal may include 256 bits (ie bits). Then, according to the private key and the key corresponding to the target information, the coordinate information corresponding to the revised target information can be encrypted to obtain the ciphertext of the coordinate information corresponding to the revised target information; Encrypting the coordinate information corresponding to the corrected target information by encrypting the key corresponding to the information can improve the security of the target information.
  • the attribute information of the target information includes the generation time of the target information
  • obtaining the key corresponding to the target information according to the attribute information of the target information includes: performing a hash operation on the generation time of the target information to obtain the first hash. value, perform a hash operation on the first hash value to obtain a second hash value, and determine the second hash value as the key corresponding to the target information.
  • the attribute information of the target information includes the information length of the target information, and obtaining the key corresponding to the target information according to the attribute information of the target information includes: using a random algorithm to perform a random operation on the information length of the target information to obtain the corresponding information length. Perform a hash operation on the random number corresponding to the length of the information to obtain a hash value corresponding to the random number; perform a hash operation on the hash value corresponding to the random number to obtain the key corresponding to the target information.
  • the coordinate information corresponding to the revised target information is encrypted to obtain the ciphertext of the coordinate information corresponding to the revised target information, including: obtaining The base point coordinate of the curve of the objective function; obtain the product of the base point coordinate and the private key of the terminal to obtain the candidate coordinate; encrypt the candidate coordinate according to the key corresponding to the target information to obtain the ciphertext of the candidate coordinate;
  • the coordinate information corresponding to the corrected target information is fused with the ciphertext of the candidate coordinates to obtain the ciphertext of the coordinate information corresponding to the corrected target information.
  • the electronic device can obtain the base point coordinates of the curve of the objective function, and calculate the product of the G point coordinates and the private key of the terminal to obtain candidate coordinates, and encrypt the candidate coordinates according to the key corresponding to each piece of sub-information to obtain the The ciphertext of the candidate coordinates; the coordinate information corresponding to the modified target information is fused with the ciphertext of the corresponding candidate coordinates to obtain the ciphertext of the coordinate information corresponding to the modified target information.
  • the ciphertext of the coordinate information corresponding to the corrected target information may be expressed by the following formula (2).
  • PC represents the ciphertext of the coordinate information corresponding to the corrected target information
  • k represents the key of the target information
  • H is the candidate coordinate
  • P M represents the coordinate information corresponding to the corrected target information
  • k*H represents the ciphertext of the candidate coordinate information
  • the candidate coordinate can be represented by the following formula (3).
  • h represents the private key of the terminal
  • G represents the base point coordinates of the curve of the objective function, which can be represented as (x g , y g ).
  • the electronic device can receive the terminal's acquisition request for the target information, and verify whether the terminal has the authority to acquire the target information according to the acquisition request, and if the terminal has the authority to acquire the target information, read the target information from the blockchain network.
  • the ciphertext of the information that is, the ciphertext of the coordinate information corresponding to the revised target information
  • decrypt the ciphertext of the coordinate information corresponding to the revised target information and obtain the coordinate information corresponding to the revised target information
  • the corrected target information to determine the corrected target information
  • obtain the correction amount corresponding to the target information from the blockchain network determine the target information according to the correction amount and the corrected target information, and return the target information to to the terminal.
  • the ciphertext of the target information can be read from the blockchain network, the ciphertext of the target information can be decrypted, the target information can be obtained, and the target information can be returned to the terminal to achieve information sharing.
  • the electronic device can receive the terminal's acquisition request for the target information, the acquisition request can include attribute information corresponding to the terminal, the information identifier of the acquired target information, etc.; and verify whether the terminal has the right to acquire the target information according to the terminal's attribute information. If it is determined that the terminal does not have the right to acquire the target information, the target information is refused to be returned to the terminal.
  • the ciphertext of the target information (that is, the ciphertext of the coordinate information corresponding to the corrected target information) can be read from the blockchain network according to the information identifier of the target information.
  • the ciphertext of the coordinate information corresponding to the target information is decrypted to obtain the coordinate information corresponding to the revised target information; the revised target information is determined according to the objective function and the coordinate information corresponding to the revised target information; obtained from the blockchain network
  • the correction amount corresponding to the target information is determined according to the correction amount and the corrected target information, and the target information is returned to the terminal.
  • the correction is obtained.
  • the obtained target information can effectively improve the success rate of using the objective function to describe the target information.
  • the ciphertext of the coordinate information corresponding to the modified target information is obtained, and the coordinate information corresponding to the modified target information is obtained.
  • the ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network. That is, by encrypting the coordinate information of the corrected target information, the security of the target information can be improved; by storing the ciphertext of the coordinate information of the corrected target information in the blockchain network, the ciphertext of the target information can be avoided. It is tampered with by illegal users, resulting in the problem that the target information cannot be obtained by decrypting the ciphertext of the target information.
  • FIG. 4 is a schematic structural diagram of a correction amount-based encryption device provided by an embodiment of the present application.
  • the blockchain-based information device in this embodiment includes:
  • Obtaining module 401 for obtaining the target function for describing information, and target information to be processed
  • the generation module 402 is used to obtain the block information corresponding to the block from the block chain network, and according to the block information, generate a correction amount for performing correction processing on the target information;
  • a processing module 403 configured to perform correction processing on the target information by using the correction amount to obtain corrected target information
  • the obtaining module 401 is further configured to obtain coordinate information corresponding to the modified target information according to the target function;
  • An encryption module 404 configured to encrypt the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information;
  • the determining module 405 is configured to determine the ciphertext of the coordinate information corresponding to the corrected target information as the ciphertext of the target information, and store the ciphertext of the target information in the blockchain network.
  • the block information includes a block height
  • the generating module 402 generates a correction amount for performing correction processing on the target information according to the block information, including:
  • a random operation is performed on the number of pieces of information to obtain a random number, and the random number is determined as a correction amount for performing correction processing on the target information.
  • the block information includes a block generation time
  • the generation module 402 generates a correction amount for performing correction processing on the target information according to the block information, including:
  • a remainder operation is performed on the time sum according to the target block generation time to obtain a first numerical value, and the first numerical value is determined as a correction amount for performing correction processing on the target information.
  • the processing module 403 uses the correction amount to perform correction processing on the target information to obtain corrected target information, including:
  • a modulo operation is performed on the third numerical value according to the correction weight to obtain a fourth numerical value, and the fourth numerical value is determined as the corrected target information.
  • the processing module 403 determines the second value corresponding to the target information according to the information type of the target information, including:
  • the target information is encoded to obtain the encoded target information, and the encoded target information is determined as the second numerical value corresponding to the target information;
  • the target information is determined as a second value corresponding to the target information.
  • the encryption module 404 encrypts the coordinate information corresponding to the revised target information, and obtains the ciphertext of the coordinate information corresponding to the revised target information, including:
  • attribute information of the terminal to which the target information belongs and a key corresponding to the target information, where the attribute information of the terminal includes the terminal identifier of the terminal, the password generated by the terminal, and the user information corresponding to the terminal. at least one of;
  • the coordinate information corresponding to the modified target information is encrypted to obtain the ciphertext of the coordinate information corresponding to the modified target information.
  • the encryption module 404 encrypts the coordinate information corresponding to the revised target information according to the private key and the key corresponding to the target information to obtain the coordinates corresponding to the revised target information.
  • Encrypted text of information including:
  • the coordinate information corresponding to the corrected target information and the ciphertext of the candidate coordinates are fused to obtain the ciphertext of the coordinate information corresponding to the corrected target information.
  • the correction is obtained.
  • the obtained target information can effectively improve the success rate of using the objective function to describe the target information.
  • the ciphertext of the coordinate information corresponding to the modified target information is obtained, and the coordinate information corresponding to the modified target information is obtained.
  • the ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network. That is, by encrypting the coordinate information of the corrected target information, the security of the target information can be improved; by storing the ciphertext of the coordinate information of the corrected target information in the blockchain network, the ciphertext of the target information can be avoided. It is tampered with by illegal users, resulting in the problem that the target information cannot be obtained by decrypting the ciphertext of the target information.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device may include a processor, which is suitable for implementing one or more instructions; and a computer-readable storage medium, the computer-readable storage medium.
  • the medium may store one or more instructions suitable for being loaded by a processor and performing the above-described method.
  • the electronic device may further include a memory.
  • the electronic device may further include at least one of an input device and an output device.
  • the electronic device in this embodiment as shown in FIG. 5 may include: one or more processors 21 ; one or more input devices 22 , one or more output devices 23 and a memory 24 .
  • the above-mentioned processor 21 , input device 22 , output device 23 , and memory 24 are connected through a bus 25 .
  • the processor 21 can be a central processing unit (Central Processing Unit, CPU), and the processor can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC) ), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the input device 22 may include a touch panel, a fingerprint sensor (used to collect the user's fingerprint information and fingerprint direction information), a microphone, etc.
  • the output device 23 may include a display (LCD, etc.), a speaker, etc., and the output device 23 may output corrections The processed data table.
  • the memory 24 may include read only memory and random access memory and provides instructions and data to the processor 21 .
  • a portion of the memory 24 may also include non-volatile random access memory, the memory 24 for storing a computer program including program instructions, and the processor 21 for executing the program instructions stored in the memory 24 for executing a A modifier-based encryption method that is used to do the following:
  • Correction processing is performed on the target information by using the correction amount to obtain the corrected target information
  • the ciphertext of the coordinate information corresponding to the modified target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
  • the block information includes block height
  • the processor 21 is configured to execute program instructions stored in the memory 24 to perform the following operations:
  • a correction amount for performing correction processing on the target information including:
  • a random operation is performed on the number of pieces of information to obtain a random number, and the random number is determined as a correction amount for performing correction processing on the target information.
  • the block information includes block generation time
  • the processor 21 is used to execute the program instructions stored in the memory 24 to perform the following operations:
  • a remainder operation is performed on the time sum according to the target block generation time to obtain a first numerical value, and the first numerical value is determined as a correction amount for performing correction processing on the target information.
  • the processor 21 is configured to execute program instructions stored in the memory 24 to perform the following operations:
  • a modulo operation is performed on the third numerical value according to the correction weight to obtain a fourth numerical value, and the fourth numerical value is determined as the corrected target information.
  • the processor 21 is configured to execute program instructions stored in the memory 24 to perform the following operations:
  • the target information is encoded to obtain encoded target information, and the encoded target information is determined as the second value corresponding to the target information;
  • the target information is determined as a second value corresponding to the target information.
  • the processor 21 is configured to execute program instructions stored in the memory 24 to perform the following operations:
  • attribute information of the terminal to which the target information belongs and a key corresponding to the target information, where the attribute information of the terminal includes the terminal identifier of the terminal, the password generated by the terminal, and the user information corresponding to the terminal. at least one of;
  • the coordinate information corresponding to the modified target information is encrypted to obtain the ciphertext of the coordinate information corresponding to the modified target information.
  • the processor 21 is configured to execute program instructions stored in the memory 24 to perform the following operations:
  • the coordinate information corresponding to the corrected target information and the ciphertext of the candidate coordinates are fused to obtain the ciphertext of the coordinate information corresponding to the corrected target information.
  • the correction is obtained.
  • the obtained target information can effectively improve the success rate of using the objective function to describe the target information.
  • the ciphertext of the coordinate information corresponding to the modified target information is obtained, and the coordinate information corresponding to the modified target information is obtained.
  • the ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network. That is, by encrypting the coordinate information of the corrected target information, the security of the target information can be improved; by storing the ciphertext of the coordinate information of the corrected target information in the blockchain network, the ciphertext of the target information can be avoided. It is tampered with by illegal users, resulting in the problem that the target information cannot be obtained by decrypting the ciphertext of the target information.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program includes program instructions, and when the program instructions are executed by a processor, FIG. 2 and FIG. 2 are implemented. 3.
  • the encryption method based on the correction amount shown in the embodiment.
  • the storage medium involved in the present application may be a readable storage medium, and the storage medium involved in the present application, such as a computer-readable storage medium, may be non-volatile or volatile.
  • the computer-readable storage medium may be an internal storage unit of the electronic device described in any of the foregoing embodiments, such as a hard disk or a memory of the electronic device.
  • the computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) ) card, flash memory card (FlashCard) and so on.
  • the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device.
  • the computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device.
  • the computer-readable storage medium can also be used to temporarily store data that has been or will be output.
  • the above-described computer-readable storage medium may be deployed to execute on one computer device, or be deployed to execute on multiple computer devices located at one site, or, alternatively, distributed in multiple sites and interconnected by a communication network.
  • Executed on a single computer device a plurality of computer devices distributed in multiple locations and interconnected by a communication network can form a blockchain network.
  • the disclosed electronic devices and methods may be implemented in other manners.
  • the device embodiments described above are illustrative, for example, the division of the units may be a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Finance (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Accounting & Taxation (AREA)
  • Bioethics (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Storage Device Security (AREA)

Abstract

Disclosed are an encryption method and apparatus based on an amendment amount, and a device, and a medium, relating to blockchain technology and digital medical technology. The method comprises: acquiring a target function used to describe information, and target information to be processed; acquiring, from a blockchain network, block information corresponding to blocks, and generating, according to the block information, an amendment amount used to amend the target information; amending the target information by using the amendment amount, so as to obtain amended target information; acquiring, according to the target function, coordinate information corresponding to the amended target information; encrypting the coordinate information corresponding to the amended target information, so as to obtain ciphertext of the coordinate information corresponding to the amended target information; and determining the ciphertext of the coordinate information corresponding to the amended target information to be ciphertext of the target information, and storing the ciphertext of the target information in the blockchain network. By using the present application, the security of messages can be improved.

Description

基于修正量的加密方法、装置、设备及介质Correction-based encryption method, device, device and medium
本申请要求于2020年9月29日提交中国专利局、申请号为202011053237.8,发明名称为“基于修正量的加密方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on September 29, 2020 with the application number 202011053237.8 and the title of the invention is "An encryption method, device, equipment and medium based on correction amount", the entire contents of which are by reference Incorporated in this application.
技术领域technical field
本申请涉及区块链技术领域,尤其涉及一种基于修正量的加密方法、装置、设备及介质。The present application relates to the field of blockchain technology, and in particular, to an encryption method, device, device and medium based on corrections.
背景技术Background technique
发明人意识到,目前,物联网已成为互联网的一个重要组成部分,全球物联网设备数量保持高速增长,在未来的物联网中由于任何个人、团体、社区、组织、对象、产品、数据、服务、进程和活动都将通过物联网相互互联。而不同物联网设备每天均需要接收并存储大量信息,例如,在数字医疗技术领域中,医院的管理设备每天需要接收并存储大量患者的电子信息档案信息、以及就诊信息等。发明人实践中发现,物联网设备中所存储的信息容易被非法用户篡改,并导致信息泄露,导致信息的安全性比较低。The inventor realizes that at present, the Internet of Things has become an important part of the Internet, and the number of Internet of Things devices in the world maintains a rapid growth. In the future Internet of Things, due to any individual, group, community, organization, object, product, data, service , processes and activities will all be interconnected through the Internet of Things. Different IoT devices need to receive and store a large amount of information every day. For example, in the field of digital medical technology, hospital management equipment needs to receive and store a large number of patients' electronic information file information and medical treatment information every day. In practice, the inventor found that the information stored in the IoT device is easily tampered with by illegal users, which leads to information leakage, resulting in low information security.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种基于修正量的加密方法、装置、设备及介质,可提高信息的安全性。Embodiments of the present application provide an encryption method, device, device, and medium based on a correction amount, which can improve the security of information.
第一方面,本申请实施例提供了一种基于修正量的加密方法,该方法包括:In a first aspect, an embodiment of the present application provides an encryption method based on a correction amount, and the method includes:
获取用于描述信息的目标函数,以及待处理的目标信息;Obtain the objective function used to describe the information, and the target information to be processed;
从区块链网络中获取区块对应的区块信息,根据所述区块信息生成用于对所述目标信息进行修正处理的修正量;Obtain block information corresponding to a block from the block chain network, and generate a correction amount for performing correction processing on the target information according to the block information;
采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息;Correction processing is performed on the target information by using the correction amount to obtain the corrected target information;
根据所述目标函数获取所述修正后的目标信息对应的坐标信息;Obtain coordinate information corresponding to the modified target information according to the objective function;
对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文;Encrypting the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information;
将所述修正后的目标信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至所述区块链网络中。The ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
第二方面,本申请实施例提供了一种基于修正量的加密装置,该装置包括:In the second aspect, an embodiment of the present application provides an encryption device based on a correction amount, the device comprising:
获取模块,用于获取用于描述信息的目标函数,以及待处理的目标信息;The acquisition module is used to acquire the target function used to describe the information, and the target information to be processed;
生成模块,用于从区块链网络中获取区块对应的区块信息,根据所述区块信息生成用于对所述目标信息进行修正处理的修正量;A generating module, configured to obtain block information corresponding to a block from the block chain network, and generate a correction amount for performing correction processing on the target information according to the block information;
处理模块,用于采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息;a processing module, configured to perform correction processing on the target information by using the correction amount to obtain the corrected target information;
所述获取模块,还用于根据所述目标函数获取所述修正后的目标信息对应的坐标信息;The obtaining module is further configured to obtain coordinate information corresponding to the modified target information according to the target function;
加密模块,用于对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文;an encryption module, configured to encrypt the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information;
确定模块,用于将所述修正后的目标信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至所述区块链网络中。A determination module, configured to determine the ciphertext of the coordinate information corresponding to the corrected target information as the ciphertext of the target information, and store the ciphertext of the target information in the blockchain network.
第三方面,本申请实施例提供了一种电子设备,该设备包括:处理器,适于实现一条或一条以上指令;以及,In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor adapted to implement one or more instructions; and,
计算机存储介质,所述计算机存储介质存储有一条或一条以上指令,所述一条或一条以上指令适于由所述处理器加载并执行如下步骤:A computer storage medium storing one or more instructions adapted to be loaded by the processor and perform the following steps:
获取用于描述信息的目标函数,以及待处理的目标信息;Obtain the objective function used to describe the information, and the target information to be processed;
从区块链网络中获取区块对应的区块信息,根据所述区块信息生成用于对所述目标信 息进行修正处理的修正量;Obtain the block information corresponding to the block from the block chain network, and generate the correction amount used to correct the target information according to the block information;
采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息;Correction processing is performed on the target information by using the correction amount to obtain the corrected target information;
根据所述目标函数获取所述修正后的目标信息对应的坐标信息;Obtain coordinate information corresponding to the modified target information according to the objective function;
对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文;Encrypting the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information;
将所述修正后的目标信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至所述区块链网络中。The ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
第四方面,本申请实施例提供了一种计算机可读存储介质,包括:所述计算机可读存储介质存储有一条或一条以上指令,所述一条或一条以上指令适于由处理器加载并执行如下步骤:In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including: the computer-readable storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded and executed by a processor Follow the steps below:
获取用于描述信息的目标函数,以及待处理的目标信息;Obtain the objective function used to describe the information, and the target information to be processed;
从区块链网络中获取区块对应的区块信息,根据所述区块信息生成用于对所述目标信息进行修正处理的修正量;Obtain block information corresponding to a block from the block chain network, and generate a correction amount for performing correction processing on the target information according to the block information;
采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息;Correction processing is performed on the target information by using the correction amount to obtain the corrected target information;
根据所述目标函数获取所述修正后的目标信息对应的坐标信息;Obtain coordinate information corresponding to the modified target information according to the objective function;
对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文;Encrypting the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information;
将所述修正后的目标信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至所述区块链网络中。The ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
本申请可提高目标信息的安全性,避免目标信息的密文被非法用户篡改,导致不能根据目标信息的密文解密得到目标信息的问题。The present application can improve the security of the target information, and avoid the ciphertext of the target information being tampered with by illegal users, resulting in the problem that the target information cannot be obtained by decrypting the ciphertext of the target information.
附图说明Description of drawings
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.
图1是本申请实施例提供的一种信息处理系统的结构示意图;1 is a schematic structural diagram of an information processing system provided by an embodiment of the present application;
图2是本申请实施例提供的一种基于修正量的加密方法的流程示意图;2 is a schematic flowchart of an encryption method based on a correction amount provided by an embodiment of the present application;
图3是本申请实施例提供的一种基于修正量的加密方法的流程示意图;3 is a schematic flowchart of an encryption method based on a correction amount provided by an embodiment of the present application;
图4是本申请实施例提供的一种基于修正量的加密装置的结构示意图;4 is a schematic structural diagram of a correction amount-based encryption device provided by an embodiment of the present application;
图5是本申请另一实施例提供的一种电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device provided by another embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
区块链是一种分布式数据存储、点对点传输(P2P传输)、共识机制、加密算法等计算机技术的新型应用模式,其本质上是一个去中心化、高度透明的数据库;区块链可由多个借由密码学串接并保护内容的串连交易记录(又称区块)构成,用区块链所串接的分布式账本能让多方有效纪录交易,且可永久查验此交易(不可篡改)。其中,共识机制是指区块链网络中实现不同节点之间建立信任、获取权益的数学算法;也就是说,共识机制是区块链各网络节点共同认可的一种数学算法。本申请利用区块链中的信息不可被篡改特性,通过对目标信息进行加密,得到目标信息的密文,将目标信息的密文存储至区块链中,可避免该目标信息的密文被篡改,提高目标信息的安全性。Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission (P2P transmission), consensus mechanism, encryption algorithm, etc. It is essentially a decentralized and highly transparent database; It consists of a series of transaction records (also known as blocks) that are connected and protected by cryptography. The distributed ledger connected by the blockchain allows multiple parties to effectively record transactions, and can permanently verify this transaction (non-tampering ). Among them, the consensus mechanism refers to the mathematical algorithm that realizes the establishment of trust between different nodes and the acquisition of rights and interests in the blockchain network; that is to say, the consensus mechanism is a mathematical algorithm recognized by all network nodes of the blockchain. This application utilizes the feature that the information in the blockchain cannot be tampered with. By encrypting the target information, the ciphertext of the target information is obtained, and the ciphertext of the target information is stored in the blockchain, so that the ciphertext of the target information can be avoided from being tampered with. Tampering, improve the security of target information.
本申请可以用于数字医疗场景中,即上述目标信息可以是指患者的电子信息档案、患 者的就诊信息等等,通过对患者的电子信息档案、患者的就诊信息等数字医疗场景中的信息进行加密,并将加密后的数据存储至区块链网络中,有利于实现医疗信息化、远程医疗数据共享、远程就医,并提高数字医疗场景中的信息的安全性。This application can be used in digital medical scenarios, that is, the above-mentioned target information can refer to the patient's electronic information file, the patient's medical treatment information, etc. Encrypting and storing the encrypted data in the blockchain network is conducive to realizing medical informatization, remote medical data sharing, remote medical treatment, and improving the security of information in digital medical scenarios.
为了便于理解本方案,首先介绍本方案的信息处理系统,如图1所示,该信息处理系统可包括区块链网络10以及至少两个终端,图1中以信息处理系统包括两个终端为例,分别为终端20以及终端21。In order to facilitate the understanding of this solution, the information processing system of this solution is first introduced. As shown in Figure 1, the information processing system may include a blockchain network 10 and at least two terminals. In Figure 1, the information processing system includes two terminals as For example, they are terminal 20 and terminal 21, respectively.
其中,区块链网络是由多个节点设备共同组成的一个端到端的去中心化网络,图1中区块链网络中包括多个节点设备101。每个节点设备在进行正常工作时可以接收到交易数据,并基于接收到的交易数据维护区块链。为了保证区块链网络内的信息互通,区块链网络中的每个节点设备之间可以存在通信连接,节点设备之间可以通过上述通信连接进行数据传输。例如,当区块链网络中的任意节点设备接收到交易数据时,区块链网络中的其他节点设备根据共识算法获取交易数据,将该交易数据作为区块链中的数据进行存储,使得区块链网络中全部节点设备上存储的数据均一致。The blockchain network is an end-to-end decentralized network composed of multiple node devices. The blockchain network in FIG. 1 includes multiple node devices 101 . Each node device can receive transaction data during normal work, and maintain the blockchain based on the received transaction data. In order to ensure the information exchange in the blockchain network, there can be a communication connection between each node device in the blockchain network, and data transmission can be performed between the node devices through the above communication connection. For example, when any node device in the blockchain network receives transaction data, other node devices in the blockchain network obtain the transaction data according to the consensus algorithm, and store the transaction data as the data in the blockchain, so that the region The data stored on all node devices in the blockchain network is consistent.
其中,对于区块链网络中的每个节点设备,均具有与其对应的节点标识,而且区块链网络中的每个节点设备均可以存储有区块链网络中其他节点设备的节点标识,以便后续根据其他节点设备的节点标识,将生成的区块广播至区块链网络中的其他节点设备。每个节点设备中可维护一个如下表所示的节点标识列表,将节点设备名称和节点标识对应存储至该节点标识列表中。其中,节点标识可为IP(Internet Protocol,网络之间互联的协议)地址以及其他任一种能够用于标识该节点设备的信息,表1中仅以IP地址为例进行说明。Among them, each node device in the blockchain network has its corresponding node ID, and each node device in the blockchain network can store the node IDs of other node devices in the blockchain network, so that Subsequently, according to the node identifiers of other node devices, the generated blocks are broadcast to other node devices in the blockchain network. Each node device can maintain a node ID list as shown in the following table, and store the node device name and node ID correspondingly in the node ID list. Wherein, the node identifier may be an IP (Internet Protocol, a protocol for interconnection between networks) address and any other information that can be used to identify the node device. In Table 1, only the IP address is used as an example for description.
表1:Table 1:
节点名称node name 节点标识Node ID
节点设备1Node device 1 117.114.151.174117.114.151.174
节点设备2Node device 2 117.116.189.145117.116.189.145
节点设备NNode device N 119.123.789.258119.123.789.258
终端20和终端21可以将信息存储至区块链网络中,也可以从区块链网络中读取信息,具体的,终端20和终端21可以对待处理的目标信息进行加密,将目信息的密文上传至区块链网络中;或者,终端20和终端21可以直接将待处理的目标信息上传至区块链网络中,由区块链网络中的节点设备对目标信息进行加密,将目标信息的密文存储。The terminal 20 and the terminal 21 can store the information in the blockchain network, and can also read the information from the blockchain network. Specifically, the terminal 20 and the terminal 21 can encrypt the target information to be processed, and encrypt the encrypted information of the target information. Alternatively, the terminal 20 and the terminal 21 can directly upload the target information to be processed to the blockchain network, and the target information is encrypted by the node device in the blockchain network, and the target information is encrypted. ciphertext storage.
此处上述节点设备具体可以是一台独立的服务器、或由若干台服务器组成的服务器集群、或云计算中心、平板电脑、笔记本电脑、掌上电脑、智能音响、移动互联网设备(MID,mobile internet device)等等。终端20、终端21均可以为计算机设备,包括手机、平板电脑、笔记本电脑、掌上电脑、智能音响、POS(Point of sales,销售点)机、移动互联网设备(MID,mobile internet device)、可穿戴设备(例如智能手表、智能手环等)等;还可以是指是一台独立的服务器、或由若干台服务器组成的服务器集群、或云计算中心。Here, the above node device may specifically be an independent server, or a server cluster composed of several servers, or a cloud computing center, tablet computer, notebook computer, handheld computer, smart audio, mobile Internet device (MID, mobile internet device). )and many more. Both the terminal 20 and the terminal 21 can be computer devices, including mobile phones, tablet computers, notebook computers, handheld computers, smart speakers, POS (Point of sales, point of sale) machines, mobile Internet devices (MID, mobile Internet device), wearable A device (such as a smart watch, a smart bracelet, etc.), etc.; it may also refer to an independent server, a server cluster composed of several servers, or a cloud computing center.
请参见图2,是本申请实施例提供的一种基于修正量的加密方法的流程示意图,本申请实施例由电子设备来执行,该电子设备可以是指上述信息处理系统中的节点设备或终端设备,该基于修正量的加密方法包括以下步骤S101~S106。Please refer to FIG. 2 , which is a schematic flowchart of an encryption method based on a correction amount provided by an embodiment of the present application. The embodiment of the present application is executed by an electronic device, and the electronic device may refer to a node device or a terminal in the above-mentioned information processing system. equipment, the encryption method based on the correction amount includes the following steps S101-S106.
S101、获取用于描述信息的目标函数,以及待处理的目标信息。S101. Acquire an objective function for describing information and target information to be processed.
电子设备可以获取用于描述信息的目标函数以及待处理的目标信息。此处该目标函数可以是指椭圆曲线对应的函数,当然也可以是指其他曲线对应的函数;目标信息可以是指交易数据,该交易数据可以是指交易金额、交易时间等等;或者,目标信息可以是指某一个机构的营收数据,如营业额、出货数量、进货数量等等。The electronic device can acquire the target function used to describe the information and the target information to be processed. Here, the objective function may refer to a function corresponding to an elliptic curve, or of course, it may refer to a function corresponding to other curves; the target information may refer to transaction data, and the transaction data may refer to transaction amount, transaction time, etc.; or, the target Information can refer to the revenue data of a certain organization, such as turnover, number of shipments, number of purchases, and so on.
S102、从区块链网络中获取区块对应的区块信息,根据该区块信息生成用于对该目标信息进行修正处理的修正量。S102. Obtain block information corresponding to the block from the block chain network, and generate a correction amount for performing correction processing on the target information according to the block information.
由于目标函数只能用于描述属于有限域中的信息,也就是说,如果目标信息超过有限域,则不能直接采用目标函数描述目标信息。即如果目标信息超过有限域,则需要对目标信息进行修正处理,以使修正后的目标信息属于有限域。该有限域是根据目标函数的函数类型确定的。例如,该目标函数为长度为32字节的椭圆曲线对应的函数,则该有限域(标记为P)为2^256-w,w为一个极小的正数;当目标信息对应的数值小于P时,表明目标信息属于有效域。因此,电子设备可以从区块链网络这获取区块对于的区块信息,根据该区块信息生成用于对该目标信息进行修正处理的修正量,区块信息包括区块高度以及区块生成时间等等。Since the objective function can only be used to describe the information belonging to the finite field, that is to say, if the target information exceeds the finite field, the objective function cannot be directly used to describe the target information. That is, if the target information exceeds the finite field, the target information needs to be corrected so that the corrected target information belongs to the finite field. The finite field is determined according to the function type of the objective function. For example, if the objective function is a function corresponding to an elliptic curve with a length of 32 bytes, the finite field (marked as P) is 2^256-w, and w is a very small positive number; when the value corresponding to the target information is less than When P, it indicates that the target information belongs to the valid domain. Therefore, the electronic device can obtain the block information corresponding to the block from the block chain network, and generate a correction amount for correcting the target information according to the block information. The block information includes the block height and block generation. time and so on.
可选的,该区块信息包括区块高度,上述根据该区块信息生成用于对该目标信息进行修正处理的修正量,包括:从该区块链网络中各个区块对应的区块高度中获取最大区块高度,作为目标区块高度,从该区块链网络中统计该目标区块高度对应的区块中所存储的信息条数;对该信息条数进行随机运算,得到随机数,将该随机数确定为用于对该目标信息进行修正处理的修正量。Optionally, the block information includes a block height, and the above-mentioned generating a correction amount for performing correction processing on the target information according to the block information includes: obtaining the block height corresponding to each block in the block chain network. Obtain the maximum block height from , as the target block height, count the number of pieces of information stored in the block corresponding to the height of the target block from the blockchain network; perform random operations on the number of pieces of information to obtain a random number , and the random number is determined as a correction amount for performing correction processing on the target information.
计算机设备可以根据区块高度生成用于对目标信息进行修正处理的修正量,具体的,可从区块链网络中各个区块对应的区块高度中获取最大区块高度,作为目标区块高度,从该区块链网络中统计该目标区块高度对应的区块中所存储的信息条数,采用随机算法对该信息条数进行随机运算,得到随机数,将该随机数确定为对该目标信息进行修正处理的修正量。此处随机算法包括但不限于:拉斯维加斯算法、蒙特卡洛算法、舍伍德算法以及数值概率算法等等。The computer equipment can generate the correction amount used to correct the target information according to the block height. Specifically, the maximum block height can be obtained from the block heights corresponding to each block in the blockchain network as the target block height. , count the number of pieces of information stored in the block corresponding to the height of the target block from the blockchain network, use a random algorithm to perform random operations on the number of pieces of information to obtain a random number, and determine the random number as the The correction amount for the correction processing of the target information. The random algorithm here includes, but is not limited to: Las Vegas algorithm, Monte Carlo algorithm, Sherwood algorithm, numerical probability algorithm and so on.
可选的,该区块信息包括区块生成时间,该根据该区块信息生成用于对该目标信息进行修正处理的修正量,包括:获取该区块链网络中的各个区块对应的区块生成时间之间的和,得到时间总和;从该区块链网络中各个区块对应的区块生成时间中确定最早区块生成时间,作为目标区块生成时间;根据该目标区块生成时间对该时间总和进行取余运算,得到第一数值,将该第一数值确定为用于对该目标信息进行修正处理的修正量。Optionally, the block information includes a block generation time, and generating a correction amount for performing correction processing on the target information according to the block information includes: acquiring the block corresponding to each block in the block chain network. The sum of the block generation times is the sum of the time; the earliest block generation time is determined from the block generation times corresponding to each block in the blockchain network as the target block generation time; according to the target block generation time A remainder operation is performed on the time sum to obtain a first numerical value, and the first numerical value is determined as a correction amount for performing correction processing on the target information.
计算机设备可以根据区块生成时间生成用于对目标信息进行修正处理的修正量,具体的,获取该区块链网络中的各个区块对应的区块生成时间之间的和,得到时间总和;获取该区块链网络中各个区块对应的区块生成时间中确定最早区块生成时间,作为目标区块生成时间,即目标区块生成时间为区块链网络中的最早生成的区块对于的生成时间。根据该目标区块生成时间对该时间总和进行取余运算,得到第一数值,将该第一数值确定为用于对该目标信息进行修正处理的修正量。The computer device can generate a correction amount for performing correction processing on the target information according to the block generation time, and specifically, obtain the sum of the block generation times corresponding to each block in the blockchain network, and obtain the time sum; Obtain the block generation time corresponding to each block in the blockchain network and determine the earliest block generation time as the target block generation time, that is, the target block generation time is the earliest generated block in the blockchain network. generation time. A remainder operation is performed on the time sum according to the target block generation time to obtain a first numerical value, and the first numerical value is determined as a correction amount for performing correction processing on the target information.
S103、采用该修正量对该目标信息进行修正处理,得到修正后的目标信息。电子设备可以采用该修正量对该目标信息进行修正处理,得到修正后的目标信息,具体的,可以采用该修正量对该目标信息对于的数值进行修正处理,得到修改正后的目标信息。修正处理可以是指取模运算、取余运算、相减运算等等。通过修正量对目标信息进行修正处理,可有效提高采用目标函数描述目标信息的成功率。S103 , performing correction processing on the target information by using the correction amount to obtain corrected target information. The electronic device can use the correction amount to perform correction processing on the target information to obtain corrected target information. Specifically, the correction amount can be used to perform correction processing on the value of the target information to obtain corrected target information. The correction processing may refer to a modulo operation, a remainder operation, a subtraction operation, and the like. Correcting the target information by the correction amount can effectively improve the success rate of using the objective function to describe the target information.
S104、根据该目标函数获取该修正后的目标信息对应的坐标信息。S104. Acquire coordinate information corresponding to the corrected target information according to the target function.
电子设备可以采用目标函数的曲线上的坐标点来描述修正后的目标信息,具体的,可以将修正后的目标信息映射至该目标函数的曲线上的目标点的第一坐标,并根据第一坐标以及目标函数获取该目标点的第二坐标,将第一坐标和第二坐标作为修正后的目标信息对应的坐标信息。第一坐标可以是指X坐标,第二坐标可以是指Y坐标;或者,第一坐标可以是指Y坐标,第二坐标可以是指X坐标。The electronic device can use the coordinate points on the curve of the objective function to describe the corrected target information. Specifically, the corrected target information can be mapped to the first coordinate of the target point on the curve of the objective function, and according to the first coordinate of the target point. The coordinates and the objective function obtain the second coordinate of the target point, and use the first coordinate and the second coordinate as coordinate information corresponding to the corrected target information. The first coordinate may refer to the X coordinate, and the second coordinate may refer to the Y coordinate; or, the first coordinate may refer to the Y coordinate, and the second coordinate may refer to the X coordinate.
S105、对该修正后的目标信息对应的坐标信息进行加密,得到该修正后的目标信息对 应的坐标信息的密文。S105. Encrypt the coordinate information corresponding to the corrected target information to obtain the ciphertext of the coordinate information corresponding to the corrected target information.
S106、将该修正后的目标信息对应的坐标信息的密文确定为该目标信息的密文,将该目标信息的密文存储至该区块链网络中。S106. Determine the ciphertext of the coordinate information corresponding to the corrected target information as the ciphertext of the target information, and store the ciphertext of the target information in the blockchain network.
电子设备可以采用加密算法对修正后的目标信息对应的坐标信息进行加密,得到修正后的目标信息对应的坐标信息的密文,该加密算法可以包括但不限于Elgamal算法(一种非对称加密算法)、Rabin算法(一种非对称加密算法)、Diffie-Hellman算法(一种非对称加密算法)、ECC算法(椭圆曲线加密算法)。将修正后的目标信息对应的坐标信息的密文确定为目标信息的密文,将该目标信息的密文存储至区块链网络中;可避免该目标信息存储至终端本地,导致目标信息被篡改,提高目标信息的安全性。The electronic device can use an encryption algorithm to encrypt the coordinate information corresponding to the revised target information, and obtain the ciphertext of the coordinate information corresponding to the revised target information. The encryption algorithm can include but is not limited to the Elgamal algorithm (an asymmetric encryption algorithm). ), Rabin algorithm (an asymmetric encryption algorithm), Diffie-Hellman algorithm (an asymmetric encryption algorithm), ECC algorithm (elliptic curve encryption algorithm). The ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network; it can prevent the target information from being stored locally in the terminal, resulting in the target information being destroyed. Tampering, improve the security of target information.
本申请中,通过从区块链网络正获取区块对于的区块信息,根据区块信息生成用于对目标信息进行修正处理的修正量,采用修正量对该目标信息进行修正处理,得到修正后的目标信息,可有效提高采用目标函数描述目标信息的成功率。进一步,通过根据目标函数获取所述修正后的目标信息对应的坐标信息,对该修正后的目标信息对应的坐标信息进行加密,得到该修正后的目标信息对应的坐标信息的密文,将该修正后的目标信息对应的坐标信息的密文确定为该目标信息的密文,将该目标信息的密文存储至该区块链网络中。即通过修正后的目标信息对于的坐标信息进行加密,可提高目标信息的安全性;通过修正后的目标信息对于的坐标信息的密文存储至区块链网中,可避免目标信息的密文被非法用户篡改,导致不能根据目标信息的密文解密得到目标信息的问题。In the present application, by obtaining the block information of the block pair from the block chain network, generating the correction amount used for the correction processing of the target information according to the block information, and using the correction amount to perform the correction processing on the target information, the correction is obtained. The obtained target information can effectively improve the success rate of using the objective function to describe the target information. Further, by obtaining the coordinate information corresponding to the modified target information according to the objective function, and encrypting the coordinate information corresponding to the modified target information, the ciphertext of the coordinate information corresponding to the modified target information is obtained, and the coordinate information corresponding to the modified target information is obtained. The ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network. That is, by encrypting the coordinate information of the corrected target information, the security of the target information can be improved; by storing the ciphertext of the coordinate information of the corrected target information in the blockchain network, the ciphertext of the target information can be avoided. It is tampered with by illegal users, resulting in the problem that the target information cannot be obtained by decrypting the ciphertext of the target information.
请参见图3,是本申请实施例提供的另一种基于修正量的加密方法的流程示意图,本申请实施例由电子设备来执行,该基于修正量的加密方法包括以下步骤S201~S205。Please refer to FIG. 3 , which is a schematic flowchart of another correction amount-based encryption method provided by an embodiment of the present application. The embodiment of the present application is executed by an electronic device. The correction amount-based encryption method includes the following steps S201 to S205 .
S201、获取用于描述信息的目标函数,以及待处理的目标信息。S201. Acquire an objective function for describing information and target information to be processed.
S202、从区块链网络中获取区块对应的区块信息,根据该区块信息生成用于对该目标信息进行修正处理的修正量。S202. Obtain block information corresponding to the block from the block chain network, and generate a correction amount for performing correction processing on the target information according to the block information.
S203、根据该目标信息的信息类型确定该目标信息对应的第二数值。S203. Determine a second value corresponding to the target information according to the information type of the target information.
S204、获取该第二数值与该修正量之间的和,得到第三数值。S204: Obtain the sum between the second numerical value and the correction amount to obtain a third numerical value.
S205、获取该目标函数的函数参数,根据该函数参数生成修正权重。S205. Acquire a function parameter of the objective function, and generate a correction weight according to the function parameter.
S206、根据该修正权重对该第三数值进行取模运算,得到第四数值,将该第四数值确定为修正后的目标信息。S206. Perform a modulo operation on the third numerical value according to the correction weight to obtain a fourth numerical value, and determine the fourth numerical value as the corrected target information.
在步骤S203~S206中,电子设备可以采用修正量对目标信息进行修正处理的,具体的,可以根据该目标信息的信息类型确定该目标信息对于的第二数值,计算第二数值与修正量之间的和,得到第三数值。获取目标函数的函数参数,根据函数参数生成修正权重,如该函数参数为目标函数的曲线的长度,如长度为32字节,即256位,则修正权重可以为2^256。可以根据该修正权重对该第三数值进行取模运算,得到第四数值,将该第四数值确定为修正后的目标信息,例如,可以采用如下公式(1)表示修正后的目标信息。In steps S203 to S206, the electronic device may use the correction amount to perform correction processing on the target information. Specifically, the second value corresponding to the target information may be determined according to the information type of the target information, and the difference between the second value and the correction amount may be calculated. The sum of the three values is obtained. Obtain the function parameters of the objective function, and generate the correction weight according to the function parameters. If the function parameter is the length of the curve of the objective function, if the length is 32 bytes, that is, 256 bits, the correction weight can be 2^256. Modulo operation can be performed on the third numerical value according to the correction weight to obtain a fourth numerical value, and the fourth numerical value can be determined as the corrected target information. For example, the following formula (1) can be used to express the corrected target information.
Figure PCTCN2021109265-appb-000001
Figure PCTCN2021109265-appb-000001
其中,公式(1)中的
Figure PCTCN2021109265-appb-000002
为修正后的目标信息,offset为修正量,M为目标信息对应的第二数值,mod为取模运算符。
Among them, in formula (1),
Figure PCTCN2021109265-appb-000002
is the corrected target information, offset is the correction amount, M is the second value corresponding to the target information, and mod is the modulo operator.
可选的,上述根据该目标信息的信息类型确定该目标信息对应的第二数值,包括:若该目标信息的信息类型为非数值类型,则对该目标信息进行编码,得到编码后的目标信息,将该编码后的目标信息确定为该目标信息对应的第二数值;若该目标信息的信息类型为数值类型,则将该目标信息确定为该目标信息对应的第二数值。Optionally, the above-mentioned determining the second value corresponding to the target information according to the information type of the target information includes: if the information type of the target information is a non-numerical type, encoding the target information to obtain the encoded target information. , the encoded target information is determined as the second value corresponding to the target information; if the information type of the target information is a value type, the target information is determined as the second value corresponding to the target information.
计算机设备可以获取该目标信息的信息类型,该目标信息的信息类型包括数值类型和 非数值类型,数值类型是指目标信息由数字构成,非数值类型是指目标信息是由符号、字母、汉字等中的至少一种构成。如果该目标信息的信息类型为非数值类型,则采用编码算法对该目标信息进行数值编码,得到编码后的目标信息,将编码后的目标信息作为目标信息对应的第二数值;此处编码算法可包括:脉冲编码调制算法(Pulse Code Modulation,PCM)、不归零码算法(Non Return Zero,NRZ)以及曼彻斯特编码算法等等。如果该目标信息的信息类型为数值类型,可以将该目标信息确定该目标信息对应的第二数值。The computer equipment can obtain the information type of the target information. The information type of the target information includes a numerical type and a non-numerical type. at least one of the composition. If the information type of the target information is a non-numerical type, an encoding algorithm is used to numerically encode the target information to obtain the encoded target information, and the encoded target information is used as the second value corresponding to the target information; here the encoding algorithm It can include: pulse code modulation algorithm (Pulse Code Modulation, PCM), non-return zero code algorithm (Non Return Zero, NRZ) and Manchester coding algorithm and so on. If the information type of the target information is a numerical type, the target information may be determined as a second numerical value corresponding to the target information.
S207、根据该目标函数获取该修正后的目标信息对应的坐标信息。S207: Acquire coordinate information corresponding to the corrected target information according to the target function.
S208、对该修正后的目标信息对应的坐标信息进行加密,得到该修正后的目标信息对应的坐标信息的密文。S208: Encrypt the coordinate information corresponding to the corrected target information to obtain the ciphertext of the coordinate information corresponding to the corrected target information.
可选的,上述对该修正后的目标信息对应的坐标信息进行加密,得到该修正后的目标信息对应的坐标信息的密文,包括:获取该目标信息所属的终端的属性信息,以及该目标信息对应的密钥,该终端的属性信息包括该终端的终端标识、该终端生成的口令、该终端对应的用户信息中的至少一种;根据该终端的属性信息生成该终端的私钥;根据该私钥以及该目标信息对应的密钥,对该修正后的目标信息对应的坐标信息进行加密,得到该修正后的目标信息对应的坐标信息的密文。Optionally, encrypting the coordinate information corresponding to the corrected target information above to obtain the ciphertext of the coordinate information corresponding to the corrected target information includes: obtaining attribute information of the terminal to which the target information belongs, and the target information. The key corresponding to the information, the attribute information of the terminal includes at least one of the terminal identifier of the terminal, the password generated by the terminal, and the user information corresponding to the terminal; the private key of the terminal is generated according to the attribute information of the terminal; according to The private key and the key corresponding to the target information are encrypted with the coordinate information corresponding to the revised target information, and the ciphertext of the coordinate information corresponding to the revised target information is obtained.
电子设备可以获取目标信息对应的密钥,目标信息对应的密钥可以是根据目标信息的属性信息生成的,目标信息的属性信息包括目标信息所属的机构、目标信息的生成时间以及目标信息的信息长度等等。进一步,可以获取该目标信息所属的终端的属性信息,该终端的属性信息包括该终端的终端标识、该终端生成的口令、该终端对应的用户信息中的至少一种,终端标识可以是指终端的IP地址、MAC地址、编号等中的至少一种,用户信息可以是指用户账户、用户电话号码等等;终端生成的口令可以是指随机生成的,或者,按照某种规则生成的。根据该终端的属性信息生成随机数,对该随机数进行填充,得到终端的私钥,该终端的私钥可以是指包括256bit(即位)。然后,可根据该私钥以及该目标信息对应的密钥,对该修正后的目标信息对应的坐标信息进行加密,得到该修正后的目标信息对应的坐标信息的密文;通过私钥以及目标信息对应的密钥,对该修正后的目标信息对应的坐标信息进行加密,可提高目标信息的安全性。The electronic device can obtain the key corresponding to the target information, and the key corresponding to the target information can be generated according to the attribute information of the target information. The attribute information of the target information includes the organization to which the target information belongs, the generation time of the target information, and the information of the target information. length, etc. Further, attribute information of the terminal to which the target information belongs can be obtained, and the attribute information of the terminal includes at least one of a terminal identifier of the terminal, a password generated by the terminal, and user information corresponding to the terminal, and the terminal identifier may refer to the terminal. At least one of the IP address, MAC address, serial number, etc., user information may refer to the user account, user phone number, etc.; the password generated by the terminal may be randomly generated, or generated according to certain rules. A random number is generated according to the attribute information of the terminal, and the random number is filled to obtain the private key of the terminal. The private key of the terminal may include 256 bits (ie bits). Then, according to the private key and the key corresponding to the target information, the coordinate information corresponding to the revised target information can be encrypted to obtain the ciphertext of the coordinate information corresponding to the revised target information; Encrypting the coordinate information corresponding to the corrected target information by encrypting the key corresponding to the information can improve the security of the target information.
可选的,目标信息的属性信息包括目标信息的生成时间,上述根据目标信息的属性信息获取目标信息对应的密钥包括:可以对该目标信息的生成时间进行哈希运算,得到第一哈希值,对第一哈希值进行哈希运算,得到第二哈希值,将该第二哈希值确定为目标信息对应的密钥。可选的,目标信息的属性信息包括目标信息的信息长度,上述根据目标信息的属性信息获取目标信息对应的密钥包括:采用随机算法对该目标信息的信息长度进行随机运算,得到信息长度对应的随机数,对该信息长度对应的随机数进行哈希运算,得到随机数对应的哈希值;对该随机数对应的哈希值进行哈希运算,得到目标信息对应的密钥。Optionally, the attribute information of the target information includes the generation time of the target information, and obtaining the key corresponding to the target information according to the attribute information of the target information includes: performing a hash operation on the generation time of the target information to obtain the first hash. value, perform a hash operation on the first hash value to obtain a second hash value, and determine the second hash value as the key corresponding to the target information. Optionally, the attribute information of the target information includes the information length of the target information, and obtaining the key corresponding to the target information according to the attribute information of the target information includes: using a random algorithm to perform a random operation on the information length of the target information to obtain the corresponding information length. Perform a hash operation on the random number corresponding to the length of the information to obtain a hash value corresponding to the random number; perform a hash operation on the hash value corresponding to the random number to obtain the key corresponding to the target information.
可选的,上述根据该私钥以及该目标信息对应的密钥,对该修正后的目标信息对应的坐标信息进行加密,得到该修正后的目标信息对应的坐标信息的密文,包括:获取该目标函数的曲线的基点坐标;获取该基点坐标与该终端的私钥的乘积,得到候选坐标;根据该目标信息对应的密钥对该候选坐标进行加密,得到该候选坐标的密文;对该修正后的目标信息对应的坐标信息与该候选坐标的密文进行融合,得到该修正后的目标信息对应的坐标信息的密文。Optionally, according to the private key and the key corresponding to the target information, the coordinate information corresponding to the revised target information is encrypted to obtain the ciphertext of the coordinate information corresponding to the revised target information, including: obtaining The base point coordinate of the curve of the objective function; obtain the product of the base point coordinate and the private key of the terminal to obtain the candidate coordinate; encrypt the candidate coordinate according to the key corresponding to the target information to obtain the ciphertext of the candidate coordinate; The coordinate information corresponding to the corrected target information is fused with the ciphertext of the candidate coordinates to obtain the ciphertext of the coordinate information corresponding to the corrected target information.
电子设备可以获取该目标函数的曲线的基点坐标,并计算该G点坐标与该终端的私钥的乘积,得到候选坐标,根据该每条子信息对应的密钥对该候选坐标进行加密,得到该候选坐标的密文;对该修正后的目标信息对应的坐标信息与对应的候选坐标的密文进行融合,得到该修正后的目标信息对应的坐标信息的密文。The electronic device can obtain the base point coordinates of the curve of the objective function, and calculate the product of the G point coordinates and the private key of the terminal to obtain candidate coordinates, and encrypt the candidate coordinates according to the key corresponding to each piece of sub-information to obtain the The ciphertext of the candidate coordinates; the coordinate information corresponding to the modified target information is fused with the ciphertext of the corresponding candidate coordinates to obtain the ciphertext of the coordinate information corresponding to the modified target information.
可选的,修正后的目标信息对应的坐标信息的密文可以采用如下公式(2)表示。Optionally, the ciphertext of the coordinate information corresponding to the corrected target information may be expressed by the following formula (2).
P C=P M+k*H   (2) P C =P M +k*H (2)
公式(2)中,P C表示修正后的目标信息对应的坐标信息的密文,k表示目标信息的密钥,H为候选坐标。P M表示修正后的目标信息对应的坐标信息,k*H表示候选坐标信息的密文;候选坐标可以采用如下公式(3)表示。 In formula (2), PC represents the ciphertext of the coordinate information corresponding to the corrected target information, k represents the key of the target information, and H is the candidate coordinate. P M represents the coordinate information corresponding to the corrected target information, and k*H represents the ciphertext of the candidate coordinate information; the candidate coordinate can be represented by the following formula (3).
H=h*G   (3)H=h*G (3)
公式(3)中,h表示终端的私钥,G表示目标函数的曲线的基点坐标,可表示为(x g,y g)。 In formula (3), h represents the private key of the terminal, and G represents the base point coordinates of the curve of the objective function, which can be represented as (x g , y g ).
S209、将该修正后的目标信息对应的坐标信息的密文确定为该目标信息的密文,将该目标信息的密文存储至该区块链网络中。S209. Determine the ciphertext of the coordinate information corresponding to the corrected target information as the ciphertext of the target information, and store the ciphertext of the target information in the blockchain network.
可选的,电子设备可以接收终端针对目标信息的获取请求,根据该获取请求验证终端是否具有获取目标信息的权限,如果该终端具有获取目标信息的权限,则从区块链网络中读取目标信息的密文(即修正后的目标信息对应的坐标信息的密文),对修正后的目标信息对应的坐标信息的密文进行解密,得到修正后的目标信息对应的坐标信息;根据目标函数以及修正后的目标信息对应的坐标信息确定修正后的目标信息;从区块链网络中获取该目标信息对应的修正量,根据该修正量以及修正后的目标信息确定目标信息,将目标信息返给终端。Optionally, the electronic device can receive the terminal's acquisition request for the target information, and verify whether the terminal has the authority to acquire the target information according to the acquisition request, and if the terminal has the authority to acquire the target information, read the target information from the blockchain network. The ciphertext of the information (that is, the ciphertext of the coordinate information corresponding to the revised target information), decrypt the ciphertext of the coordinate information corresponding to the revised target information, and obtain the coordinate information corresponding to the revised target information; according to the objective function and the coordinate information corresponding to the corrected target information to determine the corrected target information; obtain the correction amount corresponding to the target information from the blockchain network, determine the target information according to the correction amount and the corrected target information, and return the target information to to the terminal.
当需要读取目标信息时,可以从区块链网络中读取目标信息的密文,对目标信息的密文进行解密,得到目标信息,将目标信息返给终端,可实现信息的共享。具体的,电子设备可以接收终端针对目标信息的获取请求,该获取请求可以包括终端对应的属性信息,获取目标信息的信息标识等等;根据终端的属性信息验证终端是否具有获取目标信息的权限。如果确定终端不具有获取目标信息的权限,则拒绝向终端返回目标信息。如果确定终端具有获取目标信息的权限,可以根据目标信息的信息标识从区块链网络中读取目标信息的密文(即修正后的目标信息对应的坐标信息的密文),对修正后的目标信息对应的坐标信息的密文进行解密,得到修正后的目标信息对应的坐标信息;根据目标函数以及修正后的目标信息对应的坐标信息确定修正后的目标信息;从区块链网络中获取该目标信息对应的修正量,根据该修正量以及修正后的目标信息确定目标信息,将目标信息返给终端。通过对终端获取目标信息的权限进行验证,可提高目标信息的安全性,可避免非法终端获取目标信息。When the target information needs to be read, the ciphertext of the target information can be read from the blockchain network, the ciphertext of the target information can be decrypted, the target information can be obtained, and the target information can be returned to the terminal to achieve information sharing. Specifically, the electronic device can receive the terminal's acquisition request for the target information, the acquisition request can include attribute information corresponding to the terminal, the information identifier of the acquired target information, etc.; and verify whether the terminal has the right to acquire the target information according to the terminal's attribute information. If it is determined that the terminal does not have the right to acquire the target information, the target information is refused to be returned to the terminal. If it is determined that the terminal has the authority to obtain the target information, the ciphertext of the target information (that is, the ciphertext of the coordinate information corresponding to the corrected target information) can be read from the blockchain network according to the information identifier of the target information. The ciphertext of the coordinate information corresponding to the target information is decrypted to obtain the coordinate information corresponding to the revised target information; the revised target information is determined according to the objective function and the coordinate information corresponding to the revised target information; obtained from the blockchain network The correction amount corresponding to the target information is determined according to the correction amount and the corrected target information, and the target information is returned to the terminal. By verifying the authority of the terminal to obtain the target information, the security of the target information can be improved, and the illegal terminal can be prevented from obtaining the target information.
本申请中,通过从区块链网络正获取区块对于的区块信息,根据区块信息生成用于对目标信息进行修正处理的修正量,采用修正量对该目标信息进行修正处理,得到修正后的目标信息,可有效提高采用目标函数描述目标信息的成功率。进一步,通过根据目标函数获取所述修正后的目标信息对应的坐标信息,对该修正后的目标信息对应的坐标信息进行加密,得到该修正后的目标信息对应的坐标信息的密文,将该修正后的目标信息对应的坐标信息的密文确定为该目标信息的密文,将该目标信息的密文存储至该区块链网络中。即通过修正后的目标信息对于的坐标信息进行加密,可提高目标信息的安全性;通过修正后的目标信息对于的坐标信息的密文存储至区块链网中,可避免目标信息的密文被非法用户篡改,导致不能根据目标信息的密文解密得到目标信息的问题。In the present application, by obtaining the block information of the block pair from the block chain network, generating the correction amount used for the correction processing of the target information according to the block information, and using the correction amount to perform the correction processing on the target information, the correction is obtained. The obtained target information can effectively improve the success rate of using the objective function to describe the target information. Further, by obtaining the coordinate information corresponding to the modified target information according to the objective function, and encrypting the coordinate information corresponding to the modified target information, the ciphertext of the coordinate information corresponding to the modified target information is obtained, and the coordinate information corresponding to the modified target information is obtained. The ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network. That is, by encrypting the coordinate information of the corrected target information, the security of the target information can be improved; by storing the ciphertext of the coordinate information of the corrected target information in the blockchain network, the ciphertext of the target information can be avoided. It is tampered with by illegal users, resulting in the problem that the target information cannot be obtained by decrypting the ciphertext of the target information.
请参见图4,是本申请实施例提供的一种基于修正量的加密装置的结构示意图,如图4所示,本实施例中基于区块链的信息装置包括:Please refer to FIG. 4 , which is a schematic structural diagram of a correction amount-based encryption device provided by an embodiment of the present application. As shown in FIG. 4 , the blockchain-based information device in this embodiment includes:
获取模块401,用于获取用于描述信息的目标函数,以及待处理的目标信息;Obtaining module 401, for obtaining the target function for describing information, and target information to be processed;
生成模块402,用于从区块链网络中获取区块对应的区块信息,根据所述区块信息生 成用于对所述目标信息进行修正处理的修正量;The generation module 402 is used to obtain the block information corresponding to the block from the block chain network, and according to the block information, generate a correction amount for performing correction processing on the target information;
处理模块403,用于采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息;a processing module 403, configured to perform correction processing on the target information by using the correction amount to obtain corrected target information;
所述获取模块401,还用于根据所述目标函数获取所述修正后的目标信息对应的坐标信息;The obtaining module 401 is further configured to obtain coordinate information corresponding to the modified target information according to the target function;
加密模块404,用于对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文;An encryption module 404, configured to encrypt the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information;
确定模块405,用于将所述修正后的目标信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至所述区块链网络中。The determining module 405 is configured to determine the ciphertext of the coordinate information corresponding to the corrected target information as the ciphertext of the target information, and store the ciphertext of the target information in the blockchain network.
可选的,所述区块信息包括区块高度,所述生成模块402根据所述区块信息生成用于对所述目标信息进行修正处理的修正量,包括:Optionally, the block information includes a block height, and the generating module 402 generates a correction amount for performing correction processing on the target information according to the block information, including:
从所述区块链网络中各个区块对应的区块高度中获取最大区块高度,作为目标区块高度;Obtain the maximum block height from the block heights corresponding to each block in the blockchain network as the target block height;
从所述区块链网络中统计所述目标区块高度对应的区块中所存储的信息条数;Count the number of pieces of information stored in the block corresponding to the height of the target block from the blockchain network;
对所述信息条数进行随机运算,得到随机数,将所述随机数确定为用于对所述目标信息进行修正处理的修正量。A random operation is performed on the number of pieces of information to obtain a random number, and the random number is determined as a correction amount for performing correction processing on the target information.
可选的,所述区块信息包括区块生成时间,所述生成模块402根据所述区块信息生成用于对所述目标信息进行修正处理的修正量,包括:Optionally, the block information includes a block generation time, and the generation module 402 generates a correction amount for performing correction processing on the target information according to the block information, including:
获取所述区块链网络中的各个区块对应的区块生成时间之间的和,得到时间总和;Obtain the sum of the block generation times corresponding to each block in the blockchain network, and obtain the time sum;
从所述区块链网络中各个区块对应的区块生成时间中确定最早区块生成时间,作为目标区块生成时间;Determine the earliest block generation time from the block generation time corresponding to each block in the blockchain network as the target block generation time;
根据所述目标区块生成时间对所述时间总和进行取余运算,得到第一数值,将所述第一数值确定为用于对所述目标信息进行修正处理的修正量。A remainder operation is performed on the time sum according to the target block generation time to obtain a first numerical value, and the first numerical value is determined as a correction amount for performing correction processing on the target information.
可选的,所述处理模块403采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息,包括:Optionally, the processing module 403 uses the correction amount to perform correction processing on the target information to obtain corrected target information, including:
根据所述目标信息的信息类型确定所述目标信息对应的第二数值;Determine the second value corresponding to the target information according to the information type of the target information;
获取所述第二数值与所述修正量之间的和,得到第三数值;obtaining the sum between the second numerical value and the correction amount to obtain a third numerical value;
获取所述目标函数的函数参数,根据所述函数参数生成修正权重;Obtain the function parameters of the objective function, and generate a correction weight according to the function parameters;
根据所述修正权重对所述第三数值进行取模运算,得到第四数值,将所述第四数值确定为修正后的目标信息。A modulo operation is performed on the third numerical value according to the correction weight to obtain a fourth numerical value, and the fourth numerical value is determined as the corrected target information.
可选的,所述处理模块403根据所述目标信息的信息类型确定所述目标信息对应的第二数值,包括:Optionally, the processing module 403 determines the second value corresponding to the target information according to the information type of the target information, including:
若所述目标信息的信息类型为非数值类型,则对所述目标信息进行编码,得到编码,后的目标信息,将所述编码后的目标信息确定为所述目标信息对应的第二数值;If the information type of the target information is a non-numerical type, then the target information is encoded to obtain the encoded target information, and the encoded target information is determined as the second numerical value corresponding to the target information;
若所述目标信息的信息类型为数值类型,则将所述目标信息确定为所述目标信息对应的第二数值。If the information type of the target information is a numeric type, the target information is determined as a second value corresponding to the target information.
可选的,所述加密模块404对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文,包括:Optionally, the encryption module 404 encrypts the coordinate information corresponding to the revised target information, and obtains the ciphertext of the coordinate information corresponding to the revised target information, including:
获取所述目标信息所属的终端的属性信息,以及所述目标信息对应的密钥,所述终端的属性信息包括所述终端的终端标识、所述终端生成的口令、所述终端对应的用户信息中的至少一种;Obtain attribute information of the terminal to which the target information belongs, and a key corresponding to the target information, where the attribute information of the terminal includes the terminal identifier of the terminal, the password generated by the terminal, and the user information corresponding to the terminal. at least one of;
根据所述终端的属性信息生成所述终端的私钥;generating the private key of the terminal according to the attribute information of the terminal;
根据所述私钥以及所述目标信息对应的密钥,对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文。According to the private key and the key corresponding to the target information, the coordinate information corresponding to the modified target information is encrypted to obtain the ciphertext of the coordinate information corresponding to the modified target information.
可选的,所述加密模块404根据所述私钥以及所述目标信息对应的密钥,对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文,包括:Optionally, the encryption module 404 encrypts the coordinate information corresponding to the revised target information according to the private key and the key corresponding to the target information to obtain the coordinates corresponding to the revised target information. Encrypted text of information, including:
获取所述目标函数的曲线的基点坐标;Obtain the base point coordinates of the curve of the objective function;
获取所述基点坐标与所述终端的私钥的乘积,得到候选坐标;Obtain the product of the base point coordinates and the private key of the terminal to obtain candidate coordinates;
根据所述目标信息对应的密钥对所述候选坐标进行加密,得到所述候选坐标的密文;Encrypt the candidate coordinates according to the key corresponding to the target information to obtain the ciphertext of the candidate coordinates;
对所述修正后的目标信息对应的坐标信息与所述候选坐标的密文进行融合,得到所述修正后的目标信息对应的坐标信息的密文。The coordinate information corresponding to the corrected target information and the ciphertext of the candidate coordinates are fused to obtain the ciphertext of the coordinate information corresponding to the corrected target information.
本申请中,通过从区块链网络正获取区块对于的区块信息,根据区块信息生成用于对目标信息进行修正处理的修正量,采用修正量对该目标信息进行修正处理,得到修正后的目标信息,可有效提高采用目标函数描述目标信息的成功率。进一步,通过根据目标函数获取所述修正后的目标信息对应的坐标信息,对该修正后的目标信息对应的坐标信息进行加密,得到该修正后的目标信息对应的坐标信息的密文,将该修正后的目标信息对应的坐标信息的密文确定为该目标信息的密文,将该目标信息的密文存储至该区块链网络中。即通过修正后的目标信息对于的坐标信息进行加密,可提高目标信息的安全性;通过修正后的目标信息对于的坐标信息的密文存储至区块链网中,可避免目标信息的密文被非法用户篡改,导致不能根据目标信息的密文解密得到目标信息的问题。In the present application, by obtaining the block information of the block pair from the block chain network, generating the correction amount used for the correction processing of the target information according to the block information, and using the correction amount to perform the correction processing on the target information, the correction is obtained. The obtained target information can effectively improve the success rate of using the objective function to describe the target information. Further, by obtaining the coordinate information corresponding to the modified target information according to the objective function, and encrypting the coordinate information corresponding to the modified target information, the ciphertext of the coordinate information corresponding to the modified target information is obtained, and the coordinate information corresponding to the modified target information is obtained. The ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network. That is, by encrypting the coordinate information of the corrected target information, the security of the target information can be improved; by storing the ciphertext of the coordinate information of the corrected target information in the blockchain network, the ciphertext of the target information can be avoided. It is tampered with by illegal users, resulting in the problem that the target information cannot be obtained by decrypting the ciphertext of the target information.
请参见图5,是本申请实施例提供的一种电子设备的结构示意图,该电子设备可包括处理器,适于实现一条或一条以上指令;以及,计算机可读存储介质,该计算机可读存储介质可存储有一条或一条以上指令,该一条或一条以上指令适于由处理器加载并执行上述方法。可选的,该电子设备还可包括存储器。进一步可选的,该电子设备还可包括输入装置和输出装置中的至少一种。例如,如图5所示的本实施例中的电子设备可以包括:一个或多个处理器21;一个或多个输入装置22,一个或多个输出装置23和存储器24。上述处理器21、输入装置22、输出装置23和存储器24通过总线25连接。Please refer to FIG. 5 , which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device may include a processor, which is suitable for implementing one or more instructions; and a computer-readable storage medium, the computer-readable storage medium. The medium may store one or more instructions suitable for being loaded by a processor and performing the above-described method. Optionally, the electronic device may further include a memory. Further optionally, the electronic device may further include at least one of an input device and an output device. For example, the electronic device in this embodiment as shown in FIG. 5 may include: one or more processors 21 ; one or more input devices 22 , one or more output devices 23 and a memory 24 . The above-mentioned processor 21 , input device 22 , output device 23 , and memory 24 are connected through a bus 25 .
所处理器21可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 21 can be a central processing unit (Central Processing Unit, CPU), and the processor can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC) ), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
输入装置22可以包括触控板、指纹采传感器(用于采集用户的指纹信息和指纹的方向信息)、麦克风等,输出装置23可以包括显示器(LCD等)、扬声器等,输出装置23可以输出校正处理后的数据表。The input device 22 may include a touch panel, a fingerprint sensor (used to collect the user's fingerprint information and fingerprint direction information), a microphone, etc., and the output device 23 may include a display (LCD, etc.), a speaker, etc., and the output device 23 may output corrections The processed data table.
该存储器24可以包括只读存储器和随机存取存储器,并向处理器21提供指令和数据。存储器24的一部分还可以包括非易失性随机存取存储器,存储器24用于存储计算机程序,所述计算机程序包括程序指令,处理器21用于执行存储器24存储的程序指令,以用于执行一种基于修正量的加密方法,即用于执行以下操作:The memory 24 may include read only memory and random access memory and provides instructions and data to the processor 21 . A portion of the memory 24 may also include non-volatile random access memory, the memory 24 for storing a computer program including program instructions, and the processor 21 for executing the program instructions stored in the memory 24 for executing a A modifier-based encryption method that is used to do the following:
获取用于描述信息的目标函数,以及待处理的目标信息;Obtain the objective function used to describe the information, and the target information to be processed;
从区块链网络中获取区块对应的区块信息,根据所述区块信息生成用于对所述目标信息进行修正处理的修正量;Obtain block information corresponding to a block from the block chain network, and generate a correction amount for performing correction processing on the target information according to the block information;
采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息;Correction processing is performed on the target information by using the correction amount to obtain the corrected target information;
根据所述目标函数获取所述修正后的目标信息对应的坐标信息;Obtain coordinate information corresponding to the modified target information according to the objective function;
对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文;Encrypting the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information;
将所述修正后的目标信息对应的坐标信息的密文确定为所述目标信息的密文,将所述 目标信息的密文存储至所述区块链网络中。The ciphertext of the coordinate information corresponding to the modified target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
可选的,所述区块信息包括区块高度,所述处理器21用于执行存储器24存储的程序指令,以执行以下操作:Optionally, the block information includes block height, and the processor 21 is configured to execute program instructions stored in the memory 24 to perform the following operations:
根据所述区块信息生成用于对所述目标信息进行修正处理的修正量,包括:Generating, according to the block information, a correction amount for performing correction processing on the target information, including:
从所述区块链网络中各个区块对应的区块高度中获取最大区块高度,作为目标区块高度;Obtain the maximum block height from the block heights corresponding to each block in the blockchain network as the target block height;
从所述区块链网络中统计所述目标区块高度对应的区块中所存储的信息条数;Count the number of pieces of information stored in the block corresponding to the height of the target block from the blockchain network;
对所述信息条数进行随机运算,得到随机数,将所述随机数确定为用于对所述目标信息进行修正处理的修正量。A random operation is performed on the number of pieces of information to obtain a random number, and the random number is determined as a correction amount for performing correction processing on the target information.
可选的,所述区块信息包括区块生成时间,所述处理器21用于执行存储器24存储的程序指令,以执行以下操作:Optionally, the block information includes block generation time, and the processor 21 is used to execute the program instructions stored in the memory 24 to perform the following operations:
获取所述区块链网络中的各个区块对应的区块生成时间之间的和,得到时间总和;Obtain the sum of the block generation times corresponding to each block in the blockchain network, and obtain the time sum;
从所述区块链网络中各个区块对应的区块生成时间中确定最早区块生成时间,作为目标区块生成时间;Determine the earliest block generation time from the block generation time corresponding to each block in the blockchain network as the target block generation time;
根据所述目标区块生成时间对所述时间总和进行取余运算,得到第一数值,将所述第一数值确定为用于对所述目标信息进行修正处理的修正量。A remainder operation is performed on the time sum according to the target block generation time to obtain a first numerical value, and the first numerical value is determined as a correction amount for performing correction processing on the target information.
可选的,所述处理器21用于执行存储器24存储的程序指令,以执行以下操作:Optionally, the processor 21 is configured to execute program instructions stored in the memory 24 to perform the following operations:
根据所述目标信息的信息类型确定所述目标信息对应的第二数值;Determine the second value corresponding to the target information according to the information type of the target information;
获取所述第二数值与所述修正量之间的和,得到第三数值;obtaining the sum between the second numerical value and the correction amount to obtain a third numerical value;
获取所述目标函数的函数参数,根据所述函数参数生成修正权重;Obtain the function parameters of the objective function, and generate a correction weight according to the function parameters;
根据所述修正权重对所述第三数值进行取模运算,得到第四数值,将所述第四数值确定为修正后的目标信息。A modulo operation is performed on the third numerical value according to the correction weight to obtain a fourth numerical value, and the fourth numerical value is determined as the corrected target information.
可选的,所述处理器21用于执行存储器24存储的程序指令,以执行以下操作:Optionally, the processor 21 is configured to execute program instructions stored in the memory 24 to perform the following operations:
若所述目标信息的信息类型为非数值类型,则对所述目标信息进行编码,得到编码后的目标信息,将所述编码后的目标信息确定为所述目标信息对应的第二数值;If the information type of the target information is a non-numerical type, then the target information is encoded to obtain encoded target information, and the encoded target information is determined as the second value corresponding to the target information;
若所述目标信息的信息类型为数值类型,则将所述目标信息确定为所述目标信息对应的第二数值。If the information type of the target information is a numeric type, the target information is determined as a second value corresponding to the target information.
可选的,所述处理器21用于执行存储器24存储的程序指令,以执行以下操作:Optionally, the processor 21 is configured to execute program instructions stored in the memory 24 to perform the following operations:
获取所述目标信息所属的终端的属性信息,以及所述目标信息对应的密钥,所述终端的属性信息包括所述终端的终端标识、所述终端生成的口令、所述终端对应的用户信息中的至少一种;Obtain attribute information of the terminal to which the target information belongs, and a key corresponding to the target information, where the attribute information of the terminal includes the terminal identifier of the terminal, the password generated by the terminal, and the user information corresponding to the terminal. at least one of;
根据所述终端的属性信息生成所述终端的私钥;generating the private key of the terminal according to the attribute information of the terminal;
根据所述私钥以及所述目标信息对应的密钥,对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文。According to the private key and the key corresponding to the target information, the coordinate information corresponding to the modified target information is encrypted to obtain the ciphertext of the coordinate information corresponding to the modified target information.
可选的,所述处理器21用于执行存储器24存储的程序指令,以执行以下操作:Optionally, the processor 21 is configured to execute program instructions stored in the memory 24 to perform the following operations:
获取所述目标函数的曲线的基点坐标;Obtain the base point coordinates of the curve of the objective function;
获取所述基点坐标与所述终端的私钥的乘积,得到候选坐标;Obtain the product of the base point coordinates and the private key of the terminal to obtain candidate coordinates;
根据所述目标信息对应的密钥对所述候选坐标进行加密,得到所述候选坐标的密文;Encrypt the candidate coordinates according to the key corresponding to the target information to obtain the ciphertext of the candidate coordinates;
对所述修正后的目标信息对应的坐标信息与所述候选坐标的密文进行融合,得到所述修正后的目标信息对应的坐标信息的密文。The coordinate information corresponding to the corrected target information and the ciphertext of the candidate coordinates are fused to obtain the ciphertext of the coordinate information corresponding to the corrected target information.
本申请中,通过从区块链网络正获取区块对于的区块信息,根据区块信息生成用于对目标信息进行修正处理的修正量,采用修正量对该目标信息进行修正处理,得到修正后的目标信息,可有效提高采用目标函数描述目标信息的成功率。进一步,通过根据目标函数获取所述修正后的目标信息对应的坐标信息,对该修正后的目标信息对应的坐标信息进行 加密,得到该修正后的目标信息对应的坐标信息的密文,将该修正后的目标信息对应的坐标信息的密文确定为该目标信息的密文,将该目标信息的密文存储至该区块链网络中。即通过修正后的目标信息对于的坐标信息进行加密,可提高目标信息的安全性;通过修正后的目标信息对于的坐标信息的密文存储至区块链网中,可避免目标信息的密文被非法用户篡改,导致不能根据目标信息的密文解密得到目标信息的问题。In the present application, by obtaining the block information of the block pair from the block chain network, generating the correction amount used for the correction processing of the target information according to the block information, and using the correction amount to perform the correction processing on the target information, the correction is obtained. The obtained target information can effectively improve the success rate of using the objective function to describe the target information. Further, by obtaining the coordinate information corresponding to the modified target information according to the objective function, and encrypting the coordinate information corresponding to the modified target information, the ciphertext of the coordinate information corresponding to the modified target information is obtained, and the coordinate information corresponding to the modified target information is obtained. The ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network. That is, by encrypting the coordinate information of the corrected target information, the security of the target information can be improved; by storing the ciphertext of the coordinate information of the corrected target information in the blockchain network, the ciphertext of the target information can be avoided. It is tampered with by illegal users, resulting in the problem that the target information cannot be obtained by decrypting the ciphertext of the target information.
本申请实施例中还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时实现如图2及图3实施例中所示的基于修正量的加密方法。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program includes program instructions, and when the program instructions are executed by a processor, FIG. 2 and FIG. 2 are implemented. 3. The encryption method based on the correction amount shown in the embodiment.
可选的,本申请涉及的存储介质可以为可读存储介质,本申请涉及的存储介质如计算机可读存储介质可以是非易失性的,也可以是易失性的。Optionally, the storage medium involved in the present application may be a readable storage medium, and the storage medium involved in the present application, such as a computer-readable storage medium, may be non-volatile or volatile.
所述计算机可读存储介质可以是前述任一实施例所述的电子设备的内部存储单元,例如电子设备的硬盘或内存。所述计算机可读存储介质也可以是所述电子设备的外部存储设备,例如所述电子设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(FlashCard)等。进一步地,所述计算机可读存储介质还可以既包括所述电子设备的内部存储单元也包括外部存储设备。所述计算机可读存储介质用于存储所述计算机程序以及所述电子设备所需的其他程序和数据。所述计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的数据。The computer-readable storage medium may be an internal storage unit of the electronic device described in any of the foregoing embodiments, such as a hard disk or a memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) ) card, flash memory card (FlashCard) and so on. Further, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer-readable storage medium can also be used to temporarily store data that has been or will be output.
作为示例,上述计算机可读存储介质可被部署在一个计算机设备上执行,或者被部署位于一个地点的多个计算机设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个计算机设备上执行,分布在多个地点且通过通信网络互连的多个计算机设备可以组成区块链网络。As an example, the above-described computer-readable storage medium may be deployed to execute on one computer device, or be deployed to execute on multiple computer devices located at one site, or, alternatively, distributed in multiple sites and interconnected by a communication network. Executed on a single computer device, a plurality of computer devices distributed in multiple locations and interconnected by a communication network can form a blockchain network.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的电子设备和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. Interchangeability, the above description has generally described the components and steps of each example in terms of function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application. Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the electronic device and unit described above, reference may be made to the corresponding process in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的电子设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例是示意性的,例如,所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the several embodiments provided in this application, it should be understood that the disclosed electronic devices and methods may be implemented in other manners. For example, the device embodiments described above are illustrative, for example, the division of the units may be a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalents within the technical scope disclosed in the present application. Modifications or substitutions shall be covered by the protection scope of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (20)

  1. 一种基于修正量的加密方法,包括:A correction-based encryption method comprising:
    获取用于描述信息的目标函数,以及待处理的目标信息;Obtain the objective function used to describe the information, and the target information to be processed;
    从区块链网络中获取区块对应的区块信息,根据所述区块信息生成用于对所述目标信息进行修正处理的修正量;Obtain block information corresponding to a block from the block chain network, and generate a correction amount for performing correction processing on the target information according to the block information;
    采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息;Correction processing is performed on the target information by using the correction amount to obtain the corrected target information;
    根据所述目标函数获取所述修正后的目标信息对应的坐标信息;Obtain coordinate information corresponding to the modified target information according to the objective function;
    对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文;Encrypting the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information;
    将所述修正后的目标信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至所述区块链网络中。The ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
  2. 根据权利要求1所述的方法,其中,所述区块信息包括区块高度,所述根据所述区块信息生成用于对所述目标信息进行修正处理的修正量,包括:The method according to claim 1, wherein the block information includes a block height, and the generating a correction amount for performing correction processing on the target information according to the block information comprises:
    从所述区块链网络中各个区块对应的区块高度中获取最大区块高度,作为目标区块高度;Obtain the maximum block height from the block heights corresponding to each block in the blockchain network as the target block height;
    从所述区块链网络中统计所述目标区块高度对应的区块中所存储的信息条数;Count the number of pieces of information stored in the block corresponding to the height of the target block from the blockchain network;
    对所述信息条数进行随机运算,得到随机数,将所述随机数确定为用于对所述目标信息进行修正处理的修正量。A random operation is performed on the number of pieces of information to obtain a random number, and the random number is determined as a correction amount for performing correction processing on the target information.
  3. 根据权利要求1所述的方法,其中,所述区块信息包括区块生成时间,所述根据所述区块信息生成用于对所述目标信息进行修正处理的修正量,包括:The method according to claim 1, wherein the block information includes a block generation time, and the generating a correction amount for performing correction processing on the target information according to the block information comprises:
    获取所述区块链网络中的各个区块对应的区块生成时间之间的和,得到时间总和;Obtain the sum of the block generation times corresponding to each block in the blockchain network, and obtain the time sum;
    从所述区块链网络中各个区块对应的区块生成时间中确定最早区块生成时间,作为目标区块生成时间;Determine the earliest block generation time from the block generation time corresponding to each block in the blockchain network as the target block generation time;
    根据所述目标区块生成时间对所述时间总和进行取余运算,得到第一数值,将所述第一数值确定为用于对所述目标信息进行修正处理的修正量。A remainder operation is performed on the time sum according to the target block generation time to obtain a first numerical value, and the first numerical value is determined as a correction amount for performing correction processing on the target information.
  4. 根据权利要求1所述的方法,其中,所述采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息,包括:The method according to claim 1, wherein the modifying processing of the target information by using the correction amount to obtain the modified target information comprises:
    根据所述目标信息的信息类型确定所述目标信息对应的第二数值;Determine the second value corresponding to the target information according to the information type of the target information;
    获取所述第二数值与所述修正量之间的和,得到第三数值;obtaining the sum between the second numerical value and the correction amount to obtain a third numerical value;
    获取所述目标函数的函数参数,根据所述函数参数生成修正权重;Obtain the function parameters of the objective function, and generate a correction weight according to the function parameters;
    根据所述修正权重对所述第三数值进行取模运算,得到第四数值,将所述第四数值确定为修正后的目标信息。A modulo operation is performed on the third numerical value according to the correction weight to obtain a fourth numerical value, and the fourth numerical value is determined as the corrected target information.
  5. 根据权利要求1所述的方法,其中,所述根据所述目标信息的信息类型确定所述目标信息对应的第二数值,包括:The method according to claim 1, wherein the determining the second value corresponding to the target information according to the information type of the target information comprises:
    若所述目标信息的信息类型为非数值类型,则对所述目标信息进行编码,得到编码后的目标信息,将所述编码后的目标信息确定为所述目标信息对应的第二数值;If the information type of the target information is a non-numerical type, then the target information is encoded to obtain encoded target information, and the encoded target information is determined as the second value corresponding to the target information;
    若所述目标信息的信息类型为数值类型,则将所述目标信息确定为所述目标信息对应的第二数值。If the information type of the target information is a numeric type, the target information is determined as a second value corresponding to the target information.
  6. 根据权利要求1所述的方法,其中,所述对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文,包括:The method according to claim 1, wherein the encrypting the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information, comprising:
    获取所述目标信息所属的终端的属性信息,以及所述目标信息对应的密钥,所述终端的属性信息包括所述终端的终端标识、所述终端生成的口令、所述终端对应的用户信息中的至少一种;Obtain attribute information of the terminal to which the target information belongs, and a key corresponding to the target information, where the attribute information of the terminal includes the terminal identifier of the terminal, the password generated by the terminal, and the user information corresponding to the terminal. at least one of;
    根据所述终端的属性信息生成所述终端的私钥;generating the private key of the terminal according to the attribute information of the terminal;
    根据所述私钥以及所述目标信息对应的密钥,对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文。According to the private key and the key corresponding to the target information, the coordinate information corresponding to the modified target information is encrypted to obtain the ciphertext of the coordinate information corresponding to the modified target information.
  7. 根据权利要求6所述的方法,其中,所述根据所述私钥以及所述目标信息对应的密钥,对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文,包括:The method according to claim 6, wherein the coordinate information corresponding to the revised target information is encrypted according to the private key and the key corresponding to the target information to obtain the revised target The ciphertext of the coordinate information corresponding to the information, including:
    获取所述目标函数的曲线的基点坐标;Obtain the base point coordinates of the curve of the objective function;
    获取所述基点坐标与所述终端的私钥的乘积,得到候选坐标;Obtain the product of the base point coordinates and the private key of the terminal to obtain candidate coordinates;
    根据所述目标信息对应的密钥对所述候选坐标进行加密,得到所述候选坐标的密文;Encrypt the candidate coordinates according to the key corresponding to the target information to obtain the ciphertext of the candidate coordinates;
    对所述修正后的目标信息对应的坐标信息与所述候选坐标的密文进行融合,得到所述修正后的目标信息对应的坐标信息的密文。The coordinate information corresponding to the corrected target information and the ciphertext of the candidate coordinates are fused to obtain the ciphertext of the coordinate information corresponding to the corrected target information.
  8. 一种基于修正量的加密装置,包括:An encryption device based on correction amount, comprising:
    获取模块,用于获取用于描述信息的目标函数,以及待处理的目标信息;The acquisition module is used to acquire the target function used to describe the information, and the target information to be processed;
    生成模块,用于从区块链网络中获取区块对应的区块信息,根据所述区块信息生成用于对所述目标信息进行修正处理的修正量;A generating module, configured to obtain block information corresponding to a block from the block chain network, and generate a correction amount for performing correction processing on the target information according to the block information;
    处理模块,用于采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息;a processing module, configured to perform correction processing on the target information by using the correction amount to obtain the corrected target information;
    所述获取模块,还用于根据所述目标函数获取所述修正后的目标信息对应的坐标信息;The obtaining module is further configured to obtain coordinate information corresponding to the modified target information according to the target function;
    加密模块,用于对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文;an encryption module, configured to encrypt the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information;
    确定模块,用于将所述修正后的目标信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至所述区块链网络中。A determination module, configured to determine the ciphertext of the coordinate information corresponding to the corrected target information as the ciphertext of the target information, and store the ciphertext of the target information in the blockchain network.
  9. 一种电子设备,包括:An electronic device comprising:
    处理器,适于实现一条或一条以上指令;以及,a processor adapted to implement one or more instructions; and,
    计算机可读存储介质,所述计算机可读存储介质存储有一条或一条以上指令,所述一条或一条以上指令适于由所述处理器加载并执行以下方法:A computer-readable storage medium having stored thereon one or more instructions adapted to be loaded by the processor and perform the following methods:
    获取用于描述信息的目标函数,以及待处理的目标信息;Obtain the objective function used to describe the information, and the target information to be processed;
    从区块链网络中获取区块对应的区块信息,根据所述区块信息生成用于对所述目标信息进行修正处理的修正量;Obtain block information corresponding to a block from the block chain network, and generate a correction amount for performing correction processing on the target information according to the block information;
    采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息;Correction processing is performed on the target information by using the correction amount to obtain the corrected target information;
    根据所述目标函数获取所述修正后的目标信息对应的坐标信息;Obtain coordinate information corresponding to the modified target information according to the objective function;
    对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文;Encrypting the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information;
    将所述修正后的目标信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至所述区块链网络中。The ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
  10. 根据权利要求9所述的电子设备,其中,所述区块信息包括区块高度,执行所述根据所述区块信息生成用于对所述目标信息进行修正处理的修正量,包括:The electronic device according to claim 9, wherein the block information includes a block height, and performing the generating of the correction amount for performing correction processing on the target information according to the block information comprises:
    从所述区块链网络中各个区块对应的区块高度中获取最大区块高度,作为目标区块高度;Obtain the maximum block height from the block heights corresponding to each block in the blockchain network as the target block height;
    从所述区块链网络中统计所述目标区块高度对应的区块中所存储的信息条数;Count the number of pieces of information stored in the block corresponding to the height of the target block from the blockchain network;
    对所述信息条数进行随机运算,得到随机数,将所述随机数确定为用于对所述目标信息进行修正处理的修正量。A random operation is performed on the number of pieces of information to obtain a random number, and the random number is determined as a correction amount for performing correction processing on the target information.
  11. 根据权利要求9所述的电子设备,其中,所述区块信息包括区块生成时间,执行所述根据所述区块信息生成用于对所述目标信息进行修正处理的修正量,包括:The electronic device according to claim 9, wherein the block information includes a block generation time, and performing the generating of the correction amount for performing correction processing on the target information according to the block information comprises:
    获取所述区块链网络中的各个区块对应的区块生成时间之间的和,得到时间总和;Obtain the sum of the block generation times corresponding to each block in the blockchain network, and obtain the time sum;
    从所述区块链网络中各个区块对应的区块生成时间中确定最早区块生成时间,作为目标区块生成时间;Determine the earliest block generation time from the block generation time corresponding to each block in the blockchain network as the target block generation time;
    根据所述目标区块生成时间对所述时间总和进行取余运算,得到第一数值,将所述第一数值确定为用于对所述目标信息进行修正处理的修正量。A remainder operation is performed on the time sum according to the target block generation time to obtain a first numerical value, and the first numerical value is determined as a correction amount for performing correction processing on the target information.
  12. 根据权利要求9所述的电子设备,其中,执行所述采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息,包括:The electronic device according to claim 9, wherein performing the correction process on the target information by using the correction amount to obtain the corrected target information, comprising:
    根据所述目标信息的信息类型确定所述目标信息对应的第二数值;Determine the second value corresponding to the target information according to the information type of the target information;
    获取所述第二数值与所述修正量之间的和,得到第三数值;obtaining the sum between the second numerical value and the correction amount to obtain a third numerical value;
    获取所述目标函数的函数参数,根据所述函数参数生成修正权重;Obtain the function parameters of the objective function, and generate a correction weight according to the function parameters;
    根据所述修正权重对所述第三数值进行取模运算,得到第四数值,将所述第四数值确定为修正后的目标信息。A modulo operation is performed on the third numerical value according to the correction weight to obtain a fourth numerical value, and the fourth numerical value is determined as the corrected target information.
  13. 根据权利要求9所述的电子设备,其中,执行所述对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文,包括:The electronic device according to claim 9, wherein the encryption of the coordinate information corresponding to the modified target information is performed to obtain the ciphertext of the coordinate information corresponding to the modified target information, comprising:
    获取所述目标信息所属的终端的属性信息,以及所述目标信息对应的密钥,所述终端的属性信息包括所述终端的终端标识、所述终端生成的口令、所述终端对应的用户信息中的至少一种;Obtain attribute information of the terminal to which the target information belongs, and a key corresponding to the target information, where the attribute information of the terminal includes the terminal identifier of the terminal, the password generated by the terminal, and the user information corresponding to the terminal. at least one of;
    根据所述终端的属性信息生成所述终端的私钥;generating the private key of the terminal according to the attribute information of the terminal;
    根据所述私钥以及所述目标信息对应的密钥,对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文。According to the private key and the key corresponding to the target information, the coordinate information corresponding to the modified target information is encrypted to obtain the ciphertext of the coordinate information corresponding to the modified target information.
  14. 根据权利要求13所述的电子设备,其中,执行所述根据所述私钥以及所述目标信息对应的密钥,对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文,包括:The electronic device according to claim 13, wherein the coordinate information corresponding to the modified target information is encrypted by executing the encryption according to the private key and the key corresponding to the target information, to obtain the modified target information. The ciphertext of the coordinate information corresponding to the target information, including:
    获取所述目标函数的曲线的基点坐标;Obtain the base point coordinates of the curve of the objective function;
    获取所述基点坐标与所述终端的私钥的乘积,得到候选坐标;Obtain the product of the base point coordinates and the private key of the terminal to obtain candidate coordinates;
    根据所述目标信息对应的密钥对所述候选坐标进行加密,得到所述候选坐标的密文;Encrypt the candidate coordinates according to the key corresponding to the target information to obtain the ciphertext of the candidate coordinates;
    对所述修正后的目标信息对应的坐标信息与所述候选坐标的密文进行融合,得到所述修正后的目标信息对应的坐标信息的密文。The coordinate information corresponding to the corrected target information and the ciphertext of the candidate coordinates are fused to obtain the ciphertext of the coordinate information corresponding to the corrected target information.
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有一条或者一条以上指令,所述一条或一条以上指令适于由处理器加载并执行以下方法:A computer-readable storage medium, wherein the computer-readable storage medium stores one or more instructions adapted to be loaded by a processor and execute the following method:
    获取用于描述信息的目标函数,以及待处理的目标信息;Obtain the objective function used to describe the information, and the target information to be processed;
    从区块链网络中获取区块对应的区块信息,根据所述区块信息生成用于对所述目标信息进行修正处理的修正量;Obtain block information corresponding to a block from the block chain network, and generate a correction amount for performing correction processing on the target information according to the block information;
    采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息;Correction processing is performed on the target information by using the correction amount to obtain the corrected target information;
    根据所述目标函数获取所述修正后的目标信息对应的坐标信息;Obtain coordinate information corresponding to the modified target information according to the objective function;
    对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文;Encrypting the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information;
    将所述修正后的目标信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至所述区块链网络中。The ciphertext of the coordinate information corresponding to the corrected target information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
  16. 根据权利要求15所述的计算机可读存储介质,其中,所述区块信息包括区块高度,执行所述根据所述区块信息生成用于对所述目标信息进行修正处理的修正量,包括:The computer-readable storage medium of claim 15, wherein the block information includes a block height, and performing the generating of the correction amount for performing correction processing on the target information according to the block information comprises: :
    从所述区块链网络中各个区块对应的区块高度中获取最大区块高度,作为目标区块高度;Obtain the maximum block height from the block heights corresponding to each block in the blockchain network as the target block height;
    从所述区块链网络中统计所述目标区块高度对应的区块中所存储的信息条数;Count the number of pieces of information stored in the block corresponding to the height of the target block from the blockchain network;
    对所述信息条数进行随机运算,得到随机数,将所述随机数确定为用于对所述目标信 息进行修正处理的修正量。A random operation is performed on the number of pieces of information to obtain a random number, and the random number is determined as a correction amount for performing correction processing on the target information.
  17. 根据权利要求15所述的计算机可读存储介质,其中,所述区块信息包括区块生成时间,执行所述根据所述区块信息生成用于对所述目标信息进行修正处理的修正量,包括:The computer-readable storage medium according to claim 15, wherein the block information includes a block generation time, and the generation of a correction amount for performing correction processing on the target information according to the block information is performed, include:
    获取所述区块链网络中的各个区块对应的区块生成时间之间的和,得到时间总和;Obtain the sum of the block generation times corresponding to each block in the blockchain network, and obtain the time sum;
    从所述区块链网络中各个区块对应的区块生成时间中确定最早区块生成时间,作为目标区块生成时间;Determine the earliest block generation time from the block generation time corresponding to each block in the blockchain network as the target block generation time;
    根据所述目标区块生成时间对所述时间总和进行取余运算,得到第一数值,将所述第一数值确定为用于对所述目标信息进行修正处理的修正量。A remainder operation is performed on the time sum according to the target block generation time to obtain a first numerical value, and the first numerical value is determined as a correction amount for performing correction processing on the target information.
  18. 根据权利要求15所述的计算机可读存储介质,其中,执行所述采用所述修正量对所述目标信息进行修正处理,得到修正后的目标信息,包括:The computer-readable storage medium according to claim 15, wherein performing the correction process on the target information by using the correction amount to obtain the corrected target information comprises:
    根据所述目标信息的信息类型确定所述目标信息对应的第二数值;Determine the second value corresponding to the target information according to the information type of the target information;
    获取所述第二数值与所述修正量之间的和,得到第三数值;obtaining the sum between the second numerical value and the correction amount to obtain a third numerical value;
    获取所述目标函数的函数参数,根据所述函数参数生成修正权重;Obtain the function parameters of the objective function, and generate a correction weight according to the function parameters;
    根据所述修正权重对所述第三数值进行取模运算,得到第四数值,将所述第四数值确定为修正后的目标信息。A modulo operation is performed on the third numerical value according to the correction weight to obtain a fourth numerical value, and the fourth numerical value is determined as the corrected target information.
  19. 根据权利要求15所述的计算机可读存储介质,其中,执行所述对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文,包括:The computer-readable storage medium according to claim 15, wherein performing the encryption of the coordinate information corresponding to the modified target information to obtain the ciphertext of the coordinate information corresponding to the modified target information, comprising: :
    获取所述目标信息所属的终端的属性信息,以及所述目标信息对应的密钥,所述终端的属性信息包括所述终端的终端标识、所述终端生成的口令、所述终端对应的用户信息中的至少一种;Obtain attribute information of the terminal to which the target information belongs, and a key corresponding to the target information, where the attribute information of the terminal includes the terminal identifier of the terminal, the password generated by the terminal, and the user information corresponding to the terminal. at least one of;
    根据所述终端的属性信息生成所述终端的私钥;generating the private key of the terminal according to the attribute information of the terminal;
    根据所述私钥以及所述目标信息对应的密钥,对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文。According to the private key and the key corresponding to the target information, the coordinate information corresponding to the modified target information is encrypted to obtain the ciphertext of the coordinate information corresponding to the modified target information.
  20. 根据权利要求19所述的计算机可读存储介质,其中,执行所述根据所述私钥以及所述目标信息对应的密钥,对所述修正后的目标信息对应的坐标信息进行加密,得到所述修正后的目标信息对应的坐标信息的密文,包括:The computer-readable storage medium according to claim 19, wherein the coordinate information corresponding to the modified target information is encrypted according to the private key and the key corresponding to the target information to obtain the The ciphertext of the coordinate information corresponding to the corrected target information, including:
    获取所述目标函数的曲线的基点坐标;Obtain the base point coordinates of the curve of the objective function;
    获取所述基点坐标与所述终端的私钥的乘积,得到候选坐标;Obtain the product of the base point coordinates and the private key of the terminal to obtain candidate coordinates;
    根据所述目标信息对应的密钥对所述候选坐标进行加密,得到所述候选坐标的密文;Encrypt the candidate coordinates according to the key corresponding to the target information to obtain the ciphertext of the candidate coordinates;
    对所述修正后的目标信息对应的坐标信息与所述候选坐标的密文进行融合,得到所述修正后的目标信息对应的坐标信息的密文。The coordinate information corresponding to the corrected target information and the ciphertext of the candidate coordinates are fused to obtain the ciphertext of the coordinate information corresponding to the corrected target information.
PCT/CN2021/109265 2020-09-29 2021-07-29 Encryption method and apparatus based on amendment amount, and device, and medium WO2022068361A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011053237.8 2020-09-29
CN202011053237.8A CN112100637A (en) 2020-09-29 2020-09-29 Encryption method, device, equipment and medium based on correction quantity

Publications (1)

Publication Number Publication Date
WO2022068361A1 true WO2022068361A1 (en) 2022-04-07

Family

ID=73782873

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/109265 WO2022068361A1 (en) 2020-09-29 2021-07-29 Encryption method and apparatus based on amendment amount, and device, and medium

Country Status (2)

Country Link
CN (1) CN112100637A (en)
WO (1) WO2022068361A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112100637A (en) * 2020-09-29 2020-12-18 深圳壹账通智能科技有限公司 Encryption method, device, equipment and medium based on correction quantity

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180191498A1 (en) * 2017-01-03 2018-07-05 Nxp B.V. X-only generic mapping function for pace protocol
CN109687965A (en) * 2019-02-18 2019-04-26 哈尔滨工业大学(深圳) The real name identification method of subscriber identity information in a kind of protection network
CN110378128A (en) * 2019-06-17 2019-10-25 深圳壹账通智能科技有限公司 Data ciphering method, device and terminal device
US20190373137A1 (en) * 2018-06-03 2019-12-05 Richard H. Krukar Blockchannel scanner systems and methods
CN110839026A (en) * 2019-11-12 2020-02-25 深圳市网心科技有限公司 Data processing method based on block chain and related equipment
CN112100637A (en) * 2020-09-29 2020-12-18 深圳壹账通智能科技有限公司 Encryption method, device, equipment and medium based on correction quantity

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9990249B2 (en) * 2015-12-24 2018-06-05 Intel Corporation Memory integrity with error detection and correction
CN109271559A (en) * 2018-08-21 2019-01-25 平安科技(深圳)有限公司 It modifies method, apparatus and electronic equipment to data in block chain
CN109523040B (en) * 2018-11-23 2021-06-29 南京荣链科技有限公司 User equipment repair method, server, system and medium capable of protecting privacy
CN111126987B (en) * 2019-12-02 2021-02-19 腾讯科技(深圳)有限公司 Resource transfer information processing method and device, storage medium and electronic device
CN111654364A (en) * 2020-07-06 2020-09-11 重庆知翔科技有限公司 Method for realizing data safety communication by using block chain encryption technology

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180191498A1 (en) * 2017-01-03 2018-07-05 Nxp B.V. X-only generic mapping function for pace protocol
US20190373137A1 (en) * 2018-06-03 2019-12-05 Richard H. Krukar Blockchannel scanner systems and methods
CN109687965A (en) * 2019-02-18 2019-04-26 哈尔滨工业大学(深圳) The real name identification method of subscriber identity information in a kind of protection network
CN110378128A (en) * 2019-06-17 2019-10-25 深圳壹账通智能科技有限公司 Data ciphering method, device and terminal device
CN110839026A (en) * 2019-11-12 2020-02-25 深圳市网心科技有限公司 Data processing method based on block chain and related equipment
CN112100637A (en) * 2020-09-29 2020-12-18 深圳壹账通智能科技有限公司 Encryption method, device, equipment and medium based on correction quantity

Also Published As

Publication number Publication date
CN112100637A (en) 2020-12-18

Similar Documents

Publication Publication Date Title
US10673626B2 (en) Threshold secret share authentication proof and secure blockchain voting with hardware security modules
TWI706279B (en) Multi-party safe calculation method and device, electronic equipment
US11552792B2 (en) Systems and methods for generating signatures
WO2021114819A1 (en) Methods for generating and executing smart contract transaction and device
JP2020502856A5 (en)
WO2019209168A2 (en) Data processing method, related apparatus, and blockchain system
WO2022068356A1 (en) Blockchain-based information encryption method and apparatus, device and medium
CN109995781B (en) Data transmission method, device, medium and equipment
JP6882705B2 (en) Key exchange system and key exchange method
WO2022068360A1 (en) Shared root key-based information processing method and apparatus, and device and medium
WO2022068358A1 (en) Encryption method and apparatus for generating keys on basis of attributes of information, and device
CN112202554B (en) Information processing method, device and equipment for generating key based on attribute of information
Liang et al. Exploring the attack surfaces in blockchain enabled smart cities
KR20200108343A (en) Computer-implemented method and system for obtaining digitally signed data
WO2022068362A1 (en) Block chain-based information processing method and apparatus, device, and medium
WO2022068355A1 (en) Encryption method and apparatus based on feature of information, device, and storage medium
WO2022068234A1 (en) Encryption method and apparatus based on shared root key, device and medium
TW202025666A (en) Computer implemented system and method for sharing a common secret
WO2022068359A1 (en) Encryption method and apparatus for compressing ciphertext of information, and device and medium
WO2022068361A1 (en) Encryption method and apparatus based on amendment amount, and device, and medium
WO2022068235A1 (en) Information processing method and apparatus for generating random number on the basis of attribute of information, and device
CN113901520A (en) Data processing method, device, equipment and medium based on block chain
Zhu et al. A patient-centric key management protocol for healthcare information system based on blockchain
US20220303122A1 (en) System and method of cryptographic key management in a plurality of blockchain based computer networks
da Costa et al. A decentralized protocol for securely storing and sharing health records

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21874023

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03/07/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21874023

Country of ref document: EP

Kind code of ref document: A1