WO2022068235A1 - 基于信息的属性生成随机数的信息处理方法、装置及设备 - Google Patents

基于信息的属性生成随机数的信息处理方法、装置及设备 Download PDF

Info

Publication number
WO2022068235A1
WO2022068235A1 PCT/CN2021/097118 CN2021097118W WO2022068235A1 WO 2022068235 A1 WO2022068235 A1 WO 2022068235A1 CN 2021097118 W CN2021097118 W CN 2021097118W WO 2022068235 A1 WO2022068235 A1 WO 2022068235A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
sub
piece
random number
key
Prior art date
Application number
PCT/CN2021/097118
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 WO2022068235A1 publication Critical patent/WO2022068235A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords

Definitions

  • the present application relates to the field of blockchain technology, and in particular, to an information processing method, apparatus and device for generating random numbers based on attributes of information.
  • the traditional information storage method is generally the local storage of the terminal.
  • the medical platform will use the terminal to store each patient's medical record information, patient information and other information locally on the terminal.
  • Risks, illegal terminals can easily obtain locally stored information, leading to information leakage, and illegal users can tamper with locally stored information, resulting in low information security, and when the local storage fails, the information cannot be found. back, resulting in losses. Therefore, how to ensure the security of information in the process of information storage and prevent information leakage is an urgent problem to be solved.
  • the embodiments of the present application provide an information processing method, device and device for generating random numbers based on attributes of information, which can encrypt information, improve information security, and prevent information leakage.
  • an embodiment of the present application provides an information processing method for generating random numbers based on attributes of information, including:
  • 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 and the time of each piece of sub-information. at least one of the lengths of the sliver information;
  • each piece of adjusted sub-information obtain coordinate information corresponding to each of the at least two pieces of sub-information
  • 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 information processing apparatus for generating random numbers based on attributes of information, including:
  • the information acquisition module is used to acquire the objective function used to describe the 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 the each piece of sub-information At least one of the generation time and the length of each piece of sub-information;
  • a key generation module for generating a root key corresponding to the target information according to the user information contained in the target information, and generating a key corresponding to each piece of sub-information according to the root key;
  • an information adjustment module configured to generate a first random number corresponding to each piece of sub-information according to the attribute information of each piece of sub-information, adjust each piece of sub-information according to the first random number, and obtain each piece of adjusted sub-information;
  • a coordinate obtaining module configured to obtain coordinate information corresponding to each piece of sub-information in the at least two pieces of sub-information according to the objective function and each piece of adjusted sub-information;
  • an information 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 sub-information, and obtain the ciphertext of the coordinate information corresponding to each sub-information;
  • the information 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.
  • One aspect of the present application provides a computer device, including: a processor, a memory, and a network interface;
  • the above-mentioned processor is connected to a memory and a network interface, wherein the network interface is used to provide a data communication function, the above-mentioned memory is used to store a computer program, and the above-mentioned processor is used to call the above-mentioned computer program to execute the following method:
  • each piece of adjusted sub-information obtain coordinate information corresponding to each piece of sub-information in the at least two pieces of sub-information
  • 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 aspect of an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, the computer program includes program instructions, and when executed by a processor, the program instructions cause the processor to execute the following method :
  • each piece of adjusted sub-information obtain coordinate information corresponding to each piece of sub-information in the at least two pieces of sub-information
  • 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 security of the information can be improved based on the characteristics that the blockchain cannot be tampered with and is not easily lost;
  • the resource occupation of the local storage space of the terminal can be reduced.
  • FIG. 1 is a schematic flowchart of an information processing method for generating random numbers based on attributes of information provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a method for adjusting each piece of sub-information provided by an embodiment of the present application
  • FIG. 3 is a schematic flowchart of an information processing method for generating random numbers based on attributes of information provided by an embodiment of the present application
  • FIG. 4 is a schematic diagram of the composition and structure of an information processing apparatus for generating random numbers based on attributes of information provided by an embodiment of the present application;
  • FIG. 5 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the technical solution of the present application may relate to the technical field of blockchain, for example, the data involved in the present application, such as the ciphertext of feature information and/or target information, etc., may be stored in the blockchain.
  • the present application can be applied to scenarios such as financial technology such as encrypting financial data, and can also be applied to scenarios such as digital medical treatment such as encrypting patient information to improve information security.
  • 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.
  • the target information can be, for example, the patient's medical record information, patient information, etc., by encrypting the patient's medical record information, patient information and other information of the medical platform, and storing the encrypted information in the In the blockchain network, it is beneficial to manage the patient's medical record information, patient information, etc., and improve the security of the patient's information.
  • FIG. 1 is a schematic flowchart of an information processing method for generating random numbers based on attributes of information provided by an embodiment of the present application.
  • the method is applied to a node in a blockchain network, and the node may be an independent one.
  • a physical server can also be a server cluster or distributed system composed of multiple physical servers, and can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, and 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
  • the node may refer to computer equipment, including mobile phones, tablet computers, notebook computers, PDAs, smart speakers, mobile internet devices (MID, mobile internet device), POS (Point Of Sales, point of sale) machines, wearable devices (such as smart watches, smart bracelets, etc.)
  • the method includes:
  • 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 objective function may refer to a function corresponding to an elliptic curve, and the objective function may also refer to a function corresponding to other curves.
  • the target information includes at least two pieces of sub-information, and the target information may refer to data such as transaction data, business data, and internal data 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 and the length of each piece of sub-information.
  • 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.
  • S102 Generate a root key corresponding to the target information according to the user information included in the target information, and generate a key corresponding to each piece of sub-information according to the root key.
  • the target information includes first sub-information and second sub-information, and the generation time of the second sub-information is later than the generation time of the first sub-information.
  • the user information may include, for example, a user name, a user number, an institution code of an institution to which the user belongs, and the like. If the target information contains only one user information, the root key corresponding to the target information is generated according to the one user information; if the target information only contains multiple user information, the root key corresponding to the target information is generated according to the multiple user information, That is, the root key corresponding to the target information is generated according to any one user information or any plurality of user information in the plurality of user information.
  • the method for generating the root key corresponding to the target information according to the user information included in the target information includes: encoding the user information to obtain encoded user data; and generating a fourth random number according to the encoded user data; A hash operation is performed on the fourth random number to obtain the root key corresponding to the target information.
  • the computer equipment obtains the user information contained in the target information, encodes the user information, obtains the encoded user data, then calls the rand function in the C language, and returns a random number according to the encoded user data, that is, the first Four random numbers, the computer device obtains the root key corresponding to the target information by performing a hash operation on the fourth random number.
  • random number generation algorithms can also be used to generate the fourth random number, such as the central limit theorem and Box Muller (coordinate transformation method), Monte Carlo algorithm, numerical probability algorithm, Las Vegas algorithm, or other random numbers.
  • Generation algorithm The encoded user data is obtained by encoding the user information, and a fourth random number is generated according to the encoded user data. Since the root key corresponding to the target information is obtained after the fourth random number is hashed, the hash operation is adopted. The operation method encrypts the random number, which can improve the security of the root key corresponding to the target information.
  • the method for generating a key corresponding to each piece of sub-information according to the root key may be: performing a hash operation on the root key corresponding to the target information to obtain the key of the first sub-information; Hash operation is performed on the key of the second sub-information to obtain the key of the second sub-information.
  • the root key corresponding to the target information is n
  • the number of second sub-information is greater than 1, for example, the number of second sub-information is 3, which are respectively sub-information a2, sub-information a3 and sub-information a4, and the generation times of the three second sub-information are t2, t3, and t4 respectively.
  • the key corresponding to each piece of sub-information can be calculated. Since each sub-information is determined according to the generation time of each sub-information, the generation time of different sub-information is different, resulting in different first sub-information and second sub-information, so the obtained key corresponding to each sub-information is also different; Performing hash operation on the root key to obtain the key corresponding to the sub-information can improve the difficulty of the key corresponding to the sub-information, so that when each piece of sub-information is subsequently encrypted using the key corresponding to the sub-information, the difficulty of encryption can be improved. , reduce the probability of ciphertext being cracked by illegal terminals, and improve the security of information.
  • the target information includes first sub-information and second sub-information, and the information occupied space of the second sub-information is smaller than the information occupied space of the first sub-information.
  • the root key corresponding to the target information is generated according to the user information contained in the target information, and the method for generating a key corresponding to each piece of sub-information according to the root key may be: encoding the user information to obtain encoded user data; Generate a fourth random number from the user data; perform a hash operation on the fourth random number to obtain a root key corresponding to the target information; perform a hash operation on the root key corresponding to the target information to obtain a key of the first sub-information; The key of the first sub-information is hashed to obtain the key of the second sub-information.
  • the information occupied space of the information refers to the size of the resource space occupied when the information is stored, for example, it can be expressed in bytes (B), kilobytes (KB), megabytes (MB), gigabytes (GB), etc.
  • B kilobytes
  • MB megabytes
  • GB gigabytes
  • the size of the space occupied by the information of the information B ⁇ KB ⁇ MB ⁇ GB.
  • the information occupied space of sub-information 1 is 3 KB
  • the information occupied space of sub-information 2 is 1 KB
  • the sub-information 1 is the first sub-information
  • the sub-information 2 is the second sub-information.
  • the key corresponding to each piece of sub-information can be calculated.
  • each sub-information is determined according to the information occupied space of each sub-information, the information occupied space of different sub-information is different, resulting in different first sub-information and second sub-information, so the obtained key corresponding to each sub-information is also different ;
  • the difficulty of the key corresponding to the sub-information can be improved, so that when the key corresponding to the sub-information is used to encrypt each sub-information subsequently, the encryption can be improved. It reduces the probability of ciphertext being cracked by illegal terminals and improves the security of information.
  • S103 Generate a first random number corresponding to each piece of sub-information according to the attribute information of each piece of sub-information, and adjust each piece of sub-information according to the first random number to obtain each piece of adjusted sub-information.
  • the first random number can be used to adjust each piece of sub-information, so that the value corresponding to each piece of sub-information after adjustment is less than or equal to the first threshold, so that each piece of sub-information is mapped to the curve of the objective function, according to the curve of the objective function Calculate the coordinate point corresponding to each sub-information.
  • the first threshold may be determined according to a curve parameter corresponding to the objective function. If the curve parameter is the curve length c, the first threshold is 2 256 -w, where w is a very small value.
  • the random number can be generated using the random number generation algorithm mentioned above.
  • each piece of sub-information can be encoded to obtain encoded data of numerical type, and the encoded data corresponding to each piece of sub-information is adjusted according to the first random number corresponding to each piece of sub-information, Get the adjusted sub-information. If each piece of sub-information is numerical data, each piece of sub-information is adjusted according to the first random number corresponding to each piece of sub-information to obtain each piece of adjusted sub-information. It can be known that each piece of sub-information after adjustment includes the piece of sub-information and the first random number corresponding to the piece of sub-information.
  • the method for generating the first random number corresponding to each piece of sub-information according to the attribute information of each piece of sub-information may be: according to the length of each piece of sub-information, determine each piece of sub-information.
  • the privacy level corresponding to the information; the second random number is generated according to the privacy level corresponding to each sub-information; the byte length in the second random number is obtained, and the second random number is intercepted according to the byte length, and the interception process is obtained.
  • the second random number after the interception process is determined as the first random number corresponding to each piece of sub-information.
  • the intercepted second random number is smaller than the random number threshold, and the byte length of the intercepted second random number is smaller than the byte length of the second random number.
  • the random number threshold may be in the range of (0, 128), for example.
  • the byte length in the second random number refers to the number of bytes corresponding to the second random number. For example, if the second random number is a number between 0 and 255, the corresponding byte length is 1. The random number is a number greater than 255, the byte length is greater than 1, and so on.
  • 1 byte corresponds to 8 bits (that is, bits), that is to say, for example, the length of the byte in the second random number is 1 and corresponds to 8 bits, then the length of the bytes in the second random number after interception processing is less than 8 bits, for example, it can be 7bit, 6bit, 5bit, etc.
  • the computer device may acquire the length of each piece of sub-information, and determine the privacy level corresponding to each piece of sub-information. If 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. For example, when the length of the sub-information is greater than the first length threshold, the privacy level of the sub-information is 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 is set to the first privacy level. Two levels of privacy.
  • a second random number is generated according to the privacy level corresponding to the sub-information, and then the byte length of the second random number is obtained, and the second random number is determined according to the byte length.
  • the random number is intercepted to obtain a second random number after interception. For example, 8 bits corresponding to 1 byte can be intercepted, for example, any 1 bit of the 8 bits can be intercepted, or 2 bits, 3 bits, 5 bits, and so on. That is, the value corresponding to the second random number after the truncation process is different from that of the second random number before the truncation process.
  • the intercepted second random number can be obtained, and there are multiple interception methods for a second random number, including intercepting one or more bits in the 8-bit, so the intercepted The second random number is not equal to the second random number before interception. Even if the illegal terminal obtains the length of each sub-information and obtains the second random number, it is difficult to obtain the correct interception method because the second random number has various interception methods. Therefore, it is impossible to obtain the first random number corresponding to each piece of sub-information, thereby improving information security.
  • the method for generating the first random number corresponding to each piece of sub-information according to the attribute information of each piece of sub-information may be: encoding the generation time of each piece of sub-information , obtain the encoded time data; generate a third random number according to the encoded time data; perform filling processing on the bytes in the third random number to obtain the third random number after filling processing; The random number is determined as the first random number corresponding to each piece of sub-information.
  • the third random number after filling processing is smaller than the random number threshold, and the random number threshold may be in the range of (0, 128), for example.
  • the computer device can obtain the generation time of each piece of sub-information, encode the generation time of each piece of sub-information, obtain encoded time data, and process the encoded time data according to a random number generation algorithm to obtain a third random number ; Pad the bytes in the third random number to obtain the third random number after padding, and pad the 8 bits corresponding to 1 byte, for example, the binary can be filled with 0 or 1. That is to say, the value corresponding to the third random number after the padding processing is different from the value corresponding to the third random number before the padding processing, and the third random number after the padding processing is smaller than the random number threshold.
  • the filled third random number can be obtained, and there are multiple filling methods for a third random number, including filling one or more bits in 8 bits, so the filled third random number can be obtained by filling the third random number.
  • the third random number is not equal to the third random number before filling. Even if the illegal terminal obtains the generation time of each sub-information and obtains the third random number, since the third random number has various filling methods, it is difficult to obtain the correct filling. Therefore, it is impossible to obtain the first random number corresponding to each piece of sub-information, thereby improving the security of the information.
  • the method for generating the first random number corresponding to each piece of sub-information according to the attribute information of each piece of sub-information may be: determining each piece of information according to the limited period of each piece of sub-information.
  • the importance level of the sub-information generate a fifth random number according to the importance level of each sub-information, and perform interception processing or padding processing on the bytes in the fifth random number to obtain a fifth random number after interception processing or padding processing;
  • the fifth random number after the interception process or the padding process is determined as the first random number corresponding to each piece of sub-information.
  • the fifth random number after interception processing or padding processing is smaller than the random number threshold, and the byte length in the fifth random number after interception processing or padding processing is smaller than the byte length in the fifth random number, that is, interception processing or
  • the fifth random number after the padding process is different from the value corresponding to the fifth random number before the truncation process or the padding process.
  • the computer device determines the importance level of the sub-information corresponding to the validity period by acquiring the validity period of each sub-information, and uses a random number generation algorithm to generate a fifth random number according to the importance level of the sub-information. perform interception processing or padding processing on the bytes in the interception processing or padding processing to obtain a fifth random number after the interception processing or padding processing; determine the fifth random number after the interception processing or padding processing as the first random number corresponding to each piece of sub-information. Since there are various interception and padding processing methods for the fifth random number, the intercepted or padding fifth random number can be obtained. Therefore, it is difficult for the illegal terminal to obtain the correct intercepted or padding fifth random number, so it is impossible to obtain the fifth random number. The first random number corresponding to each piece of sub-information, thereby improving information security.
  • each piece of sub-information of the adjusted non-numeric type can be encoded to obtain coded data corresponding to each piece of sub-information of the adjusted numerical type, and the coded data corresponding to each piece of sub-information of the adjusted numerical type can be mapped to the corresponding coded data of the objective function.
  • the corresponding coordinate point is obtained on the curve, so as to obtain the coordinate information corresponding to each piece of sub-information according to the coordinate point.
  • the curve corresponding to the objective function can be obtained, and each piece of adjusted sub-information is mapped to the first coordinate of the target point on the curve corresponding to the objective function; according to the first coordinate and the objective function , determine the second coordinate of the target point on the curve corresponding to the objective function; determine the first coordinate and the second coordinate as the coordinate information corresponding to each piece of sub-information, thereby obtaining at least two pieces of sub-information corresponding to each sub-information Coordinate information.
  • the second coordinate of the target point on the curve corresponding to the objective function can be determined according to the first coordinate and the objective function, and the first coordinate can be determined.
  • the coordinates and the second coordinates are determined as the coordinate information corresponding to the sub-information c.
  • the curve corresponding to the objective function can be shown in formula (1-1):
  • a and b are known real numbers, and x and y are both parameters.
  • the value of the other parameter can be calculated by formula (1-1), for example , by determining the value of x, the value of y can be calculated according to formula (1-1).
  • a is 1, b is -1, the sub-information c is mapped to the first coordinate of the target point on the curve corresponding to the objective function (for example, the abscissa of the target point) is 1, and a, b and the first coordinate
  • the coordinates are substituted into formula (1-1) as x, and y is obtained as 1, that is, the second coordinate of the target point on the curve corresponding to the objective function is 1, then the coordinate information corresponding to the sub-information c is (1, 1),
  • the coordinate information corresponding to the other sub-information in the at least two pieces of sub-information can be acquired, thereby acquiring the coordinate information corresponding to each sub-information in the at least two pieces of sub-information.
  • the computer device may use the key corresponding to each piece of sub-information to encrypt the coordinate information corresponding to each of the at least two pieces of sub-information to obtain the ciphertext of the coordinate information corresponding to each piece of sub-information.
  • the computer device can obtain the private key of the terminal to which the target information belongs, and encrypt the coordinate information corresponding to each sub-information in the at least two sub-information according to the private key of the terminal and the key corresponding to each sub-information, and obtain each sub-information.
  • the ciphertext of the coordinate information corresponding to the sliver information It can be seen that the ciphertext of the coordinate information corresponding to the sub-information is the ciphertext obtained by encrypting the sub-information.
  • the ciphertext of the corresponding sub-information corresponding to the ciphertext cannot be known even if the ciphertext is obtained. content.
  • S106 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 ciphertext of the coordinate information corresponding to each piece of sub-information is determined as the ciphertext of the target information.
  • the ciphertext of the target information includes the ciphertext of the coordinate information corresponding to each of the at least two sub-information, so far, the ciphertext of the target information can be obtained by encrypting the target information, and the ciphertext of the target information can be obtained.
  • the documents are stored in the blockchain network.
  • the illegal terminal It is difficult to obtain the generation time of each sub-information and the length of each sub-information, that is, the first random number corresponding to each sub-information cannot be generated. Therefore, each sub-information is adjusted by using the first random number, and the adjusted sub-information is subsequently adjusted. Encrypting information can improve the security of information.
  • each piece of sub-information in the at least two pieces of sub-information it is beneficial to generate coordinate information corresponding to each piece of adjusted sub-information according to each piece of adjusted sub-information, and improve the success rate of obtaining the coordinate information corresponding to each piece of adjusted sub-information.
  • By encrypting each piece of sub-information in the target information illegal terminals are prevented from cracking the ciphertext, thereby improving the security of each piece of sub-information, thereby improving the security of the target information.
  • the security of the information can be improved based on the characteristics of the blockchain that cannot be tampered with and is not easily lost; in addition, the ciphertext of the target information is stored in the blockchain network. , which can reduce the resource occupation of the local storage space of the terminal.
  • the method for adjusting each piece of sub-information according to the first random number may be as shown in FIG. 2, which is a flowchart of a method for adjusting each piece of sub-information provided by an embodiment of the present application.
  • the schematic diagram, as shown in Figure 2 the method includes the following steps:
  • the remainder operation refers to the division of two numbers, and the remainder operation is performed on each sub-information and the first random number, that is, each sub-information is divided by the first random number, and the calculated result is used as the remainder. each subsequent sub-message.
  • the piece of sub-information after the remainder is less than the information threshold, it is considered that the piece of sub-information is mapped to the first coordinate of the target point on the curve corresponding to the objective function, and the first coordinate and the objective function can be calculated to obtain the The second coordinate of the target point on the curve corresponding to the objective function, that is, the coordinate information corresponding to each piece of sub-information can be obtained.
  • the information threshold may be, for example, 2 256 , or may be smaller than 2 256 .
  • each piece of sub-information after the remainder can be obtained, and then according to the relationship between each piece of sub-information after the remainder and the information threshold, each piece of sub-information after the remainder is determined. for each adjusted sub-information.
  • taking the remainder between each piece of sub-information and the first random number may refer to dividing the value corresponding to each piece of sub-information by the first random number. It can be known that the value corresponding to each piece of sub-information obtained after the remainder is less than the sub-information before the remainder. The value corresponding to the information.
  • the piece of sub-information is mapped to the first coordinate of the target point on the curve corresponding to the objective function, which cannot be calculated according to the first coordinate and the objective function.
  • the second coordinate of the target point on the curve corresponding to the objective function that is, the coordinate information corresponding to each piece of sub-information cannot be obtained. Therefore, it is necessary to adjust the first random number corresponding to each piece of sub-information, and perform a remainder operation between each piece of adjusted sub-information and the first random number to obtain each candidate sub-information.
  • each piece of candidate sub-information is smaller than the information threshold, determine each piece of candidate sub-information as each adjusted piece of sub-information.
  • each piece of candidate sub-information is less than the information threshold, the piece of sub-information is mapped to the first coordinate of the target point on the curve corresponding to the objective function, and the corresponding value of the objective function can be calculated according to the first coordinate and the objective function.
  • the second coordinate of the target point on the curve that is, the coordinate information corresponding to each piece of sub-information can be obtained. If each candidate sub-information is greater than or equal to the information threshold, it is considered that the sub-information is mapped to the first coordinate of the target point on the curve corresponding to the objective function, and the objective function cannot be calculated based on the first coordinate and the objective function.
  • the second coordinate of the target point on the corresponding curve that is, the coordinate information corresponding to each piece of sub-information cannot be obtained. That is to say, if each piece of candidate sub-information is greater than or equal to the information threshold, continue to adjust the first random number until the remainder operation is performed on each piece of candidate sub-information and the adjusted first random number, and the remainder of the candidate’s Each piece of sub-information is smaller than the information threshold, and each piece of sub-information of the candidate after the remainder is determined as each piece of adjusted sub-information.
  • each piece of adjusted sub-information can be obtained.
  • the success rate of encrypting sliver information by taking the remainder of each piece of sub-information and the first random number corresponding to each piece of sub-information, and continuously adjusting the first random number corresponding to each piece of sub-information.
  • FIG. 3 is a schematic flowchart of an information processing method for generating random numbers based on attributes of information provided by an embodiment of the present application, and the method is applied to nodes in a blockchain network. As shown in Figure 3, the method includes:
  • S301 Obtain an objective function for describing information and attribute information of each piece of sub-information in the target information to be processed.
  • S302 Generate a root key corresponding to the target information according to the user information included in the target information, and generate a key corresponding to each piece of sub-information according to the root key.
  • S303 Generate a first random number corresponding to each piece of sub-information according to the attribute information of each piece of sub-information, and adjust each piece of sub-information according to the first random number to obtain each piece of adjusted sub-information.
  • steps S301 to S304 reference may be made to the content of steps S101 to S104 in the embodiment corresponding to FIG. 1 , which will not be repeated here.
  • S305 Obtain the private key of the terminal to which the target information belongs, and the key corresponding to each piece of sub-information.
  • the terminal to which the target information belongs is the terminal that uploads the target information to the blockchain network for processing such as encryption and storage
  • the private key of the terminal to which the target information belongs is the private key generated by the terminal.
  • the identifier of the terminal to which the target information belongs can be obtained, the sixth random number can be generated by using the SECP256K1 algorithm, and the sixth random number can be filled to obtain the private key of the terminal. number.
  • the identifier of the terminal may refer to the factory serial number of the terminal, or other identifiers used to uniquely indicate the terminal.
  • the base point coordinates of the curve of the objective function can be obtained; the product of the base point coordinates and the 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 coordinates of the base point of the curve of the objective function can be acquired.
  • the base point is G
  • the corresponding base point coordinates are (x1, y1)
  • the private key of the terminal is h
  • the candidate coordinates can be calculated according to formula (1-2):
  • the candidate coordinate is H
  • the base point is G
  • the private key of the terminal is h.
  • the candidate coordinates can be encrypted according to the key corresponding to each sub-information to obtain the ciphertext of the candidate coordinates; the coordinate information corresponding to each sub-information is fused with the ciphertext of the corresponding candidate coordinates to obtain the corresponding Ciphertext of the coordinate information.
  • the candidate coordinates can be encrypted by formula (1-3) to obtain the ciphertext of the candidate coordinates , and fuse the coordinate information corresponding to the sub-information i with the ciphertext of the candidate coordinates to obtain the ciphertext of the coordinate information corresponding to the sub-information i.
  • Ci Mi+ki*H (1-3)
  • the candidate coordinates are H, Ci is the ciphertext of the coordinate information corresponding to the sub-information i, Mi is the coordinate information corresponding to the sub-information i, and ki is the key corresponding to the sub-information i.
  • ki*H indicates that the candidate coordinates are encrypted according to the key corresponding to the sub-information i to obtain the ciphertext of the candidate coordinates. It can be known that, for other sub-information in the n pieces of sub-information, the encryption and fusion can also be performed by formula (1-3) to obtain the ciphertext of the coordinate information corresponding to the other sub-information.
  • the ciphertext of the coordinate information corresponding to the piece of sub-information can be obtained by encrypting and fusing the formula (1-3), that is to say, a piece of sub-information corresponds to the number of ciphertexts of the coordinate information corresponding to a piece of sub-information , that is, for n pieces of sub-information, the number of ciphertexts of the coordinate information corresponding to the finally obtained sub-information is n.
  • an encryption algorithm can be used to encrypt the coordinate information corresponding to each piece of sub-information to obtain the ciphertext of the coordinate information corresponding to each piece of sub-information.
  • the encryption algorithm can include, for example, 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 computer device encrypts the coordinate information corresponding to each piece of sub-information in at least two pieces of sub-information according to the private key of the terminal and the key corresponding to each piece of sub-information, and obtains the ciphertext of the coordinate information corresponding to each piece of sub-information. Encryption is performed to obtain the corresponding ciphertext. After the terminal obtains the ciphertext corresponding to each piece of sub-information, it needs to be decrypted to know the sub-information corresponding to each piece of ciphertext.
  • S307 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.
  • step S307 for the specific content of step S307, reference may be made to the content of step S106 in the embodiment corresponding to FIG. 1 , which will not be repeated here.
  • the coordinate information corresponding to each sub-information in the at least two sub-information is encrypted, and the ciphertext of the coordinate information corresponding to each sub-information is obtained, which can realize Each piece of sub-information is encrypted to obtain the corresponding ciphertext.
  • the terminal After the terminal obtains the ciphertext corresponding to each piece of sub-information, it needs to be decrypted to know the sub-information corresponding to each piece of ciphertext.
  • FIG. 4 is a schematic diagram of the composition and structure of an information processing apparatus for generating random numbers based on attributes of information provided by an embodiment of the present application.
  • the above-mentioned information processing apparatus for generating random numbers based on attributes of information may be run in computer equipment.
  • a computer program (including program code) of , for example, the information processing apparatus for generating random numbers based on attributes of information is an application software; the apparatus can be used to execute corresponding steps in the methods provided by the embodiments of the present application.
  • the device 40 includes:
  • the information acquisition module 401 is used to acquire the objective function used to describe the 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 the attribute information of each piece of sub-information. At least one of the generation time of the information and the length of each piece of sub-information;
  • a key generation module 402 configured to generate a root key corresponding to the target information according to the user information contained in the target information, and generate a key corresponding to each piece of sub-information according to the root key;
  • an information adjustment module 403 configured to generate a first random number corresponding to each piece of sub-information according to the attribute information of each piece of sub-information, adjust each piece of sub-information according to the first random number, and obtain each piece of adjusted sub-information;
  • a coordinate obtaining module 404 configured to obtain coordinate information corresponding to each piece of sub-information in the at least two pieces of sub-information according to the objective function and each piece of adjusted sub-information;
  • the information encryption module 405 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 sub-information to obtain the ciphertext of the coordinate information corresponding to each sub-information;
  • the information storage module 406 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 attribute information of each piece of sub-information includes the length of each piece of sub-information
  • the information adjustment module 403 is specifically used for:
  • each sub-information determines the privacy level corresponding to each sub-information
  • the intercepted second random number is smaller than the random number threshold , the length of bytes in the second random number after the interception process is smaller than the length of bytes in the second random number;
  • the intercepted second random number is determined as the first random number 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 information adjustment module 403 is specifically used for:
  • the filled third random number is determined as the first random number corresponding to each piece of sub-information.
  • the information adjustment module 403 is specifically used for:
  • each piece of sub-information after the remainder is smaller than the information threshold, then each piece of sub-information after the remainder is determined as each piece of adjusted sub-information.
  • the target information includes first sub-information and second sub-information, and the generation time of the second sub-information is later than the generation time of the first sub-information;
  • the key generation module 402 is specifically used for:
  • the information encryption module 405 is specifically used for:
  • 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 information encryption module 405 is specifically used for:
  • 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.
  • step S101 shown in FIG. 1 may be performed by the information acquisition module 401 shown in FIG. 4
  • step S102 shown in FIG. 1 may be performed by the key generation module 402 shown in FIG. 4
  • the steps shown in FIG. 1 S103 can be executed by the information adjustment module 403 in FIG. 4
  • step S104 shown in FIG. 1 can be executed by the coordinate acquisition module 404 in FIG. 4
  • step S105 shown in FIG. 1 can be executed by the information encryption module 405 in FIG.
  • step S106 shown in FIG. 1 can be performed by the information storage module 406 in FIG. 4 .
  • the various modules in the information processing for generating random numbers based on the attributes of the information shown in FIG. can also be divided into multiple sub-units with smaller functions, which can realize the same operation without affecting the realization of the technical effects of the embodiments of the present application.
  • the above modules are divided based on logical functions.
  • the function of one module may also be implemented by multiple units, or the functions of multiple modules may be implemented by one unit.
  • the information processing apparatus for generating random numbers based on attributes of information may also include other units.
  • these functions may also be implemented with the assistance of other units, and may be implemented by cooperation of multiple units.
  • a general-purpose computer device such as a computer including processing elements and storage elements such as a central processing unit (CPU), random access storage medium (RAM), read only storage medium (ROM), etc.
  • Running a computer program capable of performing the steps involved in the respective methods as shown in Figures 1, 2 and 3 to construct information for generating random numbers based on attributes of the information as shown in Figure 4 A processing device, and an information processing method for generating a random number based on an attribute of the information according to the embodiment of the present application.
  • the above-mentioned computer program can be recorded on, for example, a computer-readable recording medium, loaded in the above-mentioned computing device via the computer-readable recording medium, and executed therein.
  • the illegal terminal It is difficult to obtain the generation time of each sub-information and the length of each sub-information, that is, the first random number corresponding to each sub-information cannot be generated. Therefore, each sub-information is adjusted by using the first random number, and the adjusted sub-information is subsequently adjusted. Encrypting information can improve the security of information.
  • each piece of sub-information in the at least two pieces of sub-information it is beneficial to generate coordinate information corresponding to each piece of adjusted sub-information according to each piece of adjusted sub-information, and improve the success rate of obtaining coordinate information corresponding to each piece of adjusted sub-information.
  • By encrypting each piece of sub-information in the target information illegal terminals are prevented from cracking the ciphertext, thereby improving the security of each piece of sub-information, thereby improving the security of the target information.
  • the security of the information can be improved based on the characteristics of the blockchain that cannot be tampered with and is not easily lost; in addition, the ciphertext of the target information is stored in the blockchain network. , which can reduce the resource occupation of the local storage space of the terminal.
  • FIG. 5 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the above-mentioned computer device 50 may include: a processor 501 , a network interface 504 and a memory 505 , in addition, the above-mentioned computer device 50 may further include: a user interface 503 , and at least one communication bus 502 .
  • the communication bus 502 is used to realize the connection and communication between these components.
  • the user interface 503 may include a display screen (Display) and a keyboard (Keyboard), and the optional user interface 503 may also include a standard wired interface and a wireless interface.
  • the network interface 504 may include a standard wired interface and a wireless interface (eg, a WI-FI interface).
  • the memory 505 may be a high-speed RAM memory, or a non-volatile memory, such as at least one disk memory.
  • the memory 505 can optionally also be at least one storage device located away from the aforementioned processor 501 .
  • the memory 505 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
  • the network interface 504 can provide a network communication function;
  • the user interface 503 is mainly used to provide an input interface for the user; and
  • the processor 501 can be used to call the device control application stored in the memory 505 program to achieve:
  • 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 and the time of each piece of sub-information. at least one of the lengths of the sliver information;
  • each piece of adjusted sub-information obtain coordinate information corresponding to each of the at least two pieces of sub-information
  • 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 computer device 50 described in the embodiments of the present application may execute the description of the above-mentioned information processing method for generating random numbers based on information attributes in the foregoing embodiments corresponding to FIG. 1 , FIG. 2 and FIG. 3 , and may also execute The foregoing description of the information processing apparatus for generating random numbers based on attributes of information in the embodiment corresponding to FIG. 4 will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated.
  • the illegal terminal It is difficult to obtain the generation time of each sub-information and the length of each sub-information, that is, the first random number corresponding to each sub-information cannot be generated. Therefore, each sub-information is adjusted by using the first random number, and the adjusted sub-information is subsequently adjusted. Encrypting information can improve the security of information.
  • each piece of sub-information in the at least two pieces of sub-information it is beneficial to generate coordinate information corresponding to each piece of adjusted sub-information according to each piece of adjusted sub-information, and improve the success rate of obtaining coordinate information corresponding to each piece of adjusted sub-information.
  • By encrypting each piece of sub-information in the target information illegal terminals are prevented from cracking the ciphertext, thereby improving the security of each piece of sub-information, thereby improving the security of the target information.
  • the security of the information can be improved based on the characteristics of the blockchain that cannot be tampered with and is not easily lost; in addition, the ciphertext of the target information is stored in the blockchain network. , which can reduce the resource occupation of the local storage space of the terminal.
  • 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 executed by a computer, the program instructions cause the computer to perform the above-mentioned embodiments.
  • the method, the computer may be part of the above mentioned computer equipment.
  • it is the above-mentioned processor 501 .
  • program instructions may be deployed for execution on one computer device, or on multiple computer devices located at one site, or alternatively, distributed across multiple sites and interconnected by a communications network Implemented, multiple computer devices distributed in multiple locations and interconnected by a communication network can form a blockchain network.
  • the storage medium involved in this application such as a computer-readable storage medium, may be non-volatile or volatile.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)

