WO2022068358A1 - 基于信息的属性生成密钥的加密方法、装置及设备 - Google Patents

基于信息的属性生成密钥的加密方法、装置及设备 Download PDF

Info

Publication number
WO2022068358A1
WO2022068358A1 PCT/CN2021/109258 CN2021109258W WO2022068358A1 WO 2022068358 A1 WO2022068358 A1 WO 2022068358A1 CN 2021109258 W CN2021109258 W CN 2021109258W WO 2022068358 A1 WO2022068358 A1 WO 2022068358A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
sub
piece
coordinate
target
Prior art date
Application number
PCT/CN2021/109258
Other languages
English (en)
French (fr)
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 WO2022068358A1 publication Critical patent/WO2022068358A1/zh

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 and device for generating a key based on attributes of information.
  • Embodiments of the present application provide an encryption method, device and device for generating a key based on attributes of information, which can improve the security of target information.
  • an embodiment of the present application provides an encryption method for generating a key based on an attribute of information, the method comprising:
  • the target information includes at least two pieces of sub-information
  • the attribute information of each piece of sub-information includes the generation time of each piece of sub-information , at least one of the length of each piece of sub-information and the organization to which each piece of sub-information belongs;
  • the ciphertext of the coordinate information corresponding to each piece of sub-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 for generating a key based on an attribute of information, the device comprising:
  • the first acquisition module is used to acquire the target function for describing information, and the attribute information of each piece of sub-information in the target information to be processed;
  • the target information includes at least two pieces of sub-information, and the attribute information of each piece of sub-information includes all the sub-information. at least one of the generation time of each piece of sub-information, the length of each piece of sub-information, and the organization to which each piece of sub-information belongs;
  • a generating module configured to generate a key corresponding to each piece of sub-information according to the attribute information of each piece of sub-information
  • a second obtaining module configured to obtain coordinate information corresponding to each of the at least two pieces of sub-information according to the objective function
  • an encryption module configured to encrypt the coordinate information of the corresponding sub-information in the at least two pieces of sub-information by using the key corresponding to each piece of sub-information to obtain the ciphertext of the coordinate information corresponding to each of the sub-information
  • the storage module is configured to determine the ciphertext of the coordinate information corresponding to each piece of sub-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:
  • the target information includes at least two pieces of sub-information
  • the attribute information of each piece of sub-information includes the generation time of each piece of sub-information , at least one of the length of each piece of sub-information and the organization to which each piece of sub-information belongs;
  • the ciphertext of the coordinate information corresponding to each piece of sub-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:
  • the target information includes at least two pieces of sub-information
  • the attribute information of each piece of sub-information includes the generation time of each piece of sub-information , at least one of the length of each piece of sub-information and the organization to which each piece of sub-information belongs;
  • the ciphertext of the coordinate information corresponding to each piece of sub-information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
  • the embodiments of the present application are beneficial to improve the security of target information, and can avoid target information from being leaked.
  • 1a is a schematic diagram of the architecture of an encryption system for generating a key based on an attribute of information provided by an embodiment of the present application;
  • FIG. 1b is a schematic diagram of a data sharing system provided by an embodiment of the present application.
  • FIG. 1c is a schematic structural diagram of a blockchain block provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of an encryption method for generating a key based on an attribute of information provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of a method for obtaining coordinate information corresponding to each piece of sub-information in at least two pieces of sub-information provided by an embodiment of the present application;
  • FIG. 4 is a schematic flowchart of another encryption method for generating a key based on an attribute of information provided by an embodiment of the present application
  • FIG. 5 is a schematic structural diagram of an encryption device for generating a key based on an attribute of information provided by an embodiment of the present application
  • FIG. 6 is a schematic structural diagram of an electronic device provided by another embodiment of the present application.
  • the present application may relate to the technical field of artificial intelligence, and may be applied to data encryption scenarios, such as blockchain-based data encryption scenarios.
  • data encryption scenarios such as blockchain-based data encryption scenarios.
  • medical data can be stored in the blockchain, and the medical data can include personal health records, prescriptions, inspection reports and other data.
  • encryption processing of medical data in the blockchain can be realized, such as drug management and so on.
  • the blockchain involved in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission (P2P transmission), consensus mechanism, and encryption algorithm.
  • each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer and the application service layer; the blockchain can be composed of multiple serial 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 the transaction, and the transaction can be permanently checked (it cannot be tampered with).
  • 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 can be used in a drug management scenario, that is, the above target information can refer to the drug distribution information of the hospital, the medication information of the patient, etc., by encrypting the drug distribution information of the hospital and the medication information of the patient, and encrypting the encrypted information
  • the data is stored in the blockchain network, which is conducive to the realization of drug management (such as drug management, drug distribution) and improves the security of drug management.
  • the schematic diagram of the system architecture includes a blockchain network and multiple terminals.
  • three terminals are taken as an example, namely a first terminal, a second terminal and a third terminal.
  • the first terminal, the second terminal and the third terminal can be used to obtain the ciphertext of the target information from the blockchain network, or store the ciphertext of the target information in the blockchain network.
  • the above-mentioned blockchain network may be the blockchain network 100 shown in FIG. 1b, and the blockchain network 100 refers to a system for data sharing between node devices and node devices. It includes multiple node devices 101, and the multiple node devices 101 may refer to each client in the blockchain network. Each node device 101 can receive data during normal operation, and maintain the shared data within the blockchain network based on the received transaction data. In order to ensure the information exchange in the blockchain network, there can be an information connection between each node device in the blockchain network, and the node devices can transmit information through the above information connection. Each node device in the blockchain network stores an identical blockchain.
  • the blockchain consists of multiple blocks, see Figure 1c, the blockchain consists of multiple blocks, the founding block includes the block header and the block body, and the block header stores the data feature value, version number, timestamp and Difficulty value, data is stored in the block body; the next block of the genesis block takes the genesis block as the parent block, the next block also includes the block header and the block body, and the block header stores the data of the current block.
  • the block data is associated, which ensures the security of the data in the block.
  • the node equipment, the first terminal, the second terminal and the third terminal in the blockchain network can be computer equipment, including mobile phones, tablet computers, notebook computers, PDAs, smart speakers, mobile Internet equipment (MID, mobile internet device), POS (Point Of Sales) machines, wearable devices (such as smart watches, smart bracelets, etc.), etc.; it can also be an independent server, or a server cluster composed of several servers, or a cloud A computing center; it can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and Cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
  • CDN Content Delivery Network
  • FIG. 2 is a schematic flowchart of an encryption method for generating a key based on an attribute of information provided by an embodiment of the present application.
  • the embodiment of the present application is performed by an electronic device.
  • the method includes steps S101-S104.
  • S101 Acquire an objective function for describing information and attribute information of each piece of sub-information in the target information to be processed.
  • the target information includes at least two pieces of sub-information.
  • the target information may refer to transaction data, business data, and the like of an institution.
  • the attribute information of each piece of sub-information in the target information includes at least one of the generation time of each piece of sub-information, the length of each piece of sub-information, and the organization to which each piece of sub-information belongs.
  • the objective function is used to describe the target information, that is, the target information is converted into the coordinate information corresponding to the objective function, so as to improve the security of the target information.
  • the objective function may be an elliptic curve algorithm
  • the elliptic curve algorithm is an asymmetric encryption algorithm implemented based on the mathematical theory of elliptic curves.
  • S102 Generate a key corresponding to each piece of sub-information according to the attribute information of each piece of sub-information.
  • the key corresponding to each piece of sub-information can be generated according to the attribute information of each piece of sub-information, and the attribute information of each piece of sub-information can include the generation time of each piece of sub-information, the length of each piece of sub-information, and at least one of the institutions to which each piece of sub-information belongs. kind.
  • a key corresponding to each piece of sub-information is generated according to the attribute information of each piece of sub-information, and the target information is encrypted according to the key, which can improve the security of the target information.
  • the number of pieces of information stored by the institution to which each piece of sub-information belongs can be obtained from the blockchain network, and the credit rating of the institution to which each piece of sub-information belongs is determined according to the number of pieces of information stored by the institution to which each piece of sub-information belongs.
  • the credit level of the institution to which the sub-information belongs is determined as the first credit level; if the number of records stored by the institution to which the sub-information belongs belongs to the second Within the threshold range, the credit level of the institution to which the sub-information belongs is determined as the second credit level; if the number of records stored by the institution to which the sub-information belongs falls within the third threshold range, the credit level of the institution to which the sub-information belongs is determined. Determined to be the third credit level.
  • K the credit rating of the institution to which a certain sub-information belongs
  • K1 the corresponding sub-information. key.
  • the length of each piece of sub-information can be obtained, and the privacy level corresponding to each piece of sub-information can be determined according to the length of each piece of sub-information.
  • the privacy level corresponding to each piece of sub-information can be determined according to the length of each piece of sub-information.
  • the length of the sub-information is longer, it means that the privacy level of the sub-information is higher; if the length of the sub-information is shorter, it means that the privacy level of the sub-information is lower.
  • the privacy level of the sub-information may be set to the first privacy level; when the length of the sub-information is greater than the second length threshold, the privacy level of the sub-information may be set to Second privacy level.
  • the privacy level corresponding to a certain sub-information is the second privacy level
  • a random number M corresponding to the sub-information is generated according to the privacy level corresponding to the sub-information, and M is used as the key corresponding to the sub-information.
  • the validity period of each piece of sub-information in the target information can be obtained; the importance level of each piece of sub-information is obtained according to the validity period of each piece of sub-information in the target information, and a random number is generated according to the importance level of each piece of sub-information, according to The random number generates a key corresponding to each piece of sub-information.
  • the validity period of the sub-information is longer, it means that the sub-information is more important, and the corresponding importance level is higher; if the validity period of the sub-information is shorter, it means that the sub-information is relatively not very important, and the corresponding importance level is relatively low. For example, if a certain piece of information is valid for 30 days, so that more people can obtain the information, the importance level of the piece of information can be set to the first level; the validity period of a certain piece of information is 10 days, and the importance level of the piece of information can be set to the first level; The importance level is set to the second level.
  • a random number M corresponding to the sub-information is generated according to the importance level corresponding to the sub-information, and then a hash algorithm is performed on the random number M to obtain a key corresponding to the sub-information.
  • This is beneficial to improve the security of the target information and avoid the leakage of the target information; at the same time, since the key corresponding to each sub-information above is only related to the sub-information itself, it is beneficial for the terminal to which the sub-information belongs to be able to quickly correspond to the sub-information
  • the ciphertext of the coordinate information is decrypted, and the efficiency of decrypting the information is improved.
  • S103 Acquire coordinate information corresponding to each of the at least two pieces of sub-information according to the objective function.
  • the coordinate information corresponding to each of the at least two sub-information is obtained according to the objective function, that is, each of the at least two sub-information is converted into the corresponding coordinate information in the objective function.
  • a schematic diagram of a method for obtaining coordinate information corresponding to each of the at least two pieces of sub-information provided in this embodiment as shown in FIG. 3 , the obtaining of each piece of the at least two pieces of sub-information corresponds to
  • the schematic diagram of the coordinate information method includes steps S21-S24.
  • the curve corresponding to the objective function can be obtained, and the curve corresponding to the objective function can be prime256v1 curve, secp256r1 curve, nistp256 curve, secp256k1 curve and so on.
  • Each piece of sub-information is mapped to the first coordinate of the target point corresponding to each piece of sub-information on the curve corresponding to the objective function.
  • the second coordinate of the target point corresponding to each sub-information on the objective function is determined, and the first coordinate and the second coordinate are determined as the coordinate information corresponding to each sub-information.
  • the curve of the objective function can be a secp256r1 curve, and a certain sub-information is mapped to the X1 coordinate of the corresponding target point on the secp256r1 curve, that is, a certain sub-information is used as the X1 coordinate of a target point on the secp256r1 curve. And bring the X1 coordinate corresponding to the piece of information into the expression of the secp256r1 curve to obtain the Y1 coordinate corresponding to the piece of information.
  • the X1 coordinate and the Y1 coordinate are used as the coordinate information corresponding to the sub-information.
  • S105 Determine the ciphertext of the coordinate information corresponding to each piece of sub-information as the ciphertext of the target information, and store the ciphertext of the target information in the blockchain network.
  • the coordinate information of the corresponding sub-information in at least two pieces of sub-information is encrypted to obtain the ciphertext of the coordinate information corresponding to each piece of sub-information.
  • the ciphertext of the coordinate information corresponding to each of the at least two sub-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 of the target block in the blockchain network and the key corresponding to each sub-information can be obtained;
  • the target block is the block with the largest block height in the blockchain network, and the The block information includes at least one of the block height of the target block, the generation timestamp of the target block, and the amount of information in the target block;
  • the private key is generated according to the block information of the target block; according to the private key and each The key corresponding to the piece of sub-information encrypts the coordinate information corresponding to each piece of sub-information in the at least two pieces of sub-information, and obtains the ciphertext of the coordinate information corresponding to each piece of sub-information.
  • the above-mentioned blockchain network is a blockchain network that stores the ciphertext of the target information, and the block information of the target block in the blockchain network and the key corresponding to each sub-information can be obtained.
  • the target block can be the block with the largest block height in the blockchain network, and the block information of the target block includes the block height of the target block, the generation timestamp of the target block, and the information in the target block. at least one of the quantities.
  • the target block can also be the block with the smallest block height in the blockchain network, or it can be other blocks in the blockchain network.
  • the block height of the target block can be obtained, the target random number can be generated according to the block height of the target block, and the target random number can be filled according to the secp256k1 algorithm to generate a private key.
  • the importance level of the target block can also be determined according to the information data in the target block, and a private key can be obtained by performing a hash operation on the importance level of the target block.
  • the key corresponding to each piece of sub-information is generated according to the attribute information of each piece of sub-information;
  • the coordinate information corresponding to each of the at least two pieces of sub-information is acquired according to the objective function.
  • the coordinate information of the corresponding sub-information in the at least two pieces of sub-information is encrypted, so as to obtain the ciphertext of the coordinate information corresponding to each of the sub-information; this is conducive to improving the target information It can prevent the target information from being leaked; at the same time, since the key corresponding to each of the above sub-information is only related to the sub-information itself, it is beneficial for the terminal to which the sub-information belongs to be able to quickly interpret the ciphertext of the coordinate information corresponding to the sub-information. Decryption is performed to improve the efficiency of decrypting information.
  • the ciphertext of the target information is stored in the blockchain network; the ciphertext of the target information can be effectively avoided.
  • the ciphertext of the target information is tampered with, and the target message cannot be decrypted according to the ciphertext of the target information, which improves the security of the target information.
  • FIG. 4 a schematic flowchart of another encryption method for generating a key based on an attribute of information provided by the present embodiment, as shown in FIG. 4 , the encryption method for generating a key based on an attribute of information
  • the schematic flowchart includes steps S201-S207.
  • S201 Acquire an objective function for describing information and attribute information of each piece of sub-information in the target information to be processed.
  • S202 Generate a key corresponding to each piece of sub-information according to the attribute information of each piece of sub-information.
  • S203 Acquire coordinate information corresponding to each of the at least two pieces of sub-information according to the objective function.
  • steps S201-S203 may refer to the content of FIG. 1, which will not be repeated here.
  • the above-mentioned blockchain network is a blockchain network that stores the ciphertext of the target information, and the block information of the target block in the blockchain network and the key corresponding to each sub-information can be obtained.
  • the target block can be the block with the largest block height in the blockchain network, and the block information of the target block includes the block height of the target block, the generation timestamp of the target block, and the information in the target block. at least one of the quantities.
  • the target block can also be the block with the smallest block height in the blockchain network, or other blocks in the blockchain network.
  • the block height of the target block can be obtained, a target random number can be generated according to the block height of the target block, and a private key can be generated according to the target random number.
  • the importance level of the target block can also be determined according to the amount of information in the target block, and a private key can be obtained by performing a hash operation on the importance level of the target block.
  • attribute information of the terminal device corresponding to the target information may also be acquired, and the attribute information of the terminal device may include the version number of the terminal device, user information of the terminal device, and the like.
  • S207 Determine the ciphertext of the coordinate information corresponding to each piece of sub-information as the ciphertext of the target information, and store the ciphertext of the target information in the blockchain network.
  • the base point coordinates of the curve of the objective function can be obtained; the product of the base point coordinates and the above-mentioned private key is obtained to obtain the candidate coordinates; the candidate coordinates are encrypted according to the key corresponding to each piece of sub-information to obtain the ciphertext of the candidate coordinates; The coordinate information corresponding to each piece of sub-information is fused with the ciphertext of the corresponding candidate coordinates to obtain the ciphertext of the coordinate information corresponding to each piece of sub-information.
  • the base point coordinates of the curve corresponding to the objective function are acquired, and the base point coordinates of the curve corresponding to the objective function are multiplied by the above private key to obtain candidate coordinates.
  • the ciphertext of the candidate coordinates is obtained.
  • the coordinate information corresponding to each piece of sub-information is fused with the ciphertext of the corresponding candidate coordinates to obtain the ciphertext of the coordinate information corresponding to each piece of sub-information.
  • the private key Q is obtained according to the block information of the target block.
  • the coordinate information P2 (X1, Y1) corresponding to the sub-information is fused with the ciphertext P1 of the corresponding candidate coordinates to obtain the corresponding sub-information.
  • the coordinates corresponding to each sub-information in the target information are encrypted, the ciphertext of the coordinate information corresponding to each sub-information is obtained, and after obtaining the ciphertext corresponding to each sub-information in at least two sub-information in the target information, each sub-information corresponds to
  • the ciphertext of the target information is determined as the ciphertext corresponding to the target information, and the ciphertext of the target information is stored in the blockchain network to avoid the risk of tampering when the ciphertext of the target information is stored locally in the terminal, and the security of the target information is improved. and save storage space.
  • the key corresponding to each piece of sub-information is generated according to the attribute information of each piece of sub-information;
  • the coordinate information corresponding to each of the at least two pieces of sub-information is acquired according to the objective function.
  • the coordinate information of the corresponding sub-information in the at least two pieces of sub-information is encrypted, so as to obtain the ciphertext of the coordinate information corresponding to each of the sub-information; this is conducive to improving the target information It can prevent the target information from being leaked; at the same time, since the key corresponding to each of the above sub-information is only related to the sub-information itself, it is beneficial for the terminal to which the sub-information belongs to be able to quickly interpret the ciphertext of the coordinate information corresponding to the sub-information. Decryption is performed to improve the efficiency of decrypting information.
  • the ciphertext of the target information is stored in the blockchain network; the ciphertext of the target information can be effectively avoided.
  • the ciphertext of the target information is tampered with, and the target message cannot be decrypted according to the ciphertext of the target information, thereby improving the security of the target information.
  • FIG. 5 is a schematic structural diagram of an encryption device for generating a key based on an attribute of information provided by an embodiment of the present application.
  • the device in the embodiment of the present application may be in the above-mentioned electronic device.
  • the encryption device for generating a key based on an attribute of the information includes:
  • the first obtaining module 11 is used to obtain the target function for describing information, and the attribute information of each piece of sub-information in the target information to be processed;
  • the target information includes at least two pieces of sub-information, and the attribute information of each piece of sub-information includes At least one of the generation time of each piece of sub-information, the length of each piece of sub-information, and the organization to which each piece of sub-information belongs;
  • Generation module 12 for generating the corresponding key of each piece of sub-information according to the attribute information of each piece of sub-information
  • the above-mentioned generating module 12 includes: a first obtaining unit, a first determining unit, and a first computing unit.
  • a first obtaining unit configured to obtain, from the blockchain network, the number of pieces of information stored by the organization to which each piece of sub-information belongs;
  • a first determining unit configured to determine the credit level of the institution to which each piece of sub-information belongs according to the number of pieces of information stored by the institution to which each piece of sub-information belongs;
  • the first operation unit is configured to perform hash operation on the credit level of the institution to which each piece of sub-information belongs, to obtain a key corresponding to each piece of sub-information.
  • the attribute information of each piece of sub-information includes the generation time of each piece of sub-information
  • the above-mentioned generating module 12 further includes: a first generating unit and a second computing unit.
  • a first generating unit configured to generate a random number corresponding to each piece of information according to the generation time of each piece of sub-information
  • the second operation unit is configured to perform a hash operation on the random numbers corresponding to each piece of information respectively to obtain a key corresponding to each piece of sub-information.
  • the attribute information of each piece of sub-information includes the length of each piece of sub-information
  • the above-mentioned generating module 12 further includes: a second determining unit, a second generating unit, and a third generating unit.
  • a second determining unit configured to determine the privacy level corresponding to each piece of sub-information according to the length of each piece of sub-information
  • a second generating unit configured to generate a random number corresponding to each piece of sub-information according to the privacy level corresponding to each piece of sub-information
  • a third generating unit configured to generate a key corresponding to each piece of sub-information according to the random number corresponding to each piece of sub-information.
  • the second obtaining module 13 is configured to obtain the coordinate information corresponding to each piece of sub-information in the at least two pieces of sub-information according to the objective function;
  • the above-mentioned second obtaining module 13 includes: a second obtaining unit, a mapping unit, a third determining unit, and a fourth determining unit.
  • a second acquisition unit used for acquiring the curve corresponding to the objective function
  • mapping unit for mapping each piece of sub-information to the first coordinate of the target point on the curve corresponding to the target function
  • a third determining unit configured to determine the second coordinate of the target point on the curve corresponding to the objective function according to the first coordinate and the objective function;
  • the fourth determining unit is configured to determine the first coordinate and the second coordinate as coordinate information corresponding to each piece of sub-information.
  • the encryption module 14 is used for encrypting the coordinate information of the corresponding sub-information in the at least two pieces of sub-information by using the key corresponding to each piece of sub-information to obtain the ciphertext of the coordinate information corresponding to each of the sub-information;
  • the above encryption module 14 includes: a third acquisition unit, a fourth generation unit, and an encryption unit.
  • the third obtaining unit is used to obtain the block information of the target block in the blockchain network and the key corresponding to each piece of sub-information;
  • the target block is a block in the blockchain network
  • the block with the largest height, the block information of the target block includes at least one of the block height of the target block, the generation time stamp of the target block and the amount of information in the target block ;
  • the fourth generating unit for generating a private key according to the block information of the target block
  • the encryption unit is configured to encrypt the coordinate information corresponding to each piece of sub-information in the at least two pieces of sub-information according to the private key and the key corresponding to each piece of sub-information, and obtain the coordinate information corresponding to each piece of sub-information. ciphertext.
  • the coordinate information corresponding to each piece of sub-information is fused with the ciphertext of the corresponding candidate coordinates to obtain the ciphertext of the coordinate information corresponding to each piece of sub-information.
  • the storage module 15 is configured to determine the ciphertext of the coordinate information corresponding to each piece of sub-information as the ciphertext of the target information, and store the ciphertext of the target information in the blockchain network.
  • the key corresponding to each piece of sub-information is generated according to the attribute information of each piece of sub-information;
  • the coordinate information corresponding to each of the at least two pieces of sub-information is acquired according to the objective function.
  • the coordinate information of the corresponding sub-information in the at least two pieces of sub-information is encrypted, so as to obtain the ciphertext of the coordinate information corresponding to each of the sub-information; this is conducive to improving the target information It can prevent the target information from being leaked; at the same time, since the key corresponding to each of the above sub-information is only related to the sub-information itself, it is beneficial for the terminal to which the sub-information belongs to be able to quickly interpret the ciphertext of the coordinate information corresponding to the sub-information. Decryption is performed to improve the efficiency of decrypting information.
  • the ciphertext of the target information is stored in the blockchain network; the ciphertext of the target information can be effectively avoided.
  • the ciphertext of the target information is tampered with, and the target message cannot be decrypted according to the ciphertext of the target information, which improves the security of the target information.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device in the present application may also be called a computer device.
  • the electronic device may include a processor and memory.
  • the electronic device may further include a network interface, and the processor is connected to the memory and the network interface.
  • the network interface may include at least one of an input device and an output device, or 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. 6 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 is used to store a computer program including program instructions, and the processor 21 is used to execute the program instructions stored in the memory 24 for executing a An encryption method for generating keys based on attributes of information, i.e. for doing the following:
  • the target information includes at least two pieces of sub-information
  • the attribute information of each piece of sub-information includes the generation time of each piece of sub-information , at least one of the length of each piece of sub-information and the organization to which each piece of sub-information belongs;
  • the ciphertext of the coordinate information corresponding to each piece of sub-information is determined as the ciphertext of the target information, and the ciphertext of the target information is stored in the blockchain network.
  • the processor 21 is configured to execute the program instructions stored in the memory 24 to perform the following operations:
  • the processor 21 is configured to execute the program instructions stored in the memory 24 to perform the following operations:
  • Hash operation is performed on the random numbers corresponding to each piece of information respectively to obtain a key corresponding to each piece of sub-information.
  • the processor 21 is configured to execute the program instructions stored in the memory 24 to perform the following operations:
  • the generating of the key corresponding to each piece of sub-information according to the attribute information of each piece of sub-information includes:
  • each piece of sub-information determines the privacy level corresponding to each piece of sub-information
  • the key corresponding to each piece of sub-information is generated according to the random number corresponding to each piece of sub-information.
  • the processor 21 is configured to execute the program instructions stored in the memory 24 to perform the following operations:
  • the first coordinate and the second coordinate are determined as coordinate information corresponding to each piece of sub-information.
  • the processor 21 is configured to execute the program instructions stored in the memory 24 to perform the following operations:
  • the target block is the block with the largest block height in the blockchain network, so
  • the block information of the target block includes at least one of the block height of the target block, the generation time stamp of the target block and the amount of information in the target block;
  • the coordinate information corresponding to each piece of sub-information in the at least two pieces of sub-information is encrypted to obtain the ciphertext of the coordinate information corresponding to each piece of sub-information.
  • the processor 21 is configured to execute the program instructions stored in the memory 24 to perform the following operations:
  • the coordinate information corresponding to each piece of sub-information is fused with the ciphertext of the corresponding candidate coordinates to obtain the ciphertext of the coordinate information corresponding to each piece of sub-information.
  • the processor 21 , the input device 22 , and the output device 23 described in the embodiments of the present application may execute the implementations described in the embodiments of the encryption method for generating keys based on information attributes provided in the embodiments of the present application, and may also execute The implementation manner of the electronic device described in the embodiments of the present application will not be repeated here.
  • the key corresponding to each piece of sub-information is generated according to the attribute information of each piece of sub-information;
  • the coordinate information corresponding to each of the at least two pieces of sub-information is acquired according to the objective function.
  • the coordinate information of the corresponding sub-information in the at least two pieces of sub-information is encrypted, so as to obtain the ciphertext of the coordinate information corresponding to each of the sub-information; this is conducive to improving the target information It can prevent the target information from being leaked; at the same time, since the key corresponding to each of the above sub-information is only related to the sub-information itself, it is beneficial for the terminal to which the sub-information belongs to be able to quickly interpret the ciphertext of the coordinate information corresponding to the sub-information. Decryption is performed to improve the efficiency of decrypting information.
  • the ciphertext of the target information is stored in the blockchain network; the ciphertext of the target information can be effectively avoided.
  • the ciphertext of the target information is tampered with, and the target message cannot be decrypted according to the ciphertext of the target information, which improves the security 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. 4 Encryption methods for generating keys based on attributes of information 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 Card, etc.
  • 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 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.