Abstract

本申请实施例公开了一种基于信息的属性生成随机数的信息处理方法、装置及设备,主要涉及区块链技术和医疗平台技术,其中,方法包括:获取用于描述信息的目标函数,以及目标信息中每条子信息的属性信息;根据目标信息包含的用户信息生成根密钥,根据根密钥生成每条子信息对应的密钥;根据每条子信息的属性信息生成每条子信息对应的第一随机数,根据第一随机数对每条子信息进行调整,得到调整后的每条子信息;根据目标函数以及调整后的每条子信息,获取每条子信息的坐标信息;采用每条子信息对应的密钥,对每条子信息的坐标信息进行加密,得到目标信息的密文,将目标信息的密文存储至区块链网络中。采用本申请实施例,可以提高信息的安全性。

Description

基于信息的属性生成随机数的信息处理方法、装置及设备
本申请要求于2020年9月29日提交中国专利局、申请号为202011056601.6,发明名称为“基于信息的属性生成随机数的信息处理方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及区块链技术领域,尤其涉及一种基于信息的属性生成随机数的信息处理方法、装置及设备。
背景技术
在这个网络迅速发展的时代,越来越多的信息都是通过网络进行交互、存储。发明人意识到,传统的信息存储方式一般为终端本地存储,例如,医疗平台中会使用终端将每个患者的病历信息、患者信息等信息存储于终端本地,该种信息存储方式存在较大的风险,非法终端容易获取到本地存储的信息,导致信息的泄露,以及,非法用户可以对本地存储的信息进行篡改,导致信息安全性较低,并且,当本地存储出现故障时,导致信息无法找回,从而造成损失。因此,如何确保信息存储过程中信息的安全性,防止信息泄露是亟待解决的问题。
发明内容
本申请实施例提供一种基于信息的属性生成随机数的信息处理方法、装置及设备,可以实现对信息进行加密,提高信息的安全性,防止信息泄露。
本申请实施例一方面提供一种基于信息的属性生成随机数的信息处理方法,包括:
获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息,该目标信息包括至少两条子信息,该每条子信息的属性信息包括该每条子信息的生成时间以及该每条子信息的长度中的至少一种;
根据该目标信息包含的用户信息生成该目标信息对应的根密钥,根据该根密钥生成该每条子信息对应的密钥;
根据该每条子信息的属性信息生成该每条子信息对应的第一随机数,根据该第一随机数对该每条子信息进行调整,得到调整后的每条子信息;
根据该目标函数以及该调整后的每条子信息,获取该至少两条子信息中每条子信息对应的坐标信息;
采用该每条子信息对应的密钥,对该至少两条子信息中的对应子信息的坐标信息进行加密,得到该每条子信息对应的坐标信息的密文;
将该每条子信息对应的坐标信息的密文确定为该目标信息的密文,将该目标信息的密文存储至区块链网络中。
本申请实施例一方面提供一种基于信息的属性生成随机数的信息处理装置,包括:
信息获取模块,用于获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息,该目标信息包括至少两条子信息,该每条子信息的属性信息包括该每条子信息的生成时间以及该每条子信息的长度中的至少一种;
密钥生成模块,用于根据该目标信息包含的用户信息生成该目标信息对应的根密钥,根据该根密钥生成该每条子信息对应的密钥;
信息调整模块,用于根据该每条子信息的属性信息生成该每条子信息对应的第一随机数,根据该第一随机数对该每条子信息进行调整,得到调整后的每条子信息;
坐标获取模块,用于根据该目标函数以及该调整后的每条子信息,获取该至少两条子信息中每条子信息对应的坐标信息;
信息加密模块,用于采用该每条子信息对应的密钥,对该至少两条子信息中的对应子信息的坐标信息进行加密,得到该每条子信息对应的坐标信息的密文;
信息存储模块,用于将该每条子信息对应的坐标信息的密文确定为该目标信息的密文,将该目标信息的密文存储至区块链网络中。
本申请一方面提供了一种计算机设备,包括:处理器、存储器、网络接口;
上述处理器与存储器、网络接口相连,其中,网络接口用于提供数据通信功能,上述存储器用于存储计算机程序,上述处理器用于调用上述计算机程序,以执行以下方法:
获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息,所述目标信息包括至少两条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间以及所述每条子信息的长度中的至少一种;
根据所述目标信息包含的用户信息生成所述目标信息对应的根密钥,根据所述根密钥生成所述每条子信息对应的密钥;
根据所述每条子信息的属性信息生成所述每条子信息对应的第一随机数,根据所述第一随机数对所述每条子信息进行调整,得到调整后的每条子信息;
根据所述目标函数以及所述调整后的每条子信息,获取所述至少两条子信息中每条子信息对应的坐标信息;
采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
本申请实施例一方面提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序包括程序指令,该程序指令当被处理器执行时使该处理器执行以下方法:
获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息,所述目标信息包括至少两条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间以及所述每条子信息的长度中的至少一种;
根据所述目标信息包含的用户信息生成所述目标信息对应的根密钥,根据所述根密钥生成所述每条子信息对应的密钥;
根据所述每条子信息的属性信息生成所述每条子信息对应的第一随机数,根据所述第一随机数对所述每条子信息进行调整,得到调整后的每条子信息;
根据所述目标函数以及所述调整后的每条子信息,获取所述至少两条子信息中每条子信息对应的坐标信息;
采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
本申请实施例通过将目标信息的密文信息存储至区块链网络中,基于区块链不可篡改且不易丢失的特性,可以提高信息的安全性;此外,将目标信息的密文存储至区块链网络中,可以减少终端本地存储空间的资源占用。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种基于信息的属性生成随机数的信息处理方法的流程示意图;
图2是本申请实施例提供的一种对每条子信息进行调整的方法的流程示意图;
图3是本申请实施例提供的一种基于信息的属性生成随机数的信息处理方法的流程示意图;
图4是本申请实施例提供的一种基于信息的属性生成随机数的信息处理装置的组成结构示意图;
图5是本申请实施例提供的一种计算机设备的组成结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的技术方案可涉及区块链技术领域,比如本申请涉及的数据如特征信息和/或目标信息的密文等可存储于区块链中。可选的,本申请可应用于金融科技如对金融数据加密等场景中,还可应用于数字医疗如对患者信息加密等场景中,以提高信息安全性。
本申请所涉及的区块链是一种分布式数据存储、点对点传输(P2P传输)、共识机制、加密算法等计算机技术的新型应用模式,其本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层;区块链可由多个借由密码学串接并保护内容的串连交易记录(又称区块)构成,用区块链所串接的分布式账本能让多方有效纪录交易,且可永久查验此交易(不可篡改)。其中,共识机制是指区块链网络中实现不同节点之间建立信任、获取权益的数学算法;也就是说,共识机制是区块链各网络节点共同认可的一种数学算法。
本申请适用于医疗平台中,则目标信息例如可以为患者的病历信息、患者信息等等,通过对患者的病历信息、患者信息以及医疗平台的其他信息进行加密,并将加密后的信息存储至区块链网络中,有利于对患者的病历信息、患者信息等进行管理,提高患者的信息的安全性。
请参见图1,图1是本申请实施例提供的一种基于信息的属性生成随机数的信息处理方法的流程示意图,该方法应用于区块链网络中的节点,该节点可以是独立的一个物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。或者,该节点可以是指计算机设备,包括手机、平板电脑、笔记本电脑、掌上电脑、智能音响、移动互联网设备(MID,mobile internet device)、POS(Point Of Sales,销售点)机、可穿戴设备(例如智能手表、智能手环等)等。如图1所示,该方法包括:
S101,获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息。
这里,目标函数可以是指椭圆曲线对应的函数,目标函数也可以是指其他曲线对应的函数。目标信息包括至少两条子信息,目标信息可以是指某机构的交易数据、营业数据、该机构的内部资料等数据。目标信息中每条子信息的属性信息包括每条子信息的生成时间以及每条子信息的长度中的至少一种。其中,目标函数用于描述目标信息,即将目标信息转化成目标函数对应的坐标信息,以此提高目标信息的安全性。
S102,根据目标信息包含的用户信息生成目标信息对应的根密钥,根据根密钥生成每条子信息对应的密钥。
其中,目标信息包括第一子信息和第二子信息,第二子信息的生成时间后于第一子信 息的生成时间。用户信息例如可以包括用户名称、用户编号、用户所属机构的机构代码,等等。若目标信息只包含一个用户信息,则根据该一个用户信息生成目标信息对应的根密钥;若目标信息只包含多个用户信息,则根据该多个用户信息生成目标信息对应的根密钥,即根据该多个用户信息中的任意一个用户信息或者任意多个用户信息生成目标信息对应的根密钥。
本申请实施例中,根据目标信息包含的用户信息生成目标信息对应的根密钥的方法包括:对用户信息进行编码,得到编码后的用户数据;根据编码后的用户数据生成第四随机数;对第四随机数进行哈希运算,得到目标信息对应的根密钥。
具体的,计算机设备通过获取目标信息包含的用户信息,对用户信息进行编码,得到编码后的用户数据,然后调用C语言中的rand函数,根据该编码后的用户数据返回一个随机数,即第四随机数,计算机设备通过对第四随机数进行哈希运算,得到目标信息对应的根密钥。例如,根据该编码数据生成第四随机数k;对第四随机数k进行哈希运算,即hash(k)=k1,将k1作为目标信息对应的根密钥。可选的,还可以采用其他随机数生成算法生成第四随机数,例如中心极限定理和Box Muller(坐标变换法)、蒙特卡洛算法、数值概率算法、拉斯维加斯算法或者其他随机数生成算法。通过对用户信息进行编码得到编码后的用户数据,并根据编码后的用户数据生成第四随机数,由于对第四随机数进行哈希运算后得到目标信息对应的根密钥,即采用哈希运算的方法对随机数进行了加密,可以提高目标信息对应的根密钥的安全性。
本申请实施例中,根据根密钥生成每条子信息对应的密钥的方法可以为:对目标信息对应的根密钥进行哈希运算,得到第一子信息的密钥;对第一子信息的密钥进行哈希运算,得到第二子信息的密钥。
举例来进行说明,例如目标信息对应的根密钥为n,目标信息中包含2条子信息分别为子信息a1和子信息a2,且2条子信息对应的生成时间分别为t1、t2,t1>t2,因此,第一子信息为子信息a1、第二子信息为子信息a2,对目标信息对应的根密钥进行哈希运算,得到第一子信息的密钥,即hash(n)=n1,则n1为第一子信息的密钥;对第一子信息的密钥进行哈希运算,得到第二子信息的密钥,即hash(n1)=n2,则n2为第二子信息的密钥。
若第二子信息的数量大于1,如第二子信息的数量为3条,分别为子信息a2、子信息a3和子信息a4,3条第二子信息的生成时间分别为t2、t3、t4,且t2>t3>t4,第一子信息的密钥为n1,则对第一子信息的密钥进行哈希运算,得到第二子信息a2的密钥,即hash(n1)=n2,则n2为子信息a2的密钥;对第二子信息a2的密钥进行哈希运算,得到第二子信息a3的密钥,即hash(n2)=n3,则n3为子信息a3的密钥;对第二子信息a3的密钥进行哈希运算,得到第二子信息a4的密钥,即hash(n3)=n4,则n4为子信息a4的密钥。由此,可计算得到每条子信息对应的密钥。由于每条子信息是根据每条子信息的生成时间确定的,因此不同的子信息的生成时间不同导致第一子信息和第二子信息不同,因此得到的每条子信息对应的密钥也不同;通过对根密钥进行哈希运算得到子信息对应的密钥,可以提高子信息对应的密钥的难度,从而在后续使用子信息对应的密钥对每条子信息进行加密时,可以提高加密的难度,降低密文被非法终端破解的概率,提高信息的安全性。
可选的,目标信息包括第一子信息和第二子信息,第二子信息的信息占用空间小于第一子信息的信息占用空间。根据目标信息包含的用户信息生成目标信息对应的根密钥,根据根密钥生成每条子信息对应的密钥的方法可以为:对用户信息进行编码,得到编码后的用户数据;根据编码后的用户数据生成第四随机数;对第四随机数进行哈希运算,得到目标信息对应的根密钥;对目标信息对应的根密钥进行哈希运算,得到第一子信息的密钥;对第一子信息的密钥进行哈希运算,得到第二子信息的密钥。
其中,信息的信息占用空间是指信息存储时所占资源空间的大小,例如可以用字节(B)、 千字节(KB)、兆字节(MB)、吉字节(GB)等表示信息的信息占用空间的大小,B<KB<MB<GB。例如,子信息1的信息占用空间为3KB,子信息2的信息占用空间为1KB,则子信息1为第一子信息,子信息2为第二子信息。目标信息对应的根密钥为m,对目标信息对应的根密钥进行哈希运算,得到第一子信息的密钥,即hash(m)=m1,则m1为第一子信息的密钥;对第一子信息的密钥进行哈希运算,得到第二子信息的密钥,即hash(m1)=m2,则m2为第二子信息的密钥。由此,可计算得到每条子信息对应的密钥。由于每条子信息是根据每条子信息的信息占用空间确定的,因此不同的子信息的信息占用空间不同导致第一子信息和第二子信息不同,因此得到的每条子信息对应的密钥也不同;通过对根密钥进行哈希运算得到子信息对应的密钥,可以提高子信息对应的密钥的难度,从而在后续使用子信息对应的密钥对每条子信息进行加密时,可以提高加密的难度,降低密文被非法终端破解的概率,提高信息的安全性。
S103,根据每条子信息的属性信息生成每条子信息对应的第一随机数,根据第一随机数对每条子信息进行调整,得到调整后的每条子信息。
这里,由于每条子信息对应的数值大于第一阈值时,不能实现将每条子信息映射到目标函数的曲线上,则无法根据目标函数的曲线计算得到每条子信息对应的坐标点。因此可以使用第一随机数对每条子信息进行调整,使得调整后的每条子信息对应的数值小于或等于第一阈值,从而实现将每条子信息映射到目标函数的曲线上,根据目标函数的曲线计算得到每条子信息对应的坐标点。通过使用第一随机数对每条子信息进行调整,可以提高获取每条子信息对应的坐标点的概率,从而提高加密成功的概率。第一阈值可以是根据目标函数对应的曲线参数确定的,如该曲线参数为曲线长度c,则第一阈值为2 256-w,其中,w为一个极小的数值。可以采用上文提到的随机数生成算法生成随机数。
这里,若每条子信息不为数值类型的数据,则可以对每条子信息进行编码,得到数值类型的编码数据,根据每条子信息对应的第一随机数对每条子信息对应的编码数据进行调整,得到调整后的每条子信息。若每条子信息为数值类型的数据,则根据每条子信息对应的第一随机数对每条子信息进行调整,得到调整后的每条子信息。可知,调整后的每条子信息包括该条子信息和该条子信息对应的第一随机数。
可选的,若每条子信息的属性信息包括每条子信息的长度,根据每条子信息的属性信息生成每条子信息对应的第一随机数的方法可以为:根据每条子信息的长度,确定每条子信息对应的私密性等级;根据每条子信息对应的私密性等级生成第二随机数;获取第二随机数中的字节长度,根据字节长度对第二随机数进行截取处理,得到截取处理后的第二随机数;将截取处理后的第二随机数确定为每条子信息对应的第一随机数。
其中,截取处理后的第二随机数小于随机数阈值,截取处理后的第二随机数中的字节长度小于第二随机数中的字节长度。随机数阈值例如可以为(0,128)范围内。第二随机数中的字节长度是指第二随机数对应的字节的数量,例如第二随机数为0~255之间的数,则对应的字节长度为1,或者,若第二随机数为大于255的数,字节长度大于1,等等。1个字节对应8bit(即位),也就是说,例如第二随机数中的字节长度为1,对应8bit,则截取处理后的第二随机数中的字节长度小于8bit,例如可以为7bit、6bit、5bit,等等。
具体的,计算机设备可以获取每条子信息的长度,确定每条子信息对应的私密性等级。若子信息的长度越长,则说明该子信息的私密性等级越高;若子信息的长度越短,则说明该子信息的私密性等级越低。例如,当子信息的长度大于第一长度阈值时,将子信息的私密性等级设置为第一私密等级;当子信息的长度大于第二长度阈值时,将子信息的私密性等级设置为第二私密等级。若某一子信息对应的私密等级为第二私密等级时,则根据该子信息对应的私密性等级生成第二随机数,然后获取第二随机数的字节长度,根据字节长度对第二随机数进行截取处理,得到截取处理后的第二随机数,例如对1个字节对应的8bit 进行截取,例如可以截取8bit中的任意1bit,或者截取2bit、3bit、5bit,等等。也就是说,截取处理后的第二随机数与截取处理前的第二随机数对应的数值不同。
由于对第二随机数进行截取处理,可以得到截取后的第二随机数,且对于一个第二随机数有多种截取方式,包括对8bit中的一位或者多位进行截取,因此截取后的第二随机数与截取前的第二随机数不相等,即使非法终端获取到每条子信息的长度以及得到第二随机数,由于第二随机数有多种截取方式,也难以获得正确的截取后的第二随机数,因此无法实现获取每条子信息对应的第一随机数,从而可以提高信息的安全性。
可选的,若每条子信息的属性信息包括每条子信息的生成时间,根据每条子信息的属性信息生成每条子信息对应的第一随机数的方法可以为:对每条子信息的生成时间进行编码,得到编码后的时间数据;根据编码后的时间数据生成第三随机数;对第三随机数中的字节进行填充处理,得到填充处理后的第三随机数;将填充处理后的第三随机数确定为每条子信息对应的第一随机数。
其中,填充处理后的第三随机数小于随机数阈值,随机数阈值例如可以为(0,128)范围内。具体的,计算机设备可以获取每条子信息的生成时间,对每条子信息的生成时间进行编码,得到编码后的时间数据,根据随机数生成算法对编码后的时间数据进行处理,得到第三随机数;对第三随机数中的字节进行填充处理,得到填充处理后的第三随机数,对1个字节对应的8bit进行填充,例如可以将二进制填充为0或者1。也就是说,填充处理后的第三随机数与填充处理前的第三随机数对应的数值不同,且填充处理后的第三随机数小于随机数阈值。
由于对第三随机数进行填充处理,可以得到填充后的第三随机数,且对于一个第三随机数有多种填充方式,包括对8bit中的一位或者多位进行填充,因此填充后的第三随机数与填充前的第三随机数不相等,即使非法终端获取到每条子信息的生成时间以及得到第三随机数,由于第三随机数有多种填充方式,也难以获得正确的填充后的第三随机数,因此无法实现获取每条子信息对应的第一随机数,从而可以提高信息的安全性。
可选的,若每条子信息的属性信息包括每条子信息的有限期限,根据每条子信息的属性信息生成每条子信息对应的第一随机数的方法可以为:根据每条子信息的有限期限确定每条子信息的重要性等级,根据每条子信息的重要性等级生成第五随机数,对第五随机数中的字节进行截取处理或者填充处理,得到截取处理或者填充处理后的第五随机数;将截取处理或者填充处理后的第五随机数确定为每条子信息对应的第一随机数。
其中,截取处理或者填充处理后的第五随机数小于随机数阈值,且截取处理或者填充处理后的第五随机数中的字节长度小于第五随机数中的字节长度,即截取处理或者填充处理后的第五随机数与截取处理或者填充处理前的第五随机数对应的数值不同。每条子信息的有限期限越长,表示每条子信息的重要性等级越高;每条子信息的有限期限越短,表示每条子信息的重要性等级越低。计算机设备通过获取每条子信息的有效期限,确定该有效期限对应的该条子信息的重要性等级,使用随机数生成算法根据该条子信息的重要性等级生成第五随机数,通过对第五随机数中的字节进行截取处理或者填充处理,得到截取处理或者填充处理后的第五随机数;将截取处理或者填充处理后的第五随机数确定为每条子信息对应的第一随机数。由于对第五随机数可以有多种截取处理和填充处理方式,可以得到截取或者填充后的第五随机数,因此非法终端难以获得正确的截取或者填充后的第五随机数,因此无法实现获取每条子信息对应的第一随机数,从而可以提高信息的安全性。
S104,根据目标函数以及调整后的每条子信息,获取至少两条子信息中每条子信息对应的坐标信息。
这里,例如可以对调整后非数值类型的每条子信息进行编码,得到调整后数值类型的每条子信息对应的编码数据,将调整后数值类型的每条子信息对应的编码数据映射至目标 函数对应的曲线上得到对应的坐标点,从而根据该坐标点得到每条子信息对应的坐标信息。
在一种可能的实现方式中,可以获取目标函数对应的曲线,将调整后的每条子信息映射至该目标函数对应的曲线上的目标点的第一坐标;根据该第一坐标以及该目标函数,确定该目标函数对应的曲线上的目标点的第二坐标;将该第一坐标以及该第二坐标确定为每条子信息对应的坐标信息,从而获取到至少两条子信息中每条子信息对应的坐标信息。
举例来对获取至少两条子信息中任意一条子信息c对应的坐标信息进行说明,可以根据第一坐标和目标函数,确定该目标函数对应的曲线上的目标点的第二坐标,将该第一坐标以及该第二坐标确定为子信息c对应的坐标信息。例如,目标函数对应的曲线可以如公式(1-1)所示:
y 2=x 3+ax+b   (1-1)
其中,a和b均为已知的实数,x和y均为参数,通过确定x或者y中的任意一个参数的值,则可以通过公式(1-1)计算得到另一个参数的值,例如,通过确定x的值,根据公式(1-1)可计算得到y的值。
例如,a为1,b为-1,子信息c映射至该目标函数对应的曲线上的目标点的第一坐标(例如该目标点的横坐标)为1,将a,b以及该第一坐标作为x代入公式(1-1)中,得到y为1,即该目标函数对应的曲线上的目标点的第二坐标为1,则子信息c对应的坐标信息为(1,1),通过该方法,可以获取到至少两条子信息中其他子信息对应的坐标信息,从而获取到至少两条子信息中每条子信息对应的坐标信息。
S105,采用每条子信息对应的密钥,对至少两条子信息中每条子信息对应的坐标信息进行加密,得到每条子信息对应的坐标信息的密文。
这里,计算机设备可以采用每条子信息对应的密钥,对至少两条子信息中每条子信息对应的坐标信息进行加密,得到每条子信息对应的坐标信息的密文。具体实现中,计算机设备可以获取目标信息所属的终端的私钥,根据该终端的私钥和每条子信息对应的密钥,对至少两条子信息中每条子信息对应的坐标信息进行加密,得到每条子信息对应的坐标信息的密文。可知,子信息对应的坐标信息的密文为对子信息加密后的得到的密文,在未对其进行解密的情况下,即使获取到该密文也无法获知该密文对应的子信息的内容。通过使用目标信息所属的终端的私钥和每条子信息对应的密钥对目标信息对应的每条子信息进行加密,可以提高目标信息的安全性。
S106,将每条子信息对应的坐标信息的密文确定为目标信息的密文,将目标信息的密文存储至区块链网络中。
这里,上述步骤中,对于至少两条子信息中的每条子信息,都会得到每条子信息对应的坐标信息的密文,因此,将每条子信息对应的坐标信息的密文确定为目标信息的密文,也就是说,目标信息的密文包括至少两条子信息中的每条子信息对应的坐标信息的密文,至此,可以实现对目标信息进行加密得到目标信息的密文,可以将目标信息的密文存储至区块链网络中。通过将目标信息发送至区块链网络中进行加密以及存储,可以减少终端本地存储空间的资源占用,以及,可以避免目标信息存储在终端本地被非法用户篡改,提高目标信息的安全性。
本申请实施例中,由于每条子信息对应的第一随机数是根据每条子信息的属性信息生成的,而每条子信息的属性信息包括每条子信息的生成时间或者每条子信息的长度,非法终端难以获取到每条子信息的生成时间以及每条子信息的长度,即无法生成每条子信息对应的第一随机数,因此通过使用第一随机数对每条子信息进行调整,以及后续对调整后的子信息进行加密,可以提高信息的安全性。通过对至少两条子信息中每条子信息进行调整,有利于根据调整后的每条子信息生成调整后的每条子信息对应的坐标信息,提高获取调整 后的每条子信息对应的坐标信息的成功率。通过对目标信息中的每条子信息进行加密,避免非法终端对该密文进行破解,从而提高每条子信息的安全性,进而提高目标信息的安全性。通过将目标信息的密文信息存储至区块链网络中,基于区块链不可篡改且不易丢失的特性,可以提高信息的安全性;此外,将目标信息的密文存储至区块链网络中,可以减少终端本地存储空间的资源占用。
可选的,上述步骤S103中,根据第一随机数对每条子信息进行调整的方法可以如图2所示,图2是本申请实施例提供的一种对每条子信息进行调整的方法的流程示意图,如图2所示,该方法包括如下步骤:
S201,对每条子信息与第一随机数进行取余运算,得到取余后的每条子信息。
S202,若取余后的每条子信息小于信息阈值,则将取余后的每条子信息确定为调整后的每条子信息。
步骤S201~步骤S202中,取余运算是指两个数相除,对每条子信息与第一随机数进行取余运算即每条子信息除以第一随机数,将计算得到的结果作为取余后的每条子信息。这里,若取余后的每条子信息小于信息阈值,则认为将该条子信息映射至目标函数对应的曲线上的目标点的第一坐标,可以根据该第一坐标以及该目标函数,计算得到该目标函数对应的曲线上的目标点的第二坐标,即可以得到每条子信息对应的坐标信息。若取余后的每条子信息大于或等于信息阈值,则认为将该条子信息映射至目标函数对应的曲线上的目标点的第一坐标,无法根据该第一坐标以及该目标函数,计算得到该目标函数对应的曲线上的目标点的第二坐标,即无法得到每条子信息对应的坐标信息。其中,信息阈值例如可以为2 256,也可以小于2 256
通过对每条子信息与第一随机数进行取余运算,可以得到取余后的每条子信息,从而根据取余后的每条子信息与信息阈值的大小关系,将取余后的每条子信息确定为调整后的每条子信息。其中,对每条子信息与第一随机数取余可以是指将每条子信息对应的数值除以第一随机数,可知,取余后得到的每条子信息对应的数值小于的取余前的子信息对应的数值。
S203,若取余后的每条子信息大于或等于信息阈值,则调整第一随机数。
S204,对每条子信息与调整后的第一随机数进行取余运算,得到候选的每条子信息。
这里,由于取余后的每条子信息大于或等于信息阈值时,将该条子信息映射至目标函数对应的曲线上的目标点的第一坐标,无法根据该第一坐标以及该目标函数,计算得到该目标函数对应的曲线上的目标点的第二坐标,即无法得到每条子信息对应的坐标信息。因此,需要对每条子信息对应的第一随机数进行调整,并将调整后的每条子信息与第一随机数进行取余运算,得到候选的每条子信息。
S205,若候选的每条子信息小于信息阈值,则将候选的每条子信息确定为调整后的每条子信息。
可知,若候选的每条子信息小于信息阈值,将该条子信息映射至目标函数对应的曲线上的目标点的第一坐标,可以根据该第一坐标以及该目标函数,计算得到该目标函数对应的曲线上的目标点的第二坐标,即可以得到每条子信息对应的坐标信息。若候选的每条子信息大于或等于信息阈值,则认为将该条子信息映射至目标函数对应的曲线上的目标点的第一坐标,无法根据该第一坐标以及该目标函数,计算得到该目标函数对应的曲线上的目标点的第二坐标,即无法得到每条子信息对应的坐标信息。也就是说,若候选的每条子信息大于或等于信息阈值,则继续调整第一随机数,直到对候选的每条子信息与调整后的第一随机数进行取余运算,取余后的候选的每条子信息小于信息阈值,则将取余后的候选的每条子信息确定为调整后的每条子信息。
本申请实施例中,通过对每条子信息和每条子信息对应的第一随机数取余,以及不断 调整每条子信息对应的第一随机数,可以得到调整后的每条子信息,提高后续对每条子信息进行加密的成功率。
请参见图3,图3是本申请实施例提供的一种基于信息的属性生成随机数的信息处理方法的流程示意图,该方法应用于区块链网络中的节点。如图3所示,该方法包括:
S301,获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息。
S302,根据目标信息包含的用户信息生成目标信息对应的根密钥,根据根密钥生成每条子信息对应的密钥。
S303,根据每条子信息的属性信息生成每条子信息对应的第一随机数,根据第一随机数对每条子信息进行调整,得到调整后的每条子信息。
S304,根据目标函数以及调整后的每条子信息,获取至少两条子信息中每条子信息对应的坐标信息。
这里,步骤S301~S304的具体内容可以参考图1对应的实施例中步骤S101~S104的内容,此处不再赘述。
S305,获取目标信息所属的终端的私钥,以及每条子信息对应的密钥。
这里,目标信息所属的终端为上传目标信息至区块链网络中进行加密以及存储等处理的终端,目标信息所属的终端的私钥为通过该终端生成的私钥。
具体实现中,例如可以获取该目标信息所属终端的标识,采用SECP256K1算法生成第六随机数,对第六随机数进行填充,得到终端的私钥,该终端的私钥可以是指包括256位的数。这里,终端的标识可以是指终端的出厂编号,或者其他用于唯一指示该终端的标识。
S306,根据终端的私钥以及每条子信息对应的密钥,对至少两条子信息中每条子信息对应的坐标信息进行加密,得到每条子信息对应的坐标信息的密文。
本申请实施例中,可以获取目标函数的曲线的基点坐标;获取基点坐标与私钥的乘积,得到候选坐标;根据每条子信息对应的密钥对候选坐标进行加密,得到候选坐标的密文;对每条子信息对应的坐标信息与对应的候选坐标的密文进行融合,得到每条子信息对应的坐标信息的密文。
这里,通过获取目标函数的曲线,以及目标函数的曲线参数,可以获取该目标函数的曲线的基点坐标。例如基点为G,对应的基点坐标为(x1,y1),终端的私钥为h,则可以根据公式(1-2)计算得到候选坐标:
H=h*G   (1-2)
其中,候选坐标为H,基点为G,终端的私钥为h。
具体的,可以根据每条子信息对应的密钥对候选坐标进行加密,得到候选坐标的密文;对每条子信息对应的坐标信息与对应的候选坐标的密文进行融合,得到每条子信息对应的坐标信息的密文。
例如,目标信息对应的子信息的数量为n条,子信息i为n条子信息中的任意一条子信息,可以通过公式(1-3)的方式对候选坐标进行加密,得到候选坐标的密文,以及对子信息i对应的坐标信息与候选坐标的密文进行和融合,得到子信息i对应的坐标信息的密文。
Ci=Mi+ki*H   (1-3)
其中,候选坐标为H,Ci为子信息i对应的坐标信息的密文,Mi为子信息i对应的坐标信息,ki为子信息i对应的密钥。ki*H表示根据子信息i对应的密钥对候选坐标进行加密,得到候选坐标的密文。可知,对于n条子信息中的其他子信息,也可以通过公式(1-3)进行加密和融合,得到其他子信息对应的坐标信息的密文。对于每一条子信息,通过公式(1-3)进行加密和融合可以得到该条子信息对应的坐标信息的密文,也就是说,一条子信息对应一条子信息对应的坐标信息的密文的数量,即对于n条子信息,最终得到的子信息 对应的坐标信息的密文的数量为n。
具体实现中,可以采用加密算法对每条子信息对应的坐标信息进行加密,得到每条子信息对应的坐标信息的密文,加密算法例如可以包括Elgamal算法(一种非对称加密算法)、Rabin算法(一种非对称加密算法)、Diffie-Hellman算法(一种非对称加密算法)、ECC算法(椭圆曲线加密算法)。计算机设备根据终端的私钥以及每条子信息对应的密钥,对至少两条子信息中每条子信息对应的坐标信息进行加密,得到每条子信息对应的坐标信息的密文,可以实现对每条子信息进行加密,得到对应的密文,终端获取到每条子信息对应的密文后,需要进行解密,才能获知每条密文对应的子信息。
S307,将每条子信息对应的坐标信息的密文确定为目标信息的密文,将目标信息的密文存储至区块链网络中。
这里,步骤S307的具体内容可以参考图1对应的实施例中步骤S106的内容,此处不再赘述。
本申请实施例中,根据终端的私钥以及每条子信息对应的密钥,对至少两条子信息中每条子信息对应的坐标信息进行加密,得到每条子信息对应的坐标信息的密文,可以实现对每条子信息进行加密,得到对应的密文,终端获取到每条子信息对应的密文后,需要进行解密,才能获知每条密文对应的子信息。通过对每条子信息进行加密,即使非法终端获取到子信息对应的密文,由于无法实现解密,也无法获取到子信息的内容,因此可以保证每条子信息的安全性,从而保证目标信息的安全性。
上面介绍了本申请实施例的方法,下面介绍本申请实施例的装置。
参见图4,图4是本申请实施例提供的一种基于信息的属性生成随机数的信息处理装置的组成结构示意图,上述基于信息的属性生成随机数的信息处理装置可以是运行于计算机设备中的一个计算机程序(包括程序代码),例如该基于信息的属性生成随机数的信息处理装置为一个应用软件;该装置可以用于执行本申请实施例提供的方法中的相应步骤。该装置40包括:
信息获取模块401,用于获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息,该目标信息包括至少两条子信息,该每条子信息的属性信息包括该每条子信息的生成时间以及该每条子信息的长度中的至少一种;
密钥生成模块402,用于根据该目标信息包含的用户信息生成该目标信息对应的根密钥,根据该根密钥生成该每条子信息对应的密钥;
信息调整模块403,用于根据该每条子信息的属性信息生成该每条子信息对应的第一随机数,根据该第一随机数对该每条子信息进行调整,得到调整后的每条子信息;
坐标获取模块404,用于根据该目标函数以及该调整后的每条子信息,获取该至少两条子信息中每条子信息对应的坐标信息;
信息加密模块405,用于采用该每条子信息对应的密钥,对该至少两条子信息中的对应子信息的坐标信息进行加密,得到该每条子信息对应的坐标信息的密文;
信息存储模块406,用于将该每条子信息对应的坐标信息的密文确定为该目标信息的密文,将该目标信息的密文存储至区块链网络中。
可选的,该每条子信息的属性信息包括该每条子信息的长度,该信息调整模块403,具体用于:
根据该每条子信息的长度,确定该每条子信息对应的私密性等级;
根据该每条子信息对应的私密性等级生成第二随机数;
获取该第二随机数中的字节长度,根据该字节长度对该第二随机数进行截取处理,得到截取处理后的第二随机数;该截取处理后的第二随机数小于随机数阈值,该截取处理后的第二随机数中的字节长度小于该第二随机数中的字节长度;
将该截取处理后的第二随机数确定为该每条子信息对应的第一随机数。
可选的,该每条子信息的属性信息包括该每条子信息的生成时间,该信息调整模块403,具体用于:
对该每条子信息的生成时间进行编码,得到编码后的时间数据;
根据该编码后的时间数据生成第三随机数;
对该第三随机数中的字节进行填充处理,得到填充处理后的第三随机数,该填充处理后的第三随机数小于随机数阈值;
将该填充处理后的第三随机数确定为该每条子信息对应的第一随机数。
可选的,该信息调整模块403,具体用于:
对该每条子信息与该第一随机数进行取余运算,得到取余后的每条子信息;
若该取余后的每条子信息小于信息阈值,则将该取余后的每条子信息确定为调整后的每条子信息。
可选的,该目标信息包括第一子信息和第二子信息,该第二子信息的生成时间后于该第一子信息的生成时间;该密钥生成模块402,具体用于:
对该用户信息进行编码,得到编码后的用户数据;
根据该编码后的用户数据生成第四随机数;
对该第四随机数进行哈希运算,得到该根密钥;
对该根密钥进行哈希运算,得到该第一子信息的密钥;
对该第一子信息的密钥进行哈希运算,得到该第二子信息的密钥。
可选的,该信息加密模块405,具体用于:
获取该目标信息所属的终端的私钥,以及该每条子信息对应的密钥,该目标信息所属的终端为该每条子信息所属的机构对应的终端;
根据该私钥以及该每条子信息对应的密钥,对该至少两条子信息中每条子信息对应的坐标信息进行加密,得到该每条子信息对应的坐标信息的密文。
可选的,该信息加密模块405,具体用于:
获取该目标函数的曲线的基点坐标;
获取该基点坐标与该私钥的乘积,得到候选坐标;
根据该每条子信息对应的密钥对该候选坐标进行加密,得到该候选坐标的密文;
对该每条子信息对应的坐标信息与对应的候选坐标的密文进行融合,得到该每条子信息对应的坐标信息的密文。
需要说明的是,图4对应的实施例中未提及的内容可参见方法实施例的描述,这里不再赘述。
根据本申请的一个实施例,图1所示的一种基于信息的属性生成随机数的信息处理方法所涉及的步骤可由图4所示的一种基于信息的属性生成随机数的信息处理装置中的各个模块来执行。例如,图1中所示的步骤S101可由图4中的信息获取模块401来执行,图1中所示的步骤S102可由图4中的密钥生成模块402来执行;图1中所示的步骤S103可由图4中的信息调整模块403来执行;图1中所示的步骤S104可由图4中的坐标获取模块404来执行;图1中所示的步骤S105可由图4中的信息加密模块405来执行;图1中所示的步骤S106可由图4中的信息存储模块406来执行。根据本申请的一个实施例,图4所示的基于信息的属性生成随机数的信息处理中的各个模块可以分别或全部合并为一个或若干个单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个子单元,可以实现同样的操作,而不影响本申请的实施例的技术效果的实现。上述模块是基于逻辑功能划分的,在实际应用中,一个模块的功能也可以由多个单元来实现,或者多个模块的功能由一个单元实现。在本申请的其它实施例中,基于信息的属性生成随机数的信息处理装 置也可以包括其它单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。
根据本申请的另一个实施例,可以通过在包括中央处理单元(CPU)、随机存取存储介质(RAM)、只读存储介质(ROM)等处理元件和存储元件的例如计算机的通用计算机设备上运行能够执行如图1、图2和图3中所示的相应方法所涉及的各步骤的计算机程序(包括程序代码),来构造如图4中所示的基于信息的属性生成随机数的信息处理装置,以及来实现本申请实施例的基于信息的属性生成随机数的信息处理方法。上述计算机程序可以记载于例如计算机可读记录介质上,并通过计算机可读记录介质装载于上述计算设备中,并在其中运行。
本申请实施例中,由于每条子信息对应的第一随机数是根据每条子信息的属性信息生成的,而每条子信息的属性信息包括每条子信息的生成时间或者每条子信息的长度,非法终端难以获取到每条子信息的生成时间以及每条子信息的长度,即无法生成每条子信息对应的第一随机数,因此通过使用第一随机数对每条子信息进行调整,以及后续对调整后的子信息进行加密,可以提高信息的安全性。通过对至少两条子信息中每条子信息进行调整,有利于根据调整后的每条子信息生成调整后的每条子信息对应的坐标信息,提高获取调整后的每条子信息对应的坐标信息的成功率。通过对目标信息中的每条子信息进行加密,避免非法终端对该密文进行破解,从而提高每条子信息的安全性,进而提高目标信息的安全性。通过将目标信息的密文信息存储至区块链网络中,基于区块链不可篡改且不易丢失的特性,可以提高信息的安全性;此外,将目标信息的密文存储至区块链网络中,可以减少终端本地存储空间的资源占用。
参见图5,图5是本申请实施例提供的一种计算机设备的组成结构示意图。如图5所示,上述计算机设备50可以包括:处理器501,网络接口504和存储器505,此外,上述计算机设备50还可以包括:用户接口503,和至少一个通信总线502。其中,通信总线502用于实现这些组件之间的连接通信。其中,用户接口503可以包括显示屏(Display)、键盘(Keyboard),可选用户接口503还可以包括标准的有线接口、无线接口。网络接口504可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器505可以是高速RAM存储器,也可以是非易失性的存储器(non-volatile memory),例如至少一个磁盘存储器。存储器505可选的还可以是至少一个位于远离前述处理器501的存储装置。如图5所示,作为一种计算机可读存储介质的存储器505中可以包括操作系统、网络通信模块、用户接口模块以及设备控制应用程序。
在图5所示的计算机设备50中,网络接口504可提供网络通讯功能;而用户接口503主要用于为用户提供输入的接口;而处理器501可以用于调用存储器505中存储的设备控制应用程序,以实现:
获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息,该目标信息包括至少两条子信息,该每条子信息的属性信息包括该每条子信息的生成时间以及该每条子信息的长度中的至少一种;
根据该目标信息包含的用户信息生成该目标信息对应的根密钥,根据该根密钥生成该每条子信息对应的密钥;
根据该每条子信息的属性信息生成该每条子信息对应的第一随机数,根据该第一随机数对该每条子信息进行调整,得到调整后的每条子信息;
根据该目标函数以及该调整后的每条子信息,获取该至少两条子信息中每条子信息对应的坐标信息;
采用该每条子信息对应的密钥,对该至少两条子信息中的对应子信息的坐标信息进行加密,得到该每条子信息对应的坐标信息的密文;
将该每条子信息对应的坐标信息的密文确定为该目标信息的密文,将该目标信息的密文存储至区块链网络中。
应当理解,本申请实施例中所描述的计算机设备50可执行前文图1图2以及图3所对应实施例中对上述一种基于信息的属性生成随机数的信息处理方法的描述,也可执行前文图4所对应实施例中对上述一种基于信息的属性生成随机数的信息处理装置的描述,在此不再赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。
本申请实施例中,由于每条子信息对应的第一随机数是根据每条子信息的属性信息生成的,而每条子信息的属性信息包括每条子信息的生成时间或者每条子信息的长度,非法终端难以获取到每条子信息的生成时间以及每条子信息的长度,即无法生成每条子信息对应的第一随机数,因此通过使用第一随机数对每条子信息进行调整,以及后续对调整后的子信息进行加密,可以提高信息的安全性。通过对至少两条子信息中每条子信息进行调整,有利于根据调整后的每条子信息生成调整后的每条子信息对应的坐标信息,提高获取调整后的每条子信息对应的坐标信息的成功率。通过对目标信息中的每条子信息进行加密,避免非法终端对该密文进行破解,从而提高每条子信息的安全性,进而提高目标信息的安全性。通过将目标信息的密文信息存储至区块链网络中,基于区块链不可篡改且不易丢失的特性,可以提高信息的安全性;此外,将目标信息的密文存储至区块链网络中,可以减少终端本地存储空间的资源占用。
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序包括程序指令,该程序指令当被计算机执行时使该计算机执行如前述实施例该的方法,该计算机可以为上述提到的计算机设备的一部分。例如为上述的处理器501。作为示例,程序指令可被部署在一个计算机设备上执行,或者被部署位于一个地点的多个计算机设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个计算机设备上执行,分布在多个地点且通过通信网络互连的多个计算机设备可以组成区块链网络。
可选的,本申请涉及的存储介质如计算机可读存储介质可以是非易失性的,也可以是易失性的。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,该的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
以上所揭露的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属本申请所涵盖的范围。

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. 根据权利要求13所述的计算机设备,其中,执行所述根据所述私钥以及所述每条子信息对应的密钥,对所述至少两条子信息中每条子信息对应的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文,包括:
    获取所述目标函数的曲线的基点坐标;
    获取所述基点坐标与所述私钥的乘积,得到候选坐标;
    根据所述每条子信息对应的密钥对所述候选坐标进行加密,得到所述候选坐标的密文;
    对所述每条子信息对应的坐标信息与对应的候选坐标的密文进行融合,得到所述每条子信息对应的坐标信息的密文。
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序, 所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行以下方法:
    获取用于描述信息的目标函数,以及待处理的目标信息中每条子信息的属性信息,所述目标信息包括至少两条子信息,所述每条子信息的属性信息包括所述每条子信息的生成时间以及所述每条子信息的长度中的至少一种;
    根据所述目标信息包含的用户信息生成所述目标信息对应的根密钥,根据所述根密钥生成所述每条子信息对应的密钥;
    根据所述每条子信息的属性信息生成所述每条子信息对应的第一随机数,根据所述第一随机数对所述每条子信息进行调整,得到调整后的每条子信息;
    根据所述目标函数以及所述调整后的每条子信息,获取所述至少两条子信息中每条子信息对应的坐标信息;
    采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文;
    将所述每条子信息对应的坐标信息的密文确定为所述目标信息的密文,将所述目标信息的密文存储至区块链网络中。
  16. 根据权利要求15所述的计算机可读存储介质,其中,所述每条子信息的属性信息包括所述每条子信息的长度,执行所述根据所述每条子信息的属性信息生成所述每条子信息对应的第一随机数,包括:
    根据所述每条子信息的长度,确定所述每条子信息对应的私密性等级;
    根据所述每条子信息对应的私密性等级生成第二随机数;
    获取所述第二随机数中的字节长度,根据所述字节长度对所述第二随机数进行截取处理,得到截取处理后的第二随机数;所述截取处理后的第二随机数小于随机数阈值,所述截取处理后的第二随机数中的字节长度小于所述第二随机数中的字节长度;
    将所述截取处理后的第二随机数确定为所述每条子信息对应的第一随机数。
  17. 根据权利要求15所述的计算机可读存储介质,其中,所述每条子信息的属性信息包括所述每条子信息的生成时间,执行所述根据所述每条子信息的属性信息生成所述每条子信息对应的第一随机数,包括:
    对所述每条子信息的生成时间进行编码,得到编码后的时间数据;
    根据所述编码后的时间数据生成第三随机数;
    对所述第三随机数中的字节进行填充处理,得到填充处理后的第三随机数,所述填充处理后的第三随机数小于随机数阈值;
    将所述填充处理后的第三随机数确定为所述每条子信息对应的第一随机数。
  18. 根据权利要求15所述的计算机可读存储介质,其中,所述目标信息包括第一子信息和第二子信息,所述第二子信息的生成时间后于所述第一子信息的生成时间;
    执行所述根据所述目标信息包含的用户信息生成所述目标信息对应的根密钥,根据所述根密钥生成所述每条子信息对应的密钥,包括:
    对所述用户信息进行编码,得到编码后的用户数据;
    根据所述编码后的用户数据生成第四随机数;
    对所述第四随机数进行哈希运算,得到所述根密钥;
    对所述根密钥进行哈希运算,得到所述第一子信息的密钥;
    对所述第一子信息的密钥进行哈希运算,得到所述第二子信息的密钥。
  19. 根据权利要求15所述的计算机可读存储介质,其中,执行所述采用所述每条子信息对应的密钥,对所述至少两条子信息中的对应子信息的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文,包括:
    获取所述目标信息所属的终端的私钥,以及所述每条子信息对应的密钥;
    根据所述私钥以及所述每条子信息对应的密钥,对所述至少两条子信息中每条子信息对应的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文。
  20. 根据权利要求19所述的计算机可读存储介质,其中,执行所述根据所述私钥以及所述每条子信息对应的密钥,对所述至少两条子信息中每条子信息对应的坐标信息进行加密,得到所述每条子信息对应的坐标信息的密文,包括:
    获取所述目标函数的曲线的基点坐标;
    获取所述基点坐标与所述私钥的乘积,得到候选坐标;
    根据所述每条子信息对应的密钥对所述候选坐标进行加密,得到所述候选坐标的密文;
    对所述每条子信息对应的坐标信息与对应的候选坐标的密文进行融合,得到所述每条子信息对应的坐标信息的密文。