Abstract

本申请实施例公开了一种基于信息的属性生成密钥的加密方法、装置及设备,涉及区块链技术以及药品管理技术。其中,该方法包括:获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息;采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。采用本申请,可以提高目标信息的安全性。

Description

基于信息的属性生成密钥的加密方法、装置及设备
本申请要求于2020年9月29日提交中国专利局、申请号为202011053176.5,发明名称为“基于信息的属性生成密钥的加密方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及区块链技术领域,尤其涉及一种基于信息的属性生成密钥的加密方法、装置及设备。
背景技术
目前,在网络行为已经渗透到社会生活每个领域的今天,无论是网上银行、电子商务还是电子邮件、即时信息服务,都会产生大量的信息,例如,在药品管理场景中,会产生大量用药信息、药品分配信息等等。发明人意识到,在现有技术中,一般将所产生的信息存储至终端本地,然而存储在终端本地的信息容易被非法用户篡改,从而带来很大的安全隐患,进而给用户带来不必要的损失。
发明内容
本申请实施例提供一种基于信息的属性生成密钥的加密方法、装置及设备,可以提高目标信息的安全性。
第一方面,本申请实施例提供了一种基于信息的属性生成密钥的加密方法,该方法包括:
获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;所述目标信息包括至少两条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间、所述每条子信息的长度以及所述每条子信息所属的机构中的至少一种;
根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;
根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息;
采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
第二方面,本申请实施例提供了一种基于信息的属性生成密钥的加密装置,该装置包括:
第一获取模块,用于获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;所述目标信息包括至少两条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间、所述每条子信息的长度以及所述每条子信息所属的机构中的至少一种;
生成模块,用于根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;
第二获取模块,用于根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息;
加密模块,用于采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
存储模块,用于将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
第三方面,本申请实施例提供了一种电子设备,该设备包括:处理器,适于实现一条或一条以上指令;以及,
计算机存储介质,所述计算机存储介质存储有一条或一条以上指令,所述一条或一条以上指令适于由所述处理器加载并执行如下步骤:
获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;所述目标信息包括至少两条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间、所述每条子信息的长度以及所述每条子信息所属的机构中的至少一种;
根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;
根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息;
采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
第四方面,本申请实施例提供了一种计算机可读存储介质,包括:所述计算机可读存储介质存储有一条或一条以上指令,所述一条或一条以上指令适于由处理器加载并执行如下步骤:
获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;所述目标信息包括至少两条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间、所述每条子信息的长度以及所述每条子信息所属的机构中的至少一种;
根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;
根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息;
采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
本申请实施例有利于提高目标信息的安全性,可避免目标信息被泄露。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1a是本申请实施例提供的一种基于信息的属性生成密钥的加密系统的架构示意图;
图1b是本申请实施例提供的一种数据共享系统的示意图;
图1c是本申请实施例提供的一种区链块的结构示意图;
图2是本申请实施例提供的一种基于信息的属性生成密钥的加密方法的流程示意图;
图3是本申请实施例提供的一种获取至少两条子信息中每条子信息对应的坐标信息方法的示意图;
图4是本申请实施例提供的另一种基于信息的属性生成密钥的加密方法的流程示意图;
图5是本申请实施例提供的一种基于信息的属性生成密钥的加密装置的结构示意图;
图6是本申请另一实施例提供的一种电子设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请可涉及人工智能技术领域,并可应用于数据加密场景,如基于区块链的数据加密场景。例如,可具体应用于数字医疗中的医疗数据加密场景,如区块链中可以存储医疗数据,该医疗数据可以包括个人健康档案、处方、检查报告等数据。进而可实现对该区块链中的医疗数据的加密处理,比如进行药品管理等等。
本申请所涉及的区块链是一种分布式数据存储、点对点传输(P2P传输)、共识机制、加密算法等计算机技术的新型应用模式,其本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层;区块链可由多个借由密码学串接并保护内容的串连交易记录(又称区块)构成,用区块链所串接的分布式账本能让多方有效纪录交易,且可永久查验此交易(不可篡改)。其中,共识机制是指区块链网络中实现不同节点之间建立信任、获取权益的数学算法;也就是说,共识机制是区块链各网络节点共同认可的一种数学算法。
本申请可以用于药品管理场景中,即上述目标信息可以是指医院的药品分配信息、患者的用药信息等等,通过对医院的药品分配信息、患者的用药信息进行加密,并将加密后的数据存储至区块链网络中,有利于实现对药品管理(如用药管理、药品分配),提高药品管理的安全性。
首先介绍本申请应用的基于信息的属性生成密钥的加密系统的架构,如图1a所示。该系统架构示意图包括区块链网络及多个终端,图1a中以包括三个终端为例,分别为第一终端、第二终端和第三终端。其中,第一终端、第二终端和第三终端可用于从区块链网络获取目标信息的密文,或者将目标信息的密文储存至区块链网络中。
其中,上述区块链网络可以是如图1b所示的区块链网络100,区块链网络100是指用于进行节点设备与节点设备之间数据共享的系统,该区块链网络中可以包括多个节点设备101,多个节点设备101可以是指区块链网络中各个客户端。每个节点设备101在进行正常工作可以接收到数据,并基于接收到的交易数据维护该区块链网络内的共享数据。为了保证区块链网络内的信息互通,区块链网络中的每个节点设备之间可以存在信息连接,节点设备之间可以通过上述信息连接进行信息传输。区块链网络中的每个节点设备均存储一条相同的区块链。区块链由多个区块组成,参见图1c,区块链由多个区块组成,创始块中包括区块头和区块主体,区块头中存储有数据特征值、版本号、时间戳和难度值,区块主体中存储有数据;创始块的下一区块以创始块为父区块,下一区块中同样包括区块头和区块主体,区块头中存储有当前区块的数据特征值、父区块的区块头特征值、版本号、时间戳和难度值,并以此类推,使得区块链中每个区块中存储的区块数据均与父区块中存储的区块数据存在关联,保证了区块中数据的安全性。
其中,区块链网络中的节点设备、第一终端、第二终端和第三终端可以为计算机设备,包括手机、平板电脑、笔记本电脑、掌上电脑、智能音响、移动互联网设备(MID,mobile internet device)、POS(Point Of Sales,销售点)机、可穿戴设备(例如智能手表、智能手环等)等;还可以是一台独立的服务器、或由若干台服务器组成的服务器集群、或云计算中心;还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。
请参见图2,为本申请实施例提供的一种基于信息的属性生成密钥的加密方法的流程示意图,本申请实施例由电子设备来执行,该一种基于信息的属性生成密钥的加密方法包括步骤S101~S104。
S101,获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息。
在本实施例中,目标信息包括至少两条子信息,如目标信息可以是指某机构的交易数据、营业数据等等。目标信息中每条子信息的属性信息包括每条子信息的生成时间、每条子信息的长度以及每条子信息所属的机构中的至少一种。其中,目标函数用于描述目标信息,即将目标信息转化成目标函数对应的坐标信息,以此提高目标信息的安全性。
可选的,目标函数可以是椭圆曲线算法,椭圆曲线算法是基于椭圆曲线数学理论实现的一种非对称加密算法。椭圆曲线算法的函数表达形式为y^2=x^3+ax+b,对于椭圆曲线上的任一点坐标(x,y)均满足y^2=x^3+ax+b,即可以根据已知的x计算出对应的y。因此,可以将目标信息转化为目标函数上的坐标信息,以此将目标信息存储至区块链网络中,以此增加对目标信息的保护。
S102,根据每条子信息的属性信息生成每条子信息对应的密钥。
其中,可以根据每条子信息的属性信息生成每条子信息对应的密钥,每条子信息的属性信息可以包括每条子信息的生成时间、每条子信息的长度以及每条子信息所属的机构中的至少一种。根据每条子信息的属性信息生成每条子信息对应的密钥,根据该密钥对目标信息进行加密,可以提高目标信息的安全性。
可选的,目标信息中每条子信息的属性信息包括每条子信息所属的机构;根据每条子信息所属的机构信息生成每条子信息对应的密钥的方法可以为:从区块链网络中获取每条子信息所属的机构所存储的信息的条数;根据每条子信息所属的机构所存储的信息的条数,确定每条子信息所属的机构的信用等级;分别对每条子信息所属的机构的信用等级进行哈希运算,得到每条子信息对应的密钥。
其中,可以从区块链网络中获取每条子信息所属的机构所储存的信息的条数,根据每条子信息所属的机构所储存的信息的条数,确定每条子信息所属的机构的信用等级。例如,若子信息所属的机构所储存的条数属于第一阈值范围内,则将该子信息所属的机构的信用等级确定为第一信用等级;若子信息所属的机构所储存的条数属于第二阈值范围内,则将该子信息所属的机构的信用等级确定为第二信用等级;若子信息所属的机构所储存的条数属于第三阈值范围内,则将该子信息所属的机构的信用等级确定为第三信用等级。子信息所属的机构所储存的信息的条数越多,则说明该子信息所属的机构的信用等级越高,如政府机构、教育机构、上市企业等等;子信息所属的机构所储存的信息的条数越少,则说明该子信息所属的机构的信用等级越低,如小型企业、微型企业等等。分别对每条子信息所属的机构的信用等级进行哈希算法,得到每条子信息对应的密钥。例如,某一子信息所属的机构的信用等级为K,则根据哈希函数对该子信息所属的机构的信用等级进行哈希运算,即hash(K)=K1,K1就是该子信息对应的密钥。
可选的,每条子信息的属性信息包括每条子信息的生成时间;根据每条子信息的生成时间生成每条子信息对应的密钥的方法可以为:根据每条子信息的生成时间,生成每条信息对应的随机数;分别对每条信息对应的随机数进行哈希运算,得到每条子信息对应的密钥。
其中,可以获取每条子信息的生成时间,根据每条子信息的生成时间生成每条子信息对应的随机数。然后分别对每条子信息对应的随机数进行哈希运算,得到每条子信息对应的密钥。例如可以调用C语言中的rand函数,它会根据某一条子信息的生成时间返回一个随机数P,然后对该子信息对应的随机数P进行哈希运算获得P1,即hash(P)=P1,将P1作为该子信息对应的密钥。
可选的,每条子信息的属性信息包括每条子信息的长度;根据每条子信息的属性信息生成每条子信息对应的密钥的方法可以为:根据每条子信息的长度,确定每条子信息对应的私密性等级;根据每条子信息对应的私密性等级生成每条子信息对应的随机数;根据每条子信息对应的随机数生成每条子信息对应的密钥。
其中,可以获取每条子信息的长度,根据每条子信息的长度确定每条子信息对应的私密性等级。同样的,若子信息的长度越长时,则说明该子信息的私密性等级越高;若子信息的长度越短,则说明该子信息的私密性等级越低。例如,可以当子信息的长度大于第一长度阈值时,将子信息的私密性等级设置为第一私密等级;当子信息的长度大于第二长度 阈值时,将子信息的私密性等级设置为第二私密等级。当某一子信息对应的私密等级为第二私密等级时,则根据该子信息对应的私密性等级生成该子信息对应的随机数M,将M作为该子信息对应的密钥。
可选的,可以获取目标信息中每条子信息的有效期限;根据目标信息中每条子信息的有效期限获取每条子信息的重要性等级,根据所述每条子信息的重要性等级生成随机数,根据所述随机数生成每条子信息对应的密钥。
同样的,若子信息的有效期越长,则说明该子信息越重要,对应的重要性等级越高;若子信息的有效期越短,则说明该子信息相对而言不是很重要,对应的重要性等级比较低。例如,某条信息的有效期为30天,以供更多的人可以获取信息,可以将该条子信息的重要性等级设置为第一等级;某条子信息的有效期为10天,可以将该信息的重要性等级设置为第二等级。根据子信息对应的重要性等级生成该子信息对应的随机数M,然后对随机数M进行哈希算法,获得该子信息对应的密钥。这样有利于提高目标信息的安全性,可避免目标信息被泄露;同时,由于上述每条子信息对应的密钥仅与子消息本身有关,这样有利于子信息所属的终端能够快速地对子信息对应的坐标信息的密文进行解密,提高对信息进行解密的效率。
S103,根据目标函数获取至少两条子信息中每条子信息对应的坐标信息。
在本实施例中,根据目标函数获取至少两个子信息中每个子信息对应的坐标信息,即将至少两条子信息中每条子信息转化为目标函数中对应的坐标信息。
其中,如图3所示,为本实施例提供的一种获取至少两条子信息中每条子信息对应的坐标信息方法的示意图,如图3所示,该获取至少两条子信息中每条子信息对应的坐标信息方法的示意图包括步骤S21-S24。
S21,获取目标函数对应的曲线。
其中,目标函数可以是椭圆曲线算法,椭圆曲线算法的函数表达形式为y^2=x^3+ax+b,对于椭圆曲线上的任一点坐标(x,y)均满足y^2=x^3+ax+b,即可以根据已知的x计算出对应的y。因此,可以将目标信息中至少两条子信息转化成椭圆曲线上的点坐标。可以获取目标函数对应的曲线,目标函数对应的曲线可以是prime256v1曲线、secp256r1曲线、nistp256曲线、secp256k1曲线等等。
S21,将每条子信息映射至目标函数对应的曲线上的目标点的第一坐标。
S21,根据第一坐标以及目标函数,确定目标函数对应的曲线上的目标点的第二坐标。
S21,将第一坐标以及第二坐标,确定为每条子信息对应的坐标信息。
将每条子信息映射至目标函数对应的曲线上每条子信息对应的目标点的第一坐标。根据第一坐标以及目标函数,确定目标函数上每条子信息对应的目标点的第二坐标,将第一坐标以及第二坐标确定为每条子信息对应的坐标信息。
例如,目标函数的曲线可以为secp256r1曲线,将某一条子信息映射至secp256r1曲线上对应的目标点的X1坐标,即将某一条子信息作为secp256r1曲线上的一个目标点的X1坐标。并将该条子信息对应的X1坐标带入secp256r1曲线的表达式中,获得该条子信息对应的Y1坐标。将X1坐标以及Y1坐标作为该子信息对应的坐标信息。
S104,采用每条子信息对应的密钥,对至少两条子信息中的对应子信息的坐标信息进行加密,得到每条子信息对应的坐标信息的密文。
S105,将每条子信息对应的坐标信息的密文确定为目标信息的密文,将目标信息的密文存储至区块链网络中。
采用每条子信息对应的密钥,对至少两条子信息中的对应子信息的坐标信息进行加密,得到每条子信息对应的坐标信息的密文。将至少两条子信息中每条子信息对应的坐标信息的密文确定为目标信息的密文,并将目标信息的密文存储至区块链网络中。
可选的,可以获取区块链网络中的目标区块的区块信息,以及每条子信息对应的密钥;目标区块为区块链网络中区块高度最大的区块,目标区块的区块信息包括目标区块的区块高度、目标区块的生成时间戳以及目标区块中的信息数量中的至少一种;根据目标区块的区块信息生成私钥;根据私钥以及每条子信息对应的密钥,对至少两条子信息中每条子信息对应的坐标信息进行加密,得到每条子信息对应的坐标信息的密文。
上述区块链网络为存储目标信息的密文的区块链网络,可以获取区块链网络中目标区块的区块信息,以及每条子信息对应的密钥。其中,目标区块可以为区块链网络中区块高度最大的区块,目标区块的区块信息包括目标区块的区块高度、目标区块的生成时间戳以及目标区块中的信息数量中的至少一种。根据目标区块的区块信息生成私钥。根据该私钥以及每条子信息对应的密钥,对至少两条子信息中每条子信息对应的坐标信息进行加密,得到每条子信息对应的坐标信息的密文。目标区块还可以是区块链网络中区块高度最小的区块,也可以是区块链网络中其他区块。
其中,可以获取目标区块的区块高度,根据目标区块的区块高度生成目标随机数,根据secp256k1算法对该目标随机数进行填充,生成私钥。也可以根据目标区块中信息数据确定该目标区块的重要性等级,对该目标区块的重要性等级进行哈希运算获得私钥。
得到目标信息中至少两条子信息中每条子信息对应的密文后,将每条子信息对应的密文确定为目标信息对应的密文,并将目标信息的密文储存至区块链网络中,增加目标信息的安全性,并节省存储空间。
本申请实施例中,通过获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息。通过采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;这样有利于提高目标信息的安全性,可避免目标信息被泄露;同时,由于上述每条子信息对应的密钥仅与子消息本身有关,这样有利于子信息所属的终端能够快速地对子信息对应的坐标信息的密文进行解密,提高对信息进行解密的效率。进一步,通过将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中;可有效避免将目标信息的密文存储至终端本地,导致目标信息的密文被篡改,导致不能根据目标信息的密文解密得到目标消息,提高目标信息的安全性。
如图4所示,为本实施例提供的另一种基于信息的属性生成密钥的加密方法的流程示意图,如图4所示,该另一种基于信息的属性生成密钥的加密方法的流程示意图包括步骤S201-S207。
S201,获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息。
S202,根据每条子信息的属性信息生成每条子信息对应的密钥。
S203,根据目标函数获取至少两条子信息中每条子信息对应的坐标信息。
其中,步骤S201-S203的具体内容可以参看图1的内容,在此不再累述。
S204,获取所述区块链网络中的目标区块的区块信息。
S205,根据目标区块的区块信息生成私钥。
上述区块链网络为存储目标信息的密文的区块链网络,可以获取区块链网络中目标区块的区块信息,以及每条子信息对应的密钥。其中,目标区块可以为区块链网络中区块高度最大的区块,目标区块的区块信息包括目标区块的区块高度、目标区块的生成时间戳以及目标区块中的信息数量中的至少一种。根据目标区块的区块信息生成私钥。根据该私钥以及每条子信息对应的密钥,对至少两条子信息中每条子信息对应的坐标信息进行加密, 得到每条子信息对应的坐标信息的密文。目标区块还可以是区块链网络中区块高度最小的区块,也可以是区块链网络中其他区块。
其中,可以获取目标区块的区块高度,根据目标区块的区块高度生成目标随机数,根据该目标随机数成生成私钥。也可以根据目标区块中信息数量确定该目标区块的重要性等级,对该目标区块的重要性等级进行哈希运算获得私钥。
可选的,也可以获取目标信息对应的终端设备的属性信息,终端设备的属性信息可以包括该终端设备的版本号、该终端设备的用户信息等等。根据该终端设备的属性信息生成私钥。
S206,根据私钥以及每条子信息对应的密钥,对至少两条子信息中每条子信息对应的坐标信息进行加密,得到每条子信息对应的坐标信息的密文。
S207,将每条子信息对应的坐标信息的密文确定为目标信息的密文,将目标信息的密文存储至区块链网络中。
根据目标区块的区块信息生成私钥,根据该私钥以及每条子信息对应的密钥,对每条子信息对应的坐标信息进行加密,获得每条子信息对应的坐标信息的密文。
可选的,可以获取目标函数的曲线的基点坐标;获取基点坐标与上述私钥的乘积,得到候选坐标;根据每条子信息对应的密钥对候选坐标进行加密,得到候选坐标的密文;对每条子信息对应的坐标信息与对应的候选坐标的密文进行融合,得到每条子信息对应的坐标信息的密文。
获取目标函数对应的曲线后,再获取目标函数对应的曲线的基点坐标,将目标函数对应的曲线的基点坐标与上述私钥相乘,获得候选坐标。在将每条子信息对应的密钥对候选坐标进行加密,得到候选坐标的密文。将每条子信息对应的坐标信息与对应的候选坐标的密文进行融合,得到每条子信息对应的坐标信息的密文。
例如,根据目标区块的区块信息获得私钥Q。获取目标函数对应的曲线为secp256r1曲线,获取该secp256r1曲线的基点坐标G(Xg,Yg),将上述私钥Q与该基点坐标做乘积,获得候选坐标H,该候选坐标H=G*Q。根据每条子信息对应的密钥Ki对候选坐标H进行加密,得到该候选坐标的密文P1,P1可以等于每条子信息对应的密钥Ki与候选坐标的乘积,即P1=Ki*H。获取某一子信息对应的坐标信息为P2(X1,Y1)后,对该条子信息对应的坐标信息P2(X1,Y1)与对应的候选坐标的密文P1进行融合,得到该条子信息对应的坐标信息的密文C1。例如,可以将该条子信息对应的坐标信息P2(X1,Y1)与对应的候选坐标的密文P1相加,获得该条子信息对应的坐标信息的密文C1,即C1=P2+P1。以此对目标信息中每条子信息对应的坐标进行加密,获得每条子信息对应的坐标信息的密文,得到目标信息中至少两条子信息中每条子信息对应的密文后,将每条子信息对应的密文确定为目标信息对应的密文,并将目标信息的密文储存至区块链网络中,避免目标信息的密文存储至终端本地存在被篡改的风险,提高目标信息的安全性,并节省存储空间。
本申请实施例中,通过获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息。通过采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;这样有利于提高目标信息的安全性,可避免目标信息被泄露;同时,由于上述每条子信息对应的密钥仅与子消息本身有关,这样有利于子信息所属的终端能够快速地对子信息对应的坐标信息的密文进行解密,提高对信息进行解密的效率。进一步,通过将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中;可有效避免将目标信息的密文存储至终端本地,导致目标信息的密文被篡改,导致不能根据目标信息的密文解密得到目标消息, 提高目标信息的安全性。
请参见图5,是本申请实施例提供的一种基于信息的属性生成密钥的加密装置的结构示意图,本申请实施例的所述装置可以在上述提及的电子设备中。本实施例中,该基于信息的属性生成密钥的加密装置包括以:
第一获取模块11,用于获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;所述目标信息包括至少两条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间、所述每条子信息的长度以及所述每条子信息所属的机构中的至少一种;
生成模块12,用于根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;
上述生成模块12包括:第一获取单元、第一确定单元、第一运算单元。
第一获取单元,用于从所述区块链网络中获取所述每条子信息所属的机构所存储的信息的条数;
第一确定单元,用于根据所述每条子信息所属的机构所存储的信息的条数,确定所述每条子信息所属的机构的信用等级;
第一运算单元,用于分别对所述每条子信息所属的机构的信用等级进行哈希运算,得到所述每条子信息对应的密钥。
其中,所述每条子信息的属性信息包括所述每条子信息的生成时间;
上述生成模块12还包括:第一生成单元、第二运算单元。
第一生成单元,用于根据所述每条子信息的生成时间,生成所述每条信息对应的随机数;
第二运算单元,用于分别对所述每条信息对应的随机数进行哈希运算,得到所述每条子信息对应的密钥。
其中,所述每条子信息的属性信息包括所述每条子信息的长度;
上述生成模块12还包括:第二确定单元、第二生成单元、第三生成单元。
第二确定单元,用于根据所述每条子信息的长度,确定所述每条子信息对应的私密性等级;
第二生成单元,用于根据所述每条子信息对应的私密性等级生成所述每条子信息对应的随机数;
第三生成单元,用于根据所述每条子信息对应的随机数生成所述每条子信息对应的密钥。
第二获取模块13,用于根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息;
其中,上述第二获取模块13包括:第二获取单元、映射单元、第三确定单元、第四确定单元。
第二获取单元,用于获取所述目标函数对应的曲线;
映射单元,用于将所述每条子信息映射至所述目标函数对应的曲线上的目标点的第一坐标;
第三确定单元,用于根据所述第一坐标以及所述目标函数,确定所述目标函数对应的曲线上的目标点的第二坐标;
第四确定单元,用于将所述第一坐标以及所述第二坐标,确定为所述每条子信息对应的坐标信息。
加密模块14,用于采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
其中,上述加密模块14包括:第三获取单元、第四生成单元、加密单元。
第三获取单元,用于获取所述区块链网络中的目标区块的区块信息,以及所述每条子信息对应的密钥;所述目标区块为所述区块链网络中区块高度最大的区块,所述目标区块的区块信息包括所述目标区块的区块高度、所述目标区块的生成时间戳以及所述目标区块中的信息数量中的至少一种;
第四生成单元,用于根据所述目标区块的区块信息生成私钥;
加密单元,用于根据所述私钥以及所述每条子信息对应的密钥,对所述至少两条子信息中每条子信息对应的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文。
其中,上述加密单元具体用于:
获取所述目标函数的曲线的基点坐标;
获取所述基点坐标与所述私钥的乘积,得到候选坐标;
根据所述每条子信息对应的密钥对所述候选坐标进行加密,得到所述候选坐标的密文;
对所述每条子信息对应的坐标信息与对应的候选坐标的密文进行融合,得到所述每条子信息对应的坐标信息的密文。
存储模块15,用于将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
本实施例中的具体内容可以参看图1或者图3中的内容,在此不再累述。
本申请实施例中,通过获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息。通过采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;这样有利于提高目标信息的安全性,可避免目标信息被泄露;同时,由于上述每条子信息对应的密钥仅与子消息本身有关,这样有利于子信息所属的终端能够快速地对子信息对应的坐标信息的密文进行解密,提高对信息进行解密的效率。进一步,通过将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中;可有效避免将目标信息的密文存储至终端本地,导致目标信息的密文被篡改,导致不能根据目标信息的密文解密得到目标消息,提高目标信息的安全性。
请参见图6,是本申请实施例提供的一种电子设备的结构示意图,本申请的电子设备还可以叫做计算机设备。该电子设备可包括处理器和存储器。可选的,该电子设备还可以包括网络接口,处理器与存储器、网络接口相连。进一步可选的,该网络接口可以包括输入装置和输出装置中的至少一种,或者,该电子设备还可包括输入装置和输出装置中的至少一种。例如,如图6所示的本实施例中的电子设备可以包括:一个或多个处理器21;一个或多个输入装置22,一个或多个输出装置23和存储器24。上述处理器21、输入装置22、输出装置23和存储器24通过总线25连接。
所处理器21可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
输入装置22可以包括触控板、指纹采传感器(用于采集用户的指纹信息和指纹的方向信息)、麦克风等,输出装置23可以包括显示器(LCD等)、扬声器等,输出装置23可以输出校正处理后的数据表。
该存储器24可以包括只读存储器和随机存取存储器,并向处理器21提供指令和数据。存储器24的一部分还可以包括非易失性随机存取存储器,存储器24用于存储计算机程序, 所述计算机程序包括程序指令,处理器21用于执行存储器24存储的程序指令,以用于执行一种基于信息的属性生成密钥的加密方法,即用于执行以下操作:
获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;所述目标信息包括至少两条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间、所述每条子信息的长度以及所述每条子信息所属的机构中的至少一种;
根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;
根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息;
采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:
从所述区块链网络中获取所述每条子信息所属的机构所存储的信息的条数;
根据所述每条子信息所属的机构所存储的信息的条数,确定所述每条子信息所属的机构的信用等级;
分别对所述每条子信息所属的机构的信用等级进行哈希运算,得到所述每条子信息对应的密钥。
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:
根据所述每条子信息的生成时间,生成所述每条信息对应的随机数;
分别对所述每条信息对应的随机数进行哈希运算,得到所述每条子信息对应的密钥。
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:
所述根据所述每条子信息的属性信息生成所述每条子信息对应的密钥,包括:
根据所述每条子信息的长度,确定所述每条子信息对应的私密性等级;
根据所述每条子信息对应的私密性等级生成所述每条子信息对应的随机数;
根据所述每条子信息对应的随机数生成所述每条子信息对应的密钥。
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:
获取所述目标函数对应的曲线;
将所述每条子信息映射至所述目标函数对应的曲线上的目标点的第一坐标;
根据所述第一坐标以及所述目标函数,确定所述目标函数对应的曲线上的目标点的第二坐标;
将所述第一坐标以及所述第二坐标,确定为所述每条子信息对应的坐标信息。
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:
获取所述区块链网络中的目标区块的区块信息,以及所述每条子信息对应的密钥;所述目标区块为所述区块链网络中区块高度最大的区块,所述目标区块的区块信息包括所述目标区块的区块高度、所述目标区块的生成时间戳以及所述目标区块中的信息数量中的至少一种;
根据所述目标区块的区块信息生成私钥;
根据所述私钥以及所述每条子信息对应的密钥,对所述至少两条子信息中每条子信息对应的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文。
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:
获取所述目标函数的曲线的基点坐标;
获取所述基点坐标与所述私钥的乘积,得到候选坐标;
根据所述每条子信息对应的密钥对所述候选坐标进行加密,得到所述候选坐标的密文;
对所述每条子信息对应的坐标信息与对应的候选坐标的密文进行融合,得到所述每条 子信息对应的坐标信息的密文。
本申请实施例中所描述的处理器21、输入装置22、输出装置23可执行本申请实施例提供的基于信息的属性生成密钥的加密方法的实施例中所描述的实现方式,也可执行本申请实施例所描述的电子设备的实现方式,在此不再赘述。
本申请实施例中,通过获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息。通过采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;这样有利于提高目标信息的安全性,可避免目标信息被泄露;同时,由于上述每条子信息对应的密钥仅与子消息本身有关,这样有利于子信息所属的终端能够快速地对子信息对应的坐标信息的密文进行解密,提高对信息进行解密的效率。进一步,通过将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中;可有效避免将目标信息的密文存储至终端本地,导致目标信息的密文被篡改,导致不能根据目标信息的密文解密得到目标消息,提高目标信息的安全性。
本申请实施例中还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时实现如图2及图4实施例中所示的基于信息的属性生成密钥的加密方法。
可选的,本申请涉及的存储介质可以为可读存储介质,本申请涉及的存储介质如计算机可读存储介质可以是非易失性的,也可以是易失性的。
所述计算机可读存储介质可以是前述任一实施例所述的电子设备的内部存储单元,例如电子设备的硬盘或内存。所述计算机可读存储介质也可以是所述电子设备的外部存储设备,例如所述电子设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述计算机可读存储介质还可以既包括所述电子设备的内部存储单元也包括外部存储设备。所述计算机可读存储介质用于存储所述计算机程序以及所述电子设备所需的其他程序和数据。所述计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的数据。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的电子设备和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的电子设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例是示意性的,例如,所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种基于信息的属性生成密钥的加密方法,包括:
    获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;所述目标信息包括至少两条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间、所述每条子信息的长度以及所述每条子信息所属的机构中的至少一种;
    根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;
    根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息;
    采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
    将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
  2. 根据权利要求1所述的方法,其中,所述每条子信息的属性信息包括所述每条子信息所属的机构;
    所述根据所述每条子信息的属性信息生成所述每条子信息对应的密钥,包括:
    从所述区块链网络中获取所述每条子信息所属的机构所存储的信息的条数;
    根据所述每条子信息所属的机构所存储的信息的条数,确定所述每条子信息所属的机构的信用等级;
    分别对所述每条子信息所属的机构的信用等级进行哈希运算,得到所述每条子信息对应的密钥。
  3. 根据权利要求1所述的方法,其中,所述每条子信息的属性信息包括所述每条子信息的生成时间;
    所述根据所述每条子信息的属性信息生成所述每条子信息对应的密钥,包括:
    根据所述每条子信息的生成时间,生成所述每条信息对应的随机数;
    分别对所述每条信息对应的随机数进行哈希运算,得到所述每条子信息对应的密钥。
  4. 根据权利要求1所述的方法,其中,所述每条子信息的属性信息包括所述每条子信息的长度;
    所述根据所述每条子信息的属性信息生成所述每条子信息对应的密钥,包括:
    根据所述每条子信息的长度,确定所述每条子信息对应的私密性等级;
    根据所述每条子信息对应的私密性等级生成所述每条子信息对应的随机数;
    根据所述每条子信息对应的随机数生成所述每条子信息对应的密钥。
  5. 根据权利要求1所述的方法,其中,所述根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息,包括:
    获取所述目标函数对应的曲线;
    将所述每条子信息映射至所述目标函数对应的曲线上的目标点的第一坐标;
    根据所述第一坐标以及所述目标函数,确定所述目标函数对应的曲线上的目标点的第二坐标;
    将所述第一坐标以及所述第二坐标,确定为所述每条子信息对应的坐标信息。
  6. 根据权利要求1所述的方法,其中,所述对所述至少两条子信息中每条子信息对应的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文,包括:
    获取所述区块链网络中的目标区块的区块信息,以及所述每条子信息对应的密钥;所述目标区块为所述区块链网络中区块高度最大的区块,所述目标区块的区块信息包括所述目标区块的区块高度、所述目标区块的生成时间戳以及所述目标区块中的信息数量中的至少一种;
    根据所述目标区块的区块信息生成私钥;
    根据所述私钥以及所述每条子信息对应的密钥,对所述至少两条子信息中每条子信息对应的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文。
  7. 根据权利要求6所述的方法,其中,所述根据所述私钥以及所述每条子信息对应的密钥,对所述至少两条子信息中每条子信息对应的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文,包括:
    获取所述目标函数的曲线的基点坐标;
    获取所述基点坐标与所述私钥的乘积,得到候选坐标;
    根据所述每条子信息对应的密钥对所述候选坐标进行加密,得到所述候选坐标的密文;
    对所述每条子信息对应的坐标信息与对应的候选坐标的密文进行融合,得到所述每条子信息对应的坐标信息的密文。
  8. 一种基于信息的属性生成密钥的加密装置,包括:
    第一获取模块,用于获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;所述目标信息包括多条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间、所述每条子信息的长度以及所述每条子信息所属的机构中的至少一种;
    生成模块,用于根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;
    第二获取模块,用于根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息;
    加密模块,用于采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
    存储模块,用于将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
  9. 一种计算机设备,包括:处理器、存储器以及网络接口;
    所述处理器与存储器、网络接口相连,其中,网络接口用于提供数据通信功能,所述存储器用于存储程序代码,所述处理器用于调用所述程序代码,以执行以下方法:
    获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;所述目标信息包括至少两条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间、所述每条子信息的长度以及所述每条子信息所属的机构中的至少一种;
    根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;
    根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息;
    采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
    将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
  10. 根据权利要求9所述的计算机设备,其中,所述每条子信息的属性信息包括所述每条子信息所属的机构;
    执行所述根据所述每条子信息的属性信息生成所述每条子信息对应的密钥,包括:
    从所述区块链网络中获取所述每条子信息所属的机构所存储的信息的条数;
    根据所述每条子信息所属的机构所存储的信息的条数,确定所述每条子信息所属的机构的信用等级;
    分别对所述每条子信息所属的机构的信用等级进行哈希运算,得到所述每条子信息对应的密钥。
  11. 根据权利要求9所述的计算机设备,其中,所述每条子信息的属性信息包括所述每条子信息的生成时间;
    执行所述根据所述每条子信息的属性信息生成所述每条子信息对应的密钥,包括:
    根据所述每条子信息的生成时间,生成所述每条信息对应的随机数;
    分别对所述每条信息对应的随机数进行哈希运算,得到所述每条子信息对应的密钥。
  12. 根据权利要求9所述的计算机设备,其中,所述每条子信息的属性信息包括所述每条子信息的长度;
    执行所述根据所述每条子信息的属性信息生成所述每条子信息对应的密钥,包括:
    根据所述每条子信息的长度,确定所述每条子信息对应的私密性等级;
    根据所述每条子信息对应的私密性等级生成所述每条子信息对应的随机数;
    根据所述每条子信息对应的随机数生成所述每条子信息对应的密钥。
  13. 根据权利要求9所述的计算机设备,其中,执行所述根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息,包括:
    获取所述目标函数对应的曲线;
    将所述每条子信息映射至所述目标函数对应的曲线上的目标点的第一坐标;
    根据所述第一坐标以及所述目标函数,确定所述目标函数对应的曲线上的目标点的第二坐标;
    将所述第一坐标以及所述第二坐标,确定为所述每条子信息对应的坐标信息。
  14. 根据权利要求9所述的计算机设备,其中,执行所述对所述至少两条子信息中每条子信息对应的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文,包括:
    获取所述区块链网络中的目标区块的区块信息,以及所述每条子信息对应的密钥;所述目标区块为所述区块链网络中区块高度最大的区块,所述目标区块的区块信息包括所述目标区块的区块高度、所述目标区块的生成时间戳以及所述目标区块中的信息数量中的至少一种;
    根据所述目标区块的区块信息生成私钥;
    根据所述私钥以及所述每条子信息对应的密钥,对所述至少两条子信息中每条子信息对应的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文。
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时,执行以下方法:
    获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息;所述目标信息包括至少两条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间、所述每条子信息的长度以及所述每条子信息所属的机构中的至少一种;
    根据所述每条子信息的属性信息生成所述每条子信息对应的密钥;
    根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息;
    采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
    将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
  16. 根据权利要求15所述的计算机可读存储介质,其中,所述每条子信息的属性信息包括所述每条子信息所属的机构;
    执行所述根据所述每条子信息的属性信息生成所述每条子信息对应的密钥,包括:
    从所述区块链网络中获取所述每条子信息所属的机构所存储的信息的条数;
    根据所述每条子信息所属的机构所存储的信息的条数,确定所述每条子信息所属的机构的信用等级;
    分别对所述每条子信息所属的机构的信用等级进行哈希运算,得到所述每条子信息对应的密钥。
  17. 根据权利要求15所述的计算机可读存储介质,其中,所述每条子信息的属性信息包括所述每条子信息的生成时间;
    执行所述根据所述每条子信息的属性信息生成所述每条子信息对应的密钥,包括:
    根据所述每条子信息的生成时间,生成所述每条信息对应的随机数;
    分别对所述每条信息对应的随机数进行哈希运算,得到所述每条子信息对应的密钥。
  18. 根据权利要求15所述的计算机可读存储介质,其中,所述每条子信息的属性信息包括所述每条子信息的长度;
    执行所述根据所述每条子信息的属性信息生成所述每条子信息对应的密钥,包括:
    根据所述每条子信息的长度,确定所述每条子信息对应的私密性等级;
    根据所述每条子信息对应的私密性等级生成所述每条子信息对应的随机数;
    根据所述每条子信息对应的随机数生成所述每条子信息对应的密钥。
  19. 根据权利要求15所述的计算机可读存储介质,其中,执行所述根据所述目标函数获取所述至少两条子信息中每条子信息对应的坐标信息,包括:
    获取所述目标函数对应的曲线;
    将所述每条子信息映射至所述目标函数对应的曲线上的目标点的第一坐标;
    根据所述第一坐标以及所述目标函数,确定所述目标函数对应的曲线上的目标点的第二坐标;
    将所述第一坐标以及所述第二坐标,确定为所述每条子信息对应的坐标信息。
  20. 根据权利要求15所述的计算机可读存储介质,其中,执行所述对所述至少两条子信息中每条子信息对应的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文,包括:
    获取所述区块链网络中的目标区块的区块信息,以及所述每条子信息对应的密钥;所述目标区块为所述区块链网络中区块高度最大的区块,所述目标区块的区块信息包括所述目标区块的区块高度、所述目标区块的生成时间戳以及所述目标区块中的信息数量中的至少一种;
    根据所述目标区块的区块信息生成私钥;
    根据所述私钥以及所述每条子信息对应的密钥,对所述至少两条子信息中每条子信息对应的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文。
PCT/CN2021/109258 2020-09-29 2021-07-29 基于信息的属性生成密钥的加密方法、装置及设备 WO2022068358A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011053176.5A CN112069525A (zh) 2020-09-29 2020-09-29 基于信息的属性生成密钥的加密方法、装置及设备
CN202011053176.5 2020-09-29

Publications (1)

Publication Number Publication Date
WO2022068358A1 true WO2022068358A1 (zh) 2022-04-07

Family

ID=73684167

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/109258 WO2022068358A1 (zh) 2020-09-29 2021-07-29 基于信息的属性生成密钥的加密方法、装置及设备

Country Status (2)

Country Link
CN (1) CN112069525A (zh)
WO (1) WO2022068358A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112069525A (zh) * 2020-09-29 2020-12-11 深圳壹账通智能科技有限公司 基于信息的属性生成密钥的加密方法、装置及设备
CN112131593A (zh) * 2020-09-29 2020-12-25 深圳壹账通智能科技有限公司 基于信息的特征的加密方法、装置、设备及储存介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110336669A (zh) * 2019-07-02 2019-10-15 北京瑞卓喜投科技发展有限公司 一种信息的加密方法、装置及电子设备
CN111488372A (zh) * 2020-04-09 2020-08-04 腾讯科技(深圳)有限公司 一种数据处理方法、设备及存储介质
CN112069525A (zh) * 2020-09-29 2020-12-11 深圳壹账通智能科技有限公司 基于信息的属性生成密钥的加密方法、装置及设备
CN112202779A (zh) * 2020-09-29 2021-01-08 深圳壹账通智能科技有限公司 基于区块链的信息加密方法、装置、设备及介质
CN112202555A (zh) * 2020-09-29 2021-01-08 平安科技(深圳)有限公司 基于信息的属性生成随机数的信息处理方法、装置及设备
CN112202554A (zh) * 2020-09-29 2021-01-08 平安科技(深圳)有限公司 基于信息的属性生成密钥的信息处理方法、装置及设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110336669A (zh) * 2019-07-02 2019-10-15 北京瑞卓喜投科技发展有限公司 一种信息的加密方法、装置及电子设备
CN111488372A (zh) * 2020-04-09 2020-08-04 腾讯科技(深圳)有限公司 一种数据处理方法、设备及存储介质
CN112069525A (zh) * 2020-09-29 2020-12-11 深圳壹账通智能科技有限公司 基于信息的属性生成密钥的加密方法、装置及设备
CN112202779A (zh) * 2020-09-29 2021-01-08 深圳壹账通智能科技有限公司 基于区块链的信息加密方法、装置、设备及介质
CN112202555A (zh) * 2020-09-29 2021-01-08 平安科技(深圳)有限公司 基于信息的属性生成随机数的信息处理方法、装置及设备
CN112202554A (zh) * 2020-09-29 2021-01-08 平安科技(深圳)有限公司 基于信息的属性生成密钥的信息处理方法、装置及设备