PCT/CN2021/097118 2020-09-29 2021-05-31 基于信息的属性生成随机数的信息处理方法、装置及设备 WO2022068235A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011056601.6 2020-09-29
CN202011056601.6A CN112202555B (zh) 2020-09-29 2020-09-29 基于信息的属性生成随机数的信息处理方法、装置及设备

Publications (1)

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

Family

ID=74007110

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/097118 WO2022068235A1 (zh) 2020-09-29 2021-05-31 基于信息的属性生成随机数的信息处理方法、装置及设备

Country Status (2)

Country Link
CN (1) CN112202555B (zh)
WO (1) WO2022068235A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112202555B (zh) * 2020-09-29 2023-07-18 平安科技(深圳)有限公司 基于信息的属性生成随机数的信息处理方法、装置及设备
CN112069525A (zh) * 2020-09-29 2020-12-11 深圳壹账通智能科技有限公司 基于信息的属性生成密钥的加密方法、装置及设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190182042A1 (en) * 2017-12-08 2019-06-13 ShoCard, Inc. Methods and systems for recovering data using dynamic passwords
CN110839026A (zh) * 2019-11-12 2020-02-25 深圳市网心科技有限公司 基于区块链的数据处理方法及相关设备
CN111553686A (zh) * 2020-04-27 2020-08-18 腾讯科技(深圳)有限公司 数据处理方法、装置、计算机设备及存储介质
CN112202555A (zh) * 2020-09-29 2021-01-08 平安科技(深圳)有限公司 基于信息的属性生成随机数的信息处理方法、装置及设备
CN112202554A (zh) * 2020-09-29 2021-01-08 平安科技(深圳)有限公司 基于信息的属性生成密钥的信息处理方法、装置及设备
CN112199697A (zh) * 2020-09-29 2021-01-08 深圳壹账通智能科技有限公司 基于共享根密钥的信息处理方法、装置、设备及介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110601815B (zh) * 2019-09-17 2021-09-10 腾讯科技(深圳)有限公司 一种区块链数据处理方法以及设备
CN110570197B (zh) * 2019-09-17 2021-04-13 腾讯科技(深圳)有限公司 一种基于区块链的数据处理方法以及设备
CN110881063B (zh) * 2019-11-20 2022-03-15 腾讯科技(深圳)有限公司 一种隐私数据的存储方法、装置、设备及介质
CN110958317B (zh) * 2019-11-29 2022-08-09 腾讯科技(深圳)有限公司 一种数据处理方法以及设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190182042A1 (en) * 2017-12-08 2019-06-13 ShoCard, Inc. Methods and systems for recovering data using dynamic passwords
CN110839026A (zh) * 2019-11-12 2020-02-25 深圳市网心科技有限公司 基于区块链的数据处理方法及相关设备
CN111553686A (zh) * 2020-04-27 2020-08-18 腾讯科技(深圳)有限公司 数据处理方法、装置、计算机设备及存储介质
CN112202555A (zh) * 2020-09-29 2021-01-08 平安科技(深圳)有限公司 基于信息的属性生成随机数的信息处理方法、装置及设备
CN112202554A (zh) * 2020-09-29 2021-01-08 平安科技(深圳)有限公司 基于信息的属性生成密钥的信息处理方法、装置及设备
CN112199697A (zh) * 2020-09-29 2021-01-08 深圳壹账通智能科技有限公司 基于共享根密钥的信息处理方法、装置、设备及介质