Also Published As

Publication number Publication date
CN112069525A (zh) 2020-12-11

Similar Documents

Publication Publication Date Title
Jayabalan et al. Scalable blockchain model using off-chain IPFS storage for healthcare data security and privacy
Dilawar et al. Blockchain: securing internet of medical things (IoMT)
US10880077B2 (en) Processing blockchain data based on smart contract operations executed in a trusted execution environment
US10839070B1 (en) Securely executing smart contract operations in a trusted execution environment
JP6892513B2 (ja) 信頼できる実行環境に基づいたオフチェーンスマートコントラクトサービス
US9158925B2 (en) Server-aided private set intersection (PSI) with data transfer
Hardin et al. Amanuensis: Information provenance for health-data systems
Bhatia et al. Towards a secure incremental proxy re‐encryption for e‐healthcare data sharing in mobile cloud computing
Nagaraju et al. Trusted framework for online banking in public cloud using multi-factor authentication and privacy protection gateway
CN108989047A (zh) 一种基于sm2算法的通信双方协同签名方法与系统
WO2022068355A1 (zh) 基于信息的特征的加密方法、装置、设备及储存介质
CN112202554B (zh) 基于信息的属性生成密钥的信息处理方法、装置及设备
WO2022068360A1 (zh) 基于共享根密钥的信息处理方法、装置、设备及介质
WO2022068236A1 (zh) 基于信息的特征进行信息处理的方法、装置、设备及介质
WO2022068358A1 (zh) 基于信息的属性生成密钥的加密方法、装置及设备
WO2022068356A1 (zh) 基于区块链的信息加密方法、装置、设备及介质
Tang et al. A secure and trustworthy medical record sharing scheme based on searchable encryption and blockchain
WO2022068359A1 (zh) 对信息的密文进行压缩的加密方法、装置、设备及介质
WO2022068234A1 (zh) 基于共享根密钥的加密方法、装置、设备及介质
Chen et al. Blockchain for health IoT: a privacy‐preserving data sharing system
WO2022068235A1 (zh) 基于信息的属性生成随机数的信息处理方法、装置及设备
Sun et al. MedRSS: A blockchain-based scheme for secure storage and sharing of medical records
Yao et al. A multi-dimension traceable privacy-preserving prevention and control scheme of the COVID-19 epidemic based on blockchain
WO2022068361A1 (zh) 基于修正量的加密方法、装置、设备及介质
Li et al. Privacy protection for medical image management based on blockchain

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: 21874020

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: 21874020

Country of ref document: EP

Kind code of ref document: A1