Also Published As

Publication number Publication date
CN112202555A (zh) 2021-01-08
CN112202555B (zh) 2023-07-18

Similar Documents

Publication Publication Date Title
US11501533B2 (en) Media authentication using distributed ledger
US10860710B2 (en) Processing and storing blockchain data under a trusted execution environment
CN110915164A (zh) 基于可信执行环境中执行的智能合约操作处理区块链数据
WO2022068237A1 (zh) 基于信息的属性生成密钥的信息处理方法、装置及设备
CN112988764B (zh) 数据存储方法、装置、设备和存储介质
US10791122B2 (en) Blockchain user account data
US11057220B2 (en) Signature verification for a blockchain ledger
WO2022068362A1 (zh) 一种基于区块链的信息处理方法、装置、设备及介质
WO2022068360A1 (zh) 基于共享根密钥的信息处理方法、装置、设备及介质
WO2022068236A1 (zh) 基于信息的特征进行信息处理的方法、装置、设备及介质
US11489660B2 (en) Re-encrypting data on a hash chain
WO2022068235A1 (zh) 基于信息的属性生成随机数的信息处理方法、装置及设备
WO2022068356A1 (zh) 基于区块链的信息加密方法、装置、设备及介质
WO2021109718A1 (zh) 一种基于区块链系统的验证方法及装置
WO2022068358A1 (zh) 基于信息的属性生成密钥的加密方法、装置及设备
WO2022068355A1 (zh) 基于信息的特征的加密方法、装置、设备及储存介质
WO2022068234A1 (zh) 基于共享根密钥的加密方法、装置、设备及介质
WO2022068359A1 (zh) 对信息的密文进行压缩的加密方法、装置、设备及介质
US20230336355A1 (en) Data protection on distributed data storage (dds) protection networks
WO2022068361A1 (zh) 基于修正量的加密方法、装置、设备及介质
CN111292082B (zh) 一种块链式账本中的公钥管理方法、装置及设备
CN112202453A (zh) 对密文进行压缩的信息处理方法、装置、设备及介质
CN112925853A (zh) 基于区块链的可信数据交换方法、装置、终端设备和介质
CN116112268A (zh) 数据处理方法、装置、计算机设备和存储介质

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21873897

Country of ref document: EP

Kind code of ref document: A1