CN112202555B - Information processing method, device and equipment for generating random number based on information attribute - Google Patents

Information processing method, device and equipment for generating random number based on information attribute Download PDF

Info

Publication number
CN112202555B
CN112202555B CN202011056601.6A CN202011056601A CN112202555B CN 112202555 B CN112202555 B CN 112202555B CN 202011056601 A CN202011056601 A CN 202011056601A CN 112202555 B CN112202555 B CN 112202555B
Authority
CN
China
Prior art keywords
information
piece
sub
random number
sub information
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202011056601.6A
Other languages
Chinese (zh)
Other versions
CN112202555A (en
Inventor
贾牧
陆陈一帆
谢丹力
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202011056601.6A priority Critical patent/CN112202555B/en
Publication of CN112202555A publication Critical patent/CN112202555A/en
Priority to PCT/CN2021/097118 priority patent/WO2022068235A1/en
Application granted granted Critical
Publication of CN112202555B publication Critical patent/CN112202555B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Landscapes

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

Abstract

The embodiment of the application discloses an information processing method, an information processing device and information processing equipment for generating random numbers based on information attributes, which mainly relate to a block chain technology and a medical platform technology, wherein the method comprises the following steps: acquiring an objective function for describing information and attribute information of each piece of sub information in the objective information; generating a root key according to user information contained in the target information, and generating a key corresponding to each piece of sub information according to the root key; generating a first random number corresponding to each piece of sub information according to the attribute information of each piece of sub information, and adjusting each piece of sub information according to the first random number to obtain each piece of adjusted sub information; acquiring coordinate information of each piece of sub information according to the objective function and each piece of sub information after adjustment; and encrypting the coordinate information of each piece of sub information by adopting a key corresponding to each piece of sub information to obtain the ciphertext of the target information, and storing the ciphertext of the target information into the blockchain network. By adopting the embodiment of the application, the information security can be improved.

Description

Information processing method, device and equipment for generating random number based on information attribute
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to an information processing method, apparatus, and device for generating random numbers based on information attributes.
Background
In the age of rapid development of the network, more and more information is interacted and stored through the network. The traditional information storage mode is generally a terminal local storage mode, for example, a medical platform can use a terminal to store medical record information, patient information and other information of each patient in the terminal local, the information storage mode has a large risk, an illegal terminal can easily acquire the locally stored information to cause information leakage, an illegal user can tamper with the locally stored information to cause lower information security, and when the local storage fails, the information cannot be retrieved, so that loss is caused. Therefore, how to ensure the security of information in the information storage process and prevent information leakage is a problem to be solved.
Disclosure of Invention
The embodiment of the application provides an information processing method, device and equipment for generating random numbers based on information attributes, which can encrypt information, improve information security and prevent information leakage.
An aspect of an embodiment of the present application provides an information processing method for generating a random number based on an attribute of information, including:
acquiring an objective function for describing information and attribute information of each piece of sub information in target information to be processed, wherein the target information comprises at least two pieces of sub information, and the attribute information of each piece of sub information comprises at least one of generation time of each piece of sub information and length of each piece of sub information;
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;
generating a first random number corresponding to each piece of sub information according to the attribute information of each piece of sub information, and adjusting each piece of sub information according to the first random number to obtain each piece of adjusted sub information;
acquiring 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 sub information after adjustment;
encrypting the coordinate information of the corresponding sub information in the at least two pieces of sub information by adopting the secret key corresponding to each piece of sub information to obtain the ciphertext of the coordinate information corresponding to each piece of sub information;
And determining the ciphertext of the coordinate information corresponding to each piece of sub information as the ciphertext of the target information, and storing the ciphertext of the target information into a block chain network.
Optionally, the attribute information of each piece of sub information includes a length of each piece of sub information, and the generating the first random number corresponding to each piece of sub information according to the attribute information of each piece of sub information includes: determining the privacy level corresponding to each piece of sub-information according to the length of each piece of sub-information; generating a second random number according to the privacy level corresponding to each piece of sub-information; acquiring the byte length in the second random number, and intercepting the second random number according to the byte length to obtain an intercepted second random number; the intercepted second random number is smaller than a random number threshold value, and the byte length in the intercepted second random number is smaller than the byte length in the second random number; and determining the intercepted second random number as the first random number corresponding to each piece of sub information.
Optionally, the attribute information of each piece of sub information includes a generation time of each piece of sub information, and the generating the first random number corresponding to each piece of sub information according to the attribute information of each piece of sub information includes: encoding the generation time of each piece of sub information to obtain encoded time data; generating a third random number according to the encoded time data; filling the bytes in the third random number to obtain a filled third random number, wherein the filled third random number is smaller than a random number threshold; and determining the third random number after the filling processing as the first random number corresponding to each piece of sub information.
Optionally, the adjusting the piece of sub information according to the first random number to obtain each piece of adjusted sub information includes: performing remainder operation on each piece of sub information and the first random number to obtain each piece of sub information after remainder; and if the obtained piece of sub information is smaller than the information threshold value, determining the obtained piece of sub information as the adjusted piece of sub information.
Optionally, the target information includes a first sub-information and a second sub-information, and the generation time of the second sub-information is later than the generation time of the first sub-information; the 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, includes: encoding the user information to obtain encoded user data; generating a fourth random number according to the encoded user data; performing hash operation on the fourth random number to obtain the root key; carrying out hash operation on the root key to obtain a key of the first sub-information; and carrying out hash operation on the key of the first sub-information to obtain the key of the second sub-information.
Optionally, the 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 piece of sub information includes: acquiring a private key of a terminal to which the target information belongs and a secret key corresponding to each piece of sub information, wherein the terminal to which the target information belongs is a terminal corresponding to a mechanism to which each piece of sub information belongs; and encrypting 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 to obtain the ciphertext of the coordinate information corresponding to each piece of sub information.
Optionally, the encrypting 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 to obtain the ciphertext of the coordinate information corresponding to each piece of sub information includes: obtaining the base point coordinates of the curve of the objective function; obtaining the product of the base point coordinates and the private key to obtain candidate coordinates; encrypting the candidate coordinates according to the secret key corresponding to each piece of sub information to obtain ciphertext of the candidate coordinates; and fusing the coordinate information corresponding to each piece of sub information with the ciphertext of the corresponding candidate coordinate to obtain the ciphertext of the coordinate information corresponding to each piece of sub information.
An aspect of an embodiment of the present application provides an information processing apparatus that generates a random number based on an attribute of information, including:
an information acquisition module, configured to acquire an objective function for describing information, and attribute information of each piece of sub information in target information to be processed, where 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 generation time of each piece of sub information and length of each piece of sub information;
the key generation module is used 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;
The information adjustment module is used for generating a first random number corresponding to each piece of sub information according to the attribute information of each piece of sub information, and adjusting each piece of sub information according to the first random number to obtain each piece of adjusted sub information;
the coordinate acquisition module is used for acquiring coordinate information corresponding to each piece of sub information in the at least two pieces of sub information according to the objective function and the adjusted piece of sub information;
the information encryption module is used for encrypting the coordinate information of the corresponding sub information in the at least two pieces of sub information by adopting the secret key corresponding to each piece of sub information to obtain the ciphertext of the coordinate information corresponding to each piece of sub information;
and the information storage module is used for determining the ciphertext of the coordinate information corresponding to each piece of sub information as the ciphertext of the target information and storing the ciphertext of the target information into the blockchain network.
Optionally, the attribute information of each piece of sub information includes a length of each piece of sub information, and the information adjustment module is specifically configured to: determining the privacy level corresponding to each piece of sub-information according to the length of each piece of sub-information; generating a second random number according to the privacy level corresponding to each piece of sub-information; acquiring the byte length in the second random number, and intercepting the second random number according to the byte length to obtain an intercepted second random number; the intercepted second random number is smaller than a random number threshold value, and the byte length in the intercepted second random number is smaller than the byte length in the second random number; and determining the intercepted second random number as the first random number corresponding to each piece of sub information.
Optionally, the attribute information of each piece of sub information includes a generation time of each piece of sub information, and the information adjustment module is specifically configured to: encoding the generation time of each piece of sub information to obtain encoded time data; generating a third random number according to the encoded time data; filling the bytes in the third random number to obtain a filled third random number, wherein the filled third random number is smaller than a random number threshold; and determining the third random number after the filling processing as the first random number corresponding to each piece of sub information.
Optionally, the information adjustment module is specifically configured to: performing remainder operation on each piece of sub information and the first random number to obtain each piece of sub information after remainder; and if the obtained piece of sub information is smaller than the information threshold value, determining the obtained piece of sub information as the adjusted piece of sub information.
Optionally, the target information includes a first sub-information and a 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 is specifically configured to: encoding the user information to obtain encoded user data; generating a fourth random number according to the encoded user data; performing hash operation on the fourth random number to obtain the root key; carrying out hash operation on the root key to obtain a key of the first sub-information; and carrying out hash operation on the key of the first sub-information to obtain the key of the second sub-information.
Optionally, the information encryption module is specifically configured to: acquiring a private key of a terminal to which the target information belongs and a secret key corresponding to each piece of sub information, wherein the terminal to which the target information belongs is a terminal corresponding to a mechanism to which each piece of sub information belongs; and encrypting 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 to obtain the ciphertext of the coordinate information corresponding to each piece of sub information.
Optionally, the information encryption module is specifically configured to: obtaining the base point coordinates of the curve of the objective function; obtaining the product of the base point coordinates and the private key to obtain candidate coordinates; encrypting the candidate coordinates according to the secret key corresponding to each piece of sub information to obtain ciphertext of the candidate coordinates; and fusing the coordinate information corresponding to each piece of sub information with the ciphertext of the corresponding candidate coordinate to obtain the ciphertext of the coordinate information corresponding to each piece of sub information.
In one aspect, the present application provides a computer device comprising: a processor, a memory, a network interface;
the processor is connected to a memory and a network interface, wherein the network interface is used for providing a data communication function, the memory is used for storing a computer program, and the processor is used for calling the computer program to execute the method in the aspect in the embodiment of the application.
An aspect of the present application provides a computer-readable storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform an information processing method of the first aspect described above for generating random numbers based on an attribute of information.
In this embodiment of the present invention, since the first random number corresponding to each piece of sub information is generated according to the attribute information of each piece of sub information, and the attribute information of each piece of sub information includes the generation time of each piece of sub information or the length of each piece of sub information, the generation time of each piece of sub information and the length of each piece of sub information are difficult for an illegal terminal to obtain, that is, the first random number corresponding to each piece of sub information cannot be generated, so that the security of the information can be improved by adjusting each piece of sub information by using the first random number and encrypting the adjusted sub information subsequently. And the method is beneficial to generating the coordinate information corresponding to each piece of adjusted sub information according to each piece of adjusted sub information by adjusting each piece of sub information in at least two pieces of sub information, so that the success rate of acquiring the coordinate information corresponding to each piece of adjusted sub information is improved. By encrypting each piece of sub information in the target information, the illegal terminal is prevented from cracking the ciphertext, so that the safety of each piece of sub information is improved, and the safety of the target information is further improved. By storing ciphertext information of the target information into the blockchain network, the security of the information can be improved based on the characteristics that the blockchain is not tamperable and is not easy to lose; in addition, the ciphertext of the target information is stored in the blockchain network, so that the resource occupation of the local storage space of the terminal can be reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of an information processing method for generating a random number based on an attribute of information according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for adjusting each piece of sub information according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of an information processing method for generating random numbers based on information attributes according to an embodiment of the present application;
fig. 4 is a schematic diagram of a composition structure of an information processing apparatus for generating a random number based on an attribute of information provided in an embodiment of the present application;
fig. 5 is a schematic diagram of a composition structure of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The blockchain related to the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission (P2P transmission), consensus mechanism, encryption algorithm and the like, is essentially a decentralised database, and is a series of data blocks which are generated by correlation by using a cryptography method, and each data block contains information of a batch of network transactions and is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, and an application service layer; the blockchain may be composed of a plurality of serial transaction records (also known as blocks) that are cryptographically concatenated and protected from content, and the distributed ledgers concatenated by the blockchain enable multiple parties to effectively record transactions and permanently verify the transactions (non-tamperable). The consensus mechanism is a mathematical algorithm for realizing trust establishment and rights acquisition among different nodes in the blockchain network; that is, the consensus mechanism is a mathematical algorithm commonly recognized by the network nodes of the blockchain.
The method and the system are suitable for the medical platform, the target information can be patient medical record information, patient information and the like, the patient medical record information, the patient information and other information of the medical platform are encrypted, and the encrypted information is stored in the blockchain network, so that the management of the patient medical record information, the patient information and the like is facilitated, and the safety of the patient information is improved.
Referring to fig. 1, fig. 1 is a flowchart of an information processing method for generating random numbers based on information attributes, which is provided in an embodiment of the present application, and the method is applied to a node in a blockchain network, where the node may be an independent physical server, may be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and an artificial intelligence platform. Alternatively, the node may refer to a computer device, including a mobile phone, a tablet computer, a notebook computer, a palm computer, a smart sound, a mobile internet device (MID, mobile internet device), a POS (Point Of sale) machine, a wearable device (e.g., a smart watch, a smart bracelet, etc.), and so on. As shown in fig. 1, the method includes:
s101, acquiring an objective function for describing information and attribute information of each piece of sub information in the target information to be processed.
Here, the objective function may refer to a function corresponding to an elliptic curve, and the objective function may refer to a function corresponding to another curve. The target information includes at least two pieces of sub information, and the target information may refer to transaction data, business data, internal data of a certain institution, and the like. The attribute information of each piece of sub information in the target information includes at least one of a generation time of each piece of sub information and a length of each piece of sub information. The objective function is used for describing the objective information, namely, converting the objective information into coordinate information corresponding to the objective function, so that the safety of the objective information is improved.
S102, 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.
The target information comprises 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 organization code of an organization to which the user belongs, and the like. If the target information only comprises one piece of user information, generating a root key corresponding to the target information according to the one piece of user information; if the target information only contains a plurality of user information, generating a root key corresponding to the target information according to the plurality of user information, namely generating the root key corresponding to the target information according to any one user information or any plurality of user information in the plurality of user information.
In this embodiment of the present application, a method for generating a root key corresponding to target information according to user information included in the target information includes: encoding the user information to obtain encoded user data; generating a fourth random number according to the encoded user data; and carrying out hash operation on the fourth random number to obtain a root key corresponding to the target information.
Specifically, the computer equipment encodes the user information by acquiring the user information contained in the target information to obtain encoded user data, then invokes a rand function in the C language, returns a random number, namely a fourth random number, according to the encoded user data, and obtains a root key corresponding to the target information by carrying out hash operation on the fourth random number. For example, a fourth random number k is generated from the encoded data; hash operation is performed on the fourth random number k, that is, hash (k) =k1, and k1 is used as the root key corresponding to the target information. Alternatively, other random number generation algorithms may be used to generate the fourth random number, such as the center limit theorem and Box Muller (coordinate transformation method), the monte carlo algorithm, the numerical probability algorithm, the Las Vegas algorithm, or other random number generation algorithms. The user information is encoded to obtain encoded user data, and a fourth random number is generated according to the encoded user data, and the root key corresponding to the target information is obtained after hash operation is performed on the fourth random number, namely, the random number is encrypted by adopting a hash operation method, so that the security of the root key corresponding to the target information can be improved.
In this embodiment of the present application, the method for generating the key corresponding to each piece of sub information according to the root key may be: performing hash operation on the root key corresponding to the target information to obtain a key of the first sub-information; and carrying out hash operation on the key of the first sub-information to obtain the key of the second sub-information.
For example, the root key corresponding to the target information is n, the target information includes 2 pieces of sub information respectively including sub information a1 and sub information a2, and the generation time corresponding to the 2 pieces of sub information is t1, t2, and t1> t2 respectively, so that the first sub information is sub information a1, the second sub information is sub information a2, and hash operation is performed on the root key corresponding to the target information to obtain the key of the first sub information, that is, hash (n) =n1, and n1 is the key of the first sub information; hash operation is performed on the key of the first sub-information to obtain a key of the second sub-information, that is, hash (n 1) =n2, and n2 is the key of the second sub-information.
If the number of the second sub-information is greater than 1, if the number of the second sub-information is 3, the second sub-information is respectively sub-information a2, sub-information a3 and sub-information a4, the generation time of the 3 pieces of the second sub-information is respectively t2, t3 and t4, and t2> t3> t4, and the key of the first sub-information is n1, hash operation is performed on the key of the first sub-information to obtain the key of the second sub-information a2, that is, hash (n 1) =n2, and n2 is the key of the sub-information a 2; performing hash operation on the key of the second sub-information a2 to obtain a key of the second sub-information a3, namely, hash (n 2) =n3, and n3 is the key of the sub-information a 3; hash operation is performed on the key of the second sub-information a3 to obtain the key of the second sub-information a4, that is, hash (n 3) =n4, and n4 is the key of the sub-information a 4. Thus, the key corresponding to each piece of sub information can be calculated. Since each piece of sub information is determined according to the generation time of each piece of sub information, the generation time of different pieces of sub information is different, so that the first sub information and the second sub information are different, and the obtained secret key corresponding to each piece of sub information is also different; the key corresponding to the sub information is obtained by carrying out hash operation on the root key, so that the difficulty of the key corresponding to the sub information can be improved, and when each piece of sub information is encrypted by using the key corresponding to the sub information later, the encryption difficulty can be improved, the probability of cracking the ciphertext by an illegal terminal is reduced, and the information security is improved.
Optionally, the target information includes first sub information and second sub information, and an information occupation space of the second sub information is smaller than an information occupation space of the first sub information. The method for generating the root key corresponding to the target information according to the user information contained in the target information and generating the key corresponding to each piece of sub information according to the root key can be as follows: encoding the user information to obtain encoded user data; generating a fourth random number according to the encoded user data; performing hash operation on the fourth random number to obtain a root key corresponding to the target information; performing hash operation on the root key corresponding to the target information to obtain a key of the first sub-information; and carrying out hash operation on the key of the first sub-information to obtain the key of the second sub-information.
The information space of the information refers to the size of the resource space occupied when the information is stored, and for example, the size of the information space of the information can be represented by bytes (B), kilobytes (KB), megabytes (MB), gigabytes (GB), and the like, and B < KB < MB < GB. For example, if the information space occupied by the sub-information 1 is 3KB and the information space occupied by the sub-information 2 is 1KB, the sub-information 1 is the first sub-information and the sub-information 2 is the second sub-information. The root key corresponding to the target information is m, hash operation is carried out on the root key corresponding to the target information to obtain a key of the first sub-information, namely, hash (m) =m1, and m1 is the key of the first sub-information; hash operation is performed on the key of the first sub-information to obtain a key of the second sub-information, that is, hash (m 1) =m2, and m2 is the key of the second sub-information. Thus, the key corresponding to each piece of sub information can be calculated. Because each piece of sub information is determined according to the information occupation space of each piece of sub information, the first sub information and the second sub information are different due to the fact that the information occupation space of different pieces of sub information is different, and therefore the obtained secret keys corresponding to each piece of sub information are also different; the key corresponding to the sub information is obtained by carrying out hash operation on the root key, so that the difficulty of the key corresponding to the sub information can be improved, and when each piece of sub information is encrypted by using the key corresponding to the sub information later, the encryption difficulty can be improved, the probability of cracking the ciphertext by an illegal terminal is reduced, and the information security is improved.
And S103, generating a first random number corresponding to each piece of sub information according to the attribute information of each piece of sub information, and adjusting each piece of sub information according to the first random number to obtain each piece of adjusted sub information.
Here, when the value corresponding to each piece of sub information is greater than the first threshold value, mapping of each piece of sub information onto the curve of the objective function cannot be achieved, and then the coordinate point corresponding to each piece of sub information cannot be obtained according to the curve calculation of the objective function. Therefore, the first random number can be used for adjusting each piece of sub information, so that the value corresponding to each piece of adjusted sub information is smaller than or equal to a first threshold value, mapping of each piece of sub information onto the curve of the objective function is achieved, and the coordinate point corresponding to each piece of sub information is obtained through calculation according to the curve of the objective function. By adjusting each piece of sub information by using the first random number, the probability of acquiring the coordinate point corresponding to each piece of sub information can be improved, so that the probability of successful encryption is improved. The first threshold value can be determined according to the curve parameter corresponding to the objective function, and if the curve parameter is the curve length c, the first threshold value is 2 256 -w, wherein w is a very small number. The random number may be generated using the random number generation algorithm mentioned above.
Here, if each piece of sub information is not the data of the numerical value type, each piece of sub information may be encoded to obtain encoded data of the numerical value 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 to obtain each piece of adjusted sub information. And if each piece of sub information is the data of the numerical value type, adjusting each piece of sub information according to the first random number corresponding to each piece of sub information to obtain each piece of adjusted sub information. It is known that each piece of the adjusted sub information includes the piece of sub information and the first random number corresponding to the piece of sub information.
Optionally, if the attribute information of each piece of sub information includes the length of each 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: determining the privacy level corresponding to each piece of sub-information according to the length of each piece of sub-information; generating a second random number according to the privacy level corresponding to each piece of sub information; acquiring byte length in the second random number, and intercepting the second random number according to the byte length to obtain an intercepted second random number; and determining the intercepted second random number as the first random number corresponding to each piece of sub information.
The length of the bytes in the intercepted second random number is smaller than the length of the bytes in the second random number. The random number threshold may be, for example, in the range of (0,128). The byte length in the second random number refers to the number of bytes corresponding to the second random number, for example, the second random number is a number between 0 and 255, the corresponding byte length is 1, or if the second random number is a number greater than 255, the byte length is greater than 1, etc. The 1 byte corresponds to 8 bits (i.e., bits), that is, for example, the byte length in the second random number is 1, and corresponds to 8 bits, then the byte length in the second random number after the interception process is smaller than 8 bits, for example, may be 7 bits, 6 bits, 5 bits, and so on.
Specifically, the computer device may obtain 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, the higher the privacy level of the sub information is; if the length of the sub information is shorter, 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, setting the privacy level of the sub information to a first privacy level; and setting the privacy level of the sub-information to a second privacy level when the length of the sub-information is greater than the second length threshold. If the privacy level corresponding to a piece of sub-information is the second privacy level, generating a second random number according to the privacy level corresponding to the piece of sub-information, then obtaining the byte length of the second random number, intercepting the second random number according to the byte length to obtain the intercepted second random number, for example, intercepting 8 bits corresponding to 1 byte, for example, any 1bit in 8 bits, or intercepting 2 bits, 3 bits, 5 bits, and the like. That is, the second random number after the interception processing is different from the value corresponding to the second random number before the interception processing.
Because the second random number is intercepted, the intercepted second random number can be obtained, and a plurality of intercepting modes are available for one second random number, including intercepting one or more bits in 8 bits, so that the intercepted second random number is unequal to the second random number before interception, even if an illegal terminal obtains the length of each piece of sub information and obtains the second random number, the second random number is difficult to obtain the correct intercepted second random number due to the plurality of intercepting modes, and therefore the first random number corresponding to each piece of sub information cannot be obtained, and the safety of the information can be improved.
Optionally, if the attribute information of each piece of sub information includes a generation time of each 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: encoding the generation time of each piece of sub information to obtain encoded time data; generating a third random number according to the encoded time data; filling the bytes in the third random number to obtain a filled third random number; and determining the third random number after the filling processing as the first random number corresponding to each piece of sub information.
The third random number after the filling process is smaller than a random number threshold, and the random number threshold may be, for example, within a range of (0,128). Specifically, the computer device may obtain the generation time of each piece of sub information, encode the generation time of each piece of sub information to obtain encoded time data, and process the encoded time data according to a random number generation algorithm to obtain a third random number; and (3) performing padding treatment on the bytes in the third random number to obtain a third random number after the padding treatment, and padding 8 bits corresponding to 1 byte, for example, binary padding can be performed to 0 or 1. That is, the third random number after the filling process is different from the value corresponding to the third random number before the filling process, and the third random number after the filling process is smaller than the random number threshold.
The third random number after filling can be obtained by filling the third random number, and a plurality of filling modes are available for one third random number, including filling one or more bits in 8 bits, so that the third random number after filling is unequal to the third random number before filling, even if the illegal terminal obtains the generation time of each piece of sub information and obtains the third random number, the third random number after filling is difficult to obtain the correct third random number due to the plurality of filling modes, and therefore the first random number corresponding to each piece of sub information cannot be obtained, and the safety of the information can be improved.
Optionally, if the attribute information of each piece of sub information includes a finite term of each 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: determining the importance level of each piece of sub information according to the limited period limit of each piece of sub information, generating a fifth random number according to the importance level of each piece of sub information, and performing interception processing or filling processing on bytes in the fifth random number to obtain a fifth random number after interception processing or filling processing; and determining the fifth random number after the interception processing or the filling processing as a first random number corresponding to each piece of sub information.
The fifth random number after the interception processing or the filling processing is smaller than the random number threshold value, and the byte length in the fifth random number after the interception processing or the filling processing is smaller than the byte length in the fifth random number, namely the fifth random number after the interception processing or the filling processing is different from the value corresponding to the fifth random number before the interception processing or the filling processing. The longer the limited term of each piece of sub information, the higher the importance level of each piece of sub information; the shorter the limited term of each piece of sub information, the lower the importance level of each piece of sub information. The computer equipment determines the importance level of each piece of sub information corresponding to the valid period by acquiring the valid period of the piece of sub information, generates a fifth random number according to the importance level of the piece of sub information by using a random number generation algorithm, and obtains the fifth random number after interception or filling by intercepting or filling bytes in the fifth random number; and determining the fifth random number after the interception processing or the filling processing as a first random number corresponding to each piece of sub information. Because the fifth random number can be subjected to various intercepting processing and filling processing modes, the intercepted or filled fifth random number can be obtained, and therefore an illegal terminal is difficult to obtain the correct intercepted or filled fifth random number, and therefore the first random number corresponding to each piece of sub information cannot be obtained, and the information security can be improved.
S104, acquiring coordinate information corresponding to each piece of sub information in at least two pieces of sub information according to the objective function and each piece of sub information after adjustment.
Here, for example, each piece of sub information of the adjusted non-numerical value type may be encoded to obtain encoded data corresponding to each piece of sub information of the adjusted numerical value type, and the encoded data corresponding to each piece of sub information of the adjusted numerical value type is mapped onto a curve corresponding to the objective function to obtain a corresponding coordinate point, so that coordinate information corresponding to each piece of sub information is obtained according to the coordinate point.
In one possible implementation manner, a curve corresponding to the objective function may be obtained, and each piece of adjusted sub information is mapped to a first coordinate of a target point on the curve corresponding to the objective function; determining a second coordinate of a target point on a curve corresponding to the target function according to the first coordinate and the target function; and determining the first coordinate and the second coordinate as coordinate information corresponding to each piece of sub information, thereby acquiring the coordinate information corresponding to each piece of sub information in at least two pieces of sub information.
For example, describing the coordinate information corresponding to any piece of sub information c in at least two pieces of sub information, a second coordinate of a target point on a curve corresponding to the target function may be determined according to the first coordinate and the target function, and the first coordinate and the second coordinate are determined as the coordinate information corresponding to the sub information c. For example, the curve corresponding to the objective function may be as shown in formula (1-1):
y 2 =x 3 +ax+b(1-1)
Where a and b are known real numbers, x and y are parameters, and by determining the value of any one of x or y, the value of the other parameter can be calculated by the formula (1-1), for example, by determining the value of x, the value of y can be calculated according to the formula (1-1).
For example, a is 1, b is-1, the first coordinate of the target point on the curve corresponding to the objective function (for example, the abscissa of the target point) mapped to the sub information c is 1, and a, b and the first coordinate are substituted as x into the formula (1-1), so that y is 1, that is, the second coordinate of the target point on the curve corresponding to the objective function is 1, the coordinate information corresponding to the sub information c is (1, 1), and by this method, the coordinate information corresponding to other sub information in at least two pieces of sub information can be obtained, so that the coordinate information corresponding to each piece of sub information in at least two pieces of sub information can be obtained.
S105, encrypting the coordinate information corresponding to each piece of sub information in at least two pieces of sub information by adopting the key corresponding to each piece of sub information, and obtaining the ciphertext of the coordinate information corresponding to each piece of sub information.
Here, the computer device may encrypt the coordinate information corresponding to each piece of sub information in the at least two pieces of sub information using the key corresponding to each piece of sub information, to obtain the ciphertext of the coordinate information corresponding to each piece of sub information. In a specific implementation, the computer device may obtain a private key of a terminal to which the target information belongs, and encrypt 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 a key corresponding to each piece of sub information, to obtain ciphertext of the coordinate information corresponding to each piece of sub information. It is known that the ciphertext of the coordinate information corresponding to the sub-information is the ciphertext obtained by encrypting the sub-information, and even if the ciphertext is obtained, the content of the sub-information corresponding to the ciphertext cannot be obtained without decrypting the ciphertext. By encrypting each piece of sub information corresponding to the target information by using the private key of the terminal to which the target information belongs and the key corresponding to each piece of sub information, the security of the target information can be improved.
S106, determining the ciphertext of the coordinate information corresponding to each piece of sub information as the ciphertext of the target information, and storing the ciphertext of the target information into the blockchain network.
Here, in the above steps, the ciphertext of the coordinate information corresponding to each piece of the sub information is obtained for each piece of the at least two pieces of the sub information, and therefore, the ciphertext of the coordinate information corresponding to each piece of the sub information is determined as the ciphertext of the target information, that is, the ciphertext of the target information includes the ciphertext of the coordinate information corresponding to each piece of the at least two pieces of the sub information, so that the ciphertext of the target information can be obtained by encrypting the target information, and the ciphertext of the target information can be stored in the blockchain network. The target information is sent to the blockchain network for encryption and storage, so that the resource occupation of the local storage space of the terminal can be reduced, the target information can be prevented from being tampered by an illegal user when being stored locally in the terminal, and the safety of the target information is improved.
In this embodiment of the present invention, since the first random number corresponding to each piece of sub information is generated according to the attribute information of each piece of sub information, and the attribute information of each piece of sub information includes the generation time of each piece of sub information or the length of each piece of sub information, the generation time of each piece of sub information and the length of each piece of sub information are difficult for an illegal terminal to obtain, that is, the first random number corresponding to each piece of sub information cannot be generated, so that the security of the information can be improved by adjusting each piece of sub information by using the first random number and encrypting the adjusted sub information subsequently. And the method is beneficial to generating the coordinate information corresponding to each piece of adjusted sub information according to each piece of adjusted sub information by adjusting each piece of sub information in at least two pieces of sub information, so that the success rate of acquiring the coordinate information corresponding to each piece of adjusted sub information is improved. By encrypting each piece of sub information in the target information, the illegal terminal is prevented from cracking the ciphertext, so that the safety of each piece of sub information is improved, and the safety of the target information is further improved. By storing ciphertext information of the target information into the blockchain network, the security of the information can be improved based on the characteristics that the blockchain is not tamperable and is not easy to lose; in addition, the ciphertext of the target information is stored in the blockchain network, so that the resource occupation of the local storage space of the terminal can be reduced.
Optionally, in step S103, the method for adjusting each piece of sub information according to the first random number may be shown in fig. 2, and fig. 2 is a schematic flow chart of a method for adjusting each piece of sub information according to an embodiment of the present application, and as shown in fig. 2, the method includes the following steps:
s201, performing remainder operation on each piece of sub information and the first random number to obtain each piece of sub information after remainder.
S202, if each piece of the remained sub-information is smaller than the information threshold value, determining each piece of the remained sub-information as each piece of the adjusted sub-information.
In step S201 to step S202, the remainder operation is to divide two numbers, and the remainder operation is performed on each piece of sub information and the first random number, that is, each piece of sub information is divided by the first random number, and the calculated result is used as each piece of sub information after the remainder is obtained. If the obtained piece of sub information is smaller than the information threshold, the piece of sub information is considered to be mapped to the first coordinate of the target point on the curve corresponding to the objective function, and the second coordinate of the target point on the curve corresponding to the objective function can be calculated according to the first coordinate and the objective function, so that the coordinate information corresponding to the piece of sub information can be obtained. If the obtained piece of sub information is greater than or equal to the information threshold, the piece of sub information is considered to be mapped to the first coordinate of the target point on the curve corresponding to the objective function, and the second coordinate of the target point on the curve corresponding to the objective function cannot be calculated according to the first coordinate and the objective function, namely the coordinate information corresponding to the piece of sub information cannot be obtained. Wherein the information threshold may be 2, for example 256 Can also be less than 2 256
And performing remainder operation on each piece of sub information and the first random number to obtain each piece of sub information after remainder, thereby determining each piece of sub information after remainder as each piece of sub information after adjustment according to the size relation between each piece of sub information after remainder and the information threshold value. The taking the remainder of each piece of sub-information and the first random number may refer to dividing a value corresponding to each piece of sub-information by the first random number, where it is known that a value corresponding to each piece of sub-information obtained after the remainder is smaller than a value corresponding to sub-information before the remainder is taken.
And S203, if each piece of the remained sub information is greater than or equal to the information threshold value, the first random number is adjusted.
S204, performing remainder operation on each piece of sub information and the adjusted first random number to obtain each piece of candidate sub information.
Here, when each piece of the remaining sub-information is greater than or equal to 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 second coordinate of the target point on the curve corresponding to the objective function cannot be calculated according to the first coordinate and 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 on each piece of sub information after adjustment and the first random number, so as to obtain each piece of sub information as a candidate.
And S205, if each piece of sub information of the candidate is smaller than the information threshold value, determining each piece of sub information of the candidate as each piece of sub information after adjustment.
It can be known that if each piece of candidate sub-information is smaller than the information threshold, mapping the piece of sub-information to the first coordinate of the target point on the curve corresponding to the objective function, and calculating to obtain the second coordinate of the target point on the curve corresponding to the objective function according to the first coordinate and the objective function, so as to obtain the coordinate information corresponding to each piece of sub-information. If each piece of candidate sub-information is greater than or equal to the information threshold, the piece of candidate sub-information is considered to be mapped to the first coordinate of the target point on the curve corresponding to the objective function, and the second coordinate of the target point on the curve corresponding to the objective function cannot be calculated according to the first coordinate and the objective function, namely the coordinate information corresponding to each piece of sub-information cannot be obtained. That is, if each piece of sub information of the candidate is greater than or equal to the information threshold, the first random number is continuously adjusted until the remainder operation is performed on each piece of sub information of the candidate and the adjusted first random number, and if each piece of sub information of the candidate after the remainder is less than the information threshold, each piece of sub information of the candidate after the remainder is determined as each piece of sub information after the adjustment.
In the embodiment of the application, each piece of adjusted sub information can be obtained 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, so that the success rate of encrypting each piece of sub information in the follow-up process is improved.
Referring to fig. 3, fig. 3 is a flowchart of an information processing method for generating a random number based on an attribute of information according to an embodiment of the present application, where the method is applied to a node in a blockchain network. As shown in fig. 3, the method includes:
s301, acquiring an objective function for describing information and attribute information of each piece of sub information in the objective information to be processed.
S302, 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.
S303, generating a first random number corresponding to each piece of sub information according to the attribute information of each piece of sub information, and adjusting each piece of sub information according to the first random number to obtain each piece of adjusted sub information.
S304, according to the objective function and each piece of adjusted sub information, acquiring coordinate information corresponding to each piece of sub information in at least two pieces of sub information.
Here, the specific content of steps S301 to S304 may refer to the content of steps S101 to S104 in the embodiment corresponding to fig. 1, which is not described herein.
S305, acquiring a private key of a terminal to which the target information belongs and a key corresponding to each piece of sub information.
Here, the terminal to which the target information belongs is a terminal that uploads the target information to the blockchain network for encryption, storage, and other processes, and the private key of the terminal to which the target information belongs is a private key generated by the terminal.
In a specific implementation, for example, the identifier of the terminal to which the target information belongs may be obtained, a SECP256K1 algorithm is used to generate a sixth random number, and the sixth random number is filled to obtain a private key of the terminal, where the private key of the terminal may be a number including 256 bits. Here, the identification of the terminal may refer to a factory number of the terminal, or other identification for uniquely indicating the terminal.
S306, encrypting 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 to obtain the ciphertext of the coordinate information corresponding to each piece of sub information.
In the embodiment of the application, the base point coordinates of the curve of the objective function can be obtained; obtaining the product of the base point coordinates and the private key to obtain candidate coordinates; encrypting the candidate coordinates according to the secret key corresponding to each piece of sub information to obtain ciphertext of the candidate coordinates; and fusing the coordinate information corresponding to each piece of sub information with the ciphertext of the corresponding candidate coordinate to obtain the ciphertext of the coordinate information corresponding to each piece of sub information.
Here, by acquiring the curve of the objective function, and the curve parameters of the objective function, the base point coordinates of the curve of the objective function can be acquired. For example, if the base point is G, the corresponding base point coordinates are (x 1, y 1), and the private key of the terminal is h, candidate coordinates can be obtained by calculation according to formula (1-2):
H=h*G (1-2)
the candidate coordinate is H, the base point is G, and the private key of the terminal is H.
Specifically, the candidate coordinates can be encrypted according to the key corresponding to each piece of sub information to obtain ciphertext of the candidate coordinates; and fusing the coordinate information corresponding to each piece of sub information with the ciphertext of the corresponding candidate coordinate to obtain the ciphertext of the coordinate information corresponding to each piece of sub information.
For example, the number of pieces of sub information corresponding to the target information is n, the sub information i is any piece of sub information in the n pieces of sub information, the candidate coordinates can be encrypted in a mode of a formula (1-3) to obtain ciphertext of the candidate coordinates, and the coordinate information corresponding to the sub information i and the ciphertext of the candidate coordinates are subjected to sum fusion to obtain ciphertext of the coordinate information corresponding to the sub information i.
Ci=Mi+ki*H (1-3)
Wherein, the candidate coordinates are H, ci is ciphertext of the coordinate information corresponding to the sub information i, mi is coordinate information corresponding to the sub information i, and ki is a key corresponding to the sub information i. ki is used for encrypting the candidate coordinates according to the key corresponding to the sub-information i to obtain ciphertext of the candidate coordinates. It can be known that, for other sub-information in the n pieces of sub-information, encryption and fusion can be performed through the formula (1-3) to obtain ciphertext of coordinate information corresponding to the other sub-information. For each piece of 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, the number of the ciphertext of the coordinate information corresponding to one piece of sub information, that is, the number of the ciphertext of the coordinate information corresponding to the finally obtained piece of sub information is n.
In a specific implementation, an encryption algorithm may be used to encrypt the coordinate information corresponding to each piece of sub information to obtain a ciphertext of the coordinate information corresponding to each piece of sub information, where the encryption algorithm may include, for example, elgamal algorithm (an asymmetric encryption algorithm), rabin algorithm (an asymmetric encryption algorithm), diffie-Hellman algorithm (an asymmetric encryption algorithm), and ECC algorithm (elliptic curve encryption algorithm). The computer equipment 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 secret key corresponding to each piece of sub information to obtain the ciphertext of the coordinate information corresponding to each piece of sub information, so that the encrypting of each piece of sub information can be realized to obtain the corresponding ciphertext, and after the terminal obtains the ciphertext corresponding to each piece of sub information, the terminal needs to decrypt to obtain the sub information corresponding to each piece of ciphertext.
S307, determining the ciphertext of the coordinate information corresponding to each piece of sub information as the ciphertext of the target information, and storing the ciphertext of the target information into the blockchain network.
Here, the specific content of step S307 may refer to the content of step S106 in the corresponding embodiment of fig. 1, which is not described herein.
In this embodiment of the present application, according to a private key of a terminal and a key corresponding to each piece of sub information, coordinate information corresponding to each piece of sub information in at least two pieces of sub information is encrypted to obtain ciphertext of coordinate information corresponding to each piece of sub information, encryption of each piece of sub information may be implemented to obtain corresponding ciphertext, and after the terminal obtains ciphertext corresponding to each piece of sub information, decryption is required to obtain sub information corresponding to each piece of ciphertext. By encrypting each piece of sub information, even if the illegal terminal acquires the ciphertext corresponding to the sub information, the illegal terminal cannot decrypt the ciphertext and cannot acquire the content of the sub information, so that the security of each piece of sub information can be ensured, and the security of the target information can be ensured.
Having described the methods of embodiments of the present application, the apparatus of embodiments of the present application are described below.
Referring to fig. 4, fig. 4 is a schematic diagram of a composition structure of an information processing apparatus for generating a random number based on an attribute of information according to an embodiment of the present application, where the information processing apparatus for generating a random number based on an attribute of information may be a computer program (including program code) running in a computer device, for example, the information processing apparatus for generating a random number based on an attribute of information is an application software; the device can be used for executing corresponding steps in the method provided by the embodiment of the application. The apparatus 40 includes:
an information obtaining module 401, configured to obtain an objective function for describing information, and attribute information of each piece of sub information in target information to be processed, where 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 a generation time of each piece of sub information and a 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 user information included 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, and adjust each piece of sub information according to the first random number, so as to obtain each piece of adjusted sub information;
the coordinate acquiring module 404 is configured to acquire coordinate information corresponding to each piece of sub-information in the at least two pieces of sub-information according to the objective function and the adjusted piece of sub-information;
an information encryption module 405, configured to encrypt coordinate information of corresponding sub information in the at least two pieces of sub information by using a key corresponding to each piece of sub information, to obtain ciphertext of the coordinate information corresponding to each piece of sub information;
and 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.
Optionally, the attribute information of each piece of sub information includes a length of each piece of sub information, and the information adjustment module 403 is specifically configured to:
determining the privacy level corresponding to each piece of sub-information according to the length of each piece of sub-information;
generating a second random number according to the privacy level corresponding to each piece of sub-information;
Acquiring the byte length in the second random number, and intercepting the second random number according to the byte length to obtain an intercepted second random number; the intercepted second random number is smaller than a random number threshold value, and the byte length in the intercepted second random number is smaller than the byte length in the second random number;
and determining the intercepted second random number as the first random number corresponding to each piece of sub information.
Optionally, the attribute information of each piece of sub information includes a generation time of each piece of sub information, and the information adjustment module 403 is specifically configured to:
encoding the generation time of each piece of sub information to obtain encoded time data;
generating a third random number according to the encoded time data;
filling the bytes in the third random number to obtain a filled third random number, wherein the filled third random number is smaller than a random number threshold;
and determining the third random number after the filling processing as the first random number corresponding to each piece of sub information.
Optionally, the information adjustment module 403 is specifically configured to:
performing remainder operation on each piece of sub information and the first random number to obtain each piece of sub information after remainder;
And if the obtained piece of sub information is smaller than the information threshold value, determining the obtained piece of sub information as the adjusted piece of sub information.
Optionally, the target information includes a first sub-information and a 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 configured to:
encoding the user information to obtain encoded user data;
generating a fourth random number according to the encoded user data;
performing hash operation on the fourth random number to obtain the root key;
carrying out hash operation on the root key to obtain a key of the first sub-information;
and carrying out hash operation on the key of the first sub-information to obtain the key of the second sub-information.
Optionally, the information encryption module 405 is specifically configured to:
acquiring a private key of a terminal to which the target information belongs and a secret key corresponding to each piece of sub information, wherein the terminal to which the target information belongs is a terminal corresponding to a mechanism to which each piece of sub information belongs;
and encrypting 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 to obtain the ciphertext of the coordinate information corresponding to each piece of sub information.
Optionally, the information encryption module 405 is specifically configured to:
obtaining the base point coordinates of the curve of the objective function;
obtaining the product of the base point coordinates and the private key to obtain candidate coordinates;
encrypting the candidate coordinates according to the secret key corresponding to each piece of sub information to obtain ciphertext of the candidate coordinates;
and fusing the coordinate information corresponding to each piece of sub information with the ciphertext of the corresponding candidate coordinate to obtain the ciphertext of the coordinate information corresponding to each piece of sub information.
It should be noted that, in the embodiment corresponding to fig. 4, the content not mentioned may be referred to the description of the method embodiment, and will not be repeated here.
According to an embodiment of the present application, steps involved in an information processing method for generating a random number based on an attribute of information shown in fig. 1 may be performed by respective modules in an information processing apparatus for generating a random number based on an attribute of information shown in fig. 4. For example, step S101 shown in fig. 1 may be performed by the information acquisition module 401 in fig. 4, and step S102 shown in fig. 1 may be performed by the key generation module 402 in fig. 4; step S103 shown in fig. 1 may be performed by the information adjustment module 403 in fig. 4; step S104 shown in fig. 1 may be performed by the coordinate acquisition module 404 in fig. 4; step S105 shown in fig. 1 may be performed by the information encryption module 405 in fig. 4; step S106 shown in fig. 1 may be performed by the information storage module 406 in fig. 4. According to an embodiment of the present application, each module in the information processing for generating a random number based on the attribute of information shown in fig. 4 may be separately or completely combined into one or several units to form the information processing unit, or some unit(s) thereof may be further split into a plurality of sub-units with smaller functions, so that the same operation may be implemented without affecting the implementation of the technical effects of the embodiments of the present application. The above modules are divided based on logic functions, and in practical applications, the functions of one module may be implemented by a plurality of units, or the functions of a plurality of modules may be implemented by one unit. In other embodiments of the present application, the information processing apparatus that generates a random number based on the attribute of information may also include other units, and in practical applications, these functions may also be realized with assistance of other units, and may be realized by cooperation of a plurality of units.
According to another embodiment of the present application, an information processing apparatus for generating random numbers based on information attributes as shown in fig. 4 may be constructed by running a computer program (including program code) capable of executing the steps involved in the respective methods as shown in fig. 1, 2 and 3 on a general-purpose computer device such as a computer including a processing element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read only storage medium (ROM), and the like, and a storage element, and an information processing method for generating random numbers based on information attributes of the embodiments of the present application may be implemented. The computer program may be recorded on, for example, a computer-readable recording medium, and loaded into and executed by the computing device via the computer-readable recording medium.
In this embodiment of the present invention, since the first random number corresponding to each piece of sub information is generated according to the attribute information of each piece of sub information, and the attribute information of each piece of sub information includes the generation time of each piece of sub information or the length of each piece of sub information, the generation time of each piece of sub information and the length of each piece of sub information are difficult for an illegal terminal to obtain, that is, the first random number corresponding to each piece of sub information cannot be generated, so that the security of the information can be improved by adjusting each piece of sub information by using the first random number and encrypting the adjusted sub information subsequently. And the method is beneficial to generating the coordinate information corresponding to each piece of adjusted sub information according to each piece of adjusted sub information by adjusting each piece of sub information in at least two pieces of sub information, so that the success rate of acquiring the coordinate information corresponding to each piece of adjusted sub information is improved. By encrypting each piece of sub information in the target information, the illegal terminal is prevented from cracking the ciphertext, so that the safety of each piece of sub information is improved, and the safety of the target information is further improved. By storing ciphertext information of the target information into the blockchain network, the security of the information can be improved based on the characteristics that the blockchain is not tamperable and is not easy to lose; in addition, the ciphertext of the target information is stored in the blockchain network, so that the resource occupation of the local storage space of the terminal can be reduced.
Referring to fig. 5, fig. 5 is a schematic diagram of a composition structure of a computer device according to an embodiment of the present application. As shown in fig. 5, the above-mentioned computer device 50 may include: processor 501, network interface 504 and memory 505, and further, the above-described computer device 50 may further comprise: a user interface 503, and at least one communication bus 502. Wherein a communication bus 502 is used to enable connected communications between these components. The user interface 503 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 503 may further include a standard wired interface and a standard wireless interface. The network interface 504 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 505 may be a high-speed RAM memory or a nonvolatile memory (non-volatile memory), such as at least one disk memory. The memory 505 may also optionally be at least one storage device located remotely from the processor 501. As shown in fig. 5, an operating system, a network communication module, a user interface module, and a device control application may be included in the memory 505, which is one type of computer-readable storage medium.
In the computer device 50 shown in FIG. 5, the network interface 504 may provide network communication functions; while the user interface 503 is primarily an interface for providing input to a user; and the processor 501 may be configured to invoke a device control application stored in the memory 505 to implement:
Acquiring an objective function for describing information and attribute information of each piece of sub information in target information to be processed, wherein the target information comprises at least two pieces of sub information, and the attribute information of each piece of sub information comprises at least one of generation time of each piece of sub information and length of each piece of sub information;
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;
generating a first random number corresponding to each piece of sub information according to the attribute information of each piece of sub information, and adjusting each piece of sub information according to the first random number to obtain each piece of adjusted sub information;
acquiring 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 sub information after adjustment;
encrypting the coordinate information of the corresponding sub information in the at least two pieces of sub information by adopting the secret key corresponding to each piece of sub information to obtain the ciphertext of the coordinate information corresponding to each piece of sub information;
and determining the ciphertext of the coordinate information corresponding to each piece of sub information as the ciphertext of the target information, and storing the ciphertext of the target information into a block chain network.
It should be understood that the computer device 50 described in the embodiment of the present application may perform the description of the above-mentioned information processing method for generating the random number based on the attribute of the information in the embodiment corresponding to fig. 1 and 2 and fig. 3, and may also perform the description of the above-mentioned information processing apparatus for generating the random number based on the attribute of the information in the embodiment corresponding to fig. 4, which is not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
In this embodiment of the present invention, since the first random number corresponding to each piece of sub information is generated according to the attribute information of each piece of sub information, and the attribute information of each piece of sub information includes the generation time of each piece of sub information or the length of each piece of sub information, the generation time of each piece of sub information and the length of each piece of sub information are difficult for an illegal terminal to obtain, that is, the first random number corresponding to each piece of sub information cannot be generated, so that the security of the information can be improved by adjusting each piece of sub information by using the first random number and encrypting the adjusted sub information subsequently. And the method is beneficial to generating the coordinate information corresponding to each piece of adjusted sub information according to each piece of adjusted sub information by adjusting each piece of sub information in at least two pieces of sub information, so that the success rate of acquiring the coordinate information corresponding to each piece of adjusted sub information is improved. By encrypting each piece of sub information in the target information, the illegal terminal is prevented from cracking the ciphertext, so that the safety of each piece of sub information is improved, and the safety of the target information is further improved. By storing ciphertext information of the target information into the blockchain network, the security of the information can be improved based on the characteristics that the blockchain is not tamperable and is not easy to lose; in addition, the ciphertext of the target information is stored in the blockchain network, so that the resource occupation of the local storage space of the terminal can be reduced.
The present application also provides a computer readable storage medium storing a computer program comprising program instructions which, when executed by a computer, cause the computer to perform a method as in the previous embodiments, the computer being part of a computer device as mentioned above. Such as the processor 501 described above. As an example, the program instructions may be executed on one computer device or on multiple computer devices located at one site, or alternatively, on multiple computer devices distributed across multiple sites and interconnected by a communication network, which may constitute a blockchain network.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in the embodiments may be accomplished by computer programs to instruct related hardware, where the programs may be stored on a computer readable storage medium, and where the programs, when executed, may include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like.
The foregoing disclosure is only illustrative of the preferred embodiments of the present application and is not intended to limit the scope of the claims herein, as the equivalent of the claims herein shall be construed to fall within the scope of the claims herein.

Claims (9)

1. An information processing method for generating a random number based on an attribute of information, comprising:
acquiring an objective function for describing information and attribute information of each piece of sub information in the objective information to be processed, wherein the objective information comprises at least two pieces of sub information, and the attribute information of each piece of sub information comprises at least one of generation time of each piece of sub information and length of each piece of sub information;
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;
generating a first random number corresponding to each piece of sub information according to the attribute information of each piece of sub information, and performing remainder operation on each piece of sub information and the first random number to obtain each piece of sub information after remainder;
if the obtained piece of sub information is smaller than an information threshold value, determining the obtained piece of sub information as adjusted piece of sub information;
If each piece of the information after the remainder is greater than or equal to the information threshold value, the first random number is adjusted; performing remainder operation on each piece of the remainder information and the adjusted first random number to obtain each piece of candidate piece of the remainder information; if each piece of sub information of the candidate is smaller than the information threshold value, determining each piece of sub information of the candidate as each piece of adjusted sub information;
acquiring 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 sub information after adjustment;
encrypting the coordinate information of the corresponding sub information in the at least two pieces of sub information by adopting the secret key corresponding to each piece of sub information to obtain the ciphertext of the coordinate information corresponding to each piece of sub information;
and determining the ciphertext of the coordinate information corresponding to each piece of sub information as the ciphertext of the target information, and storing the ciphertext of the target information into a blockchain network.
2. The method of claim 1, wherein the attribute information of each piece of sub information includes a length of each piece of sub information, and the generating the first random number corresponding to each piece of sub information according to the attribute information of each piece of sub information includes:
Determining the privacy level corresponding to each piece of sub-information according to the length of each piece of sub-information;
generating a second random number according to the privacy level corresponding to each piece of sub-information;
acquiring byte length in the second random number, and intercepting the second random number according to the byte length to obtain an intercepted second random number; the intercepted second random number is smaller than a random number threshold value, and the byte length in the intercepted second random number is smaller than the byte length in the second random number;
and determining the intercepted second random number as the first random number corresponding to each piece of sub information.
3. The method of claim 1, wherein the attribute information of each piece of sub information includes a generation time of each piece of sub information, and the generating the first random number corresponding to each piece of sub information according to the attribute information of each piece of sub information includes:
encoding the generation time of each piece of sub information to obtain encoded time data;
generating a third random number according to the encoded time data;
filling the bytes in the third random number to obtain a filled third random number, wherein the filled third random number is smaller than a random number threshold;
And determining the third random number after the filling processing as the first random number corresponding to each piece of sub information.
4. The method of claim 1, wherein the target information comprises first sub information and second sub information, the second sub information having a generation time subsequent to a generation time of the first sub information;
the 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, includes:
encoding the user information to obtain encoded user data;
generating a fourth random number according to the encoded user data;
performing hash operation on the fourth random number to obtain the root key;
performing hash operation on the root key to obtain a key of the first sub-information;
and carrying out hash operation on the key of the first sub-information to obtain the key of the second sub-information.
5. The method according to claim 1, wherein encrypting the coordinate information of the corresponding sub-information in the at least two pieces of sub-information using the key corresponding to each piece of sub-information to obtain the ciphertext of the coordinate information corresponding to each piece of sub-information includes:
Acquiring a private key of a terminal to which the target information belongs and a secret key corresponding to each piece of sub information;
and encrypting 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 to obtain the ciphertext of the coordinate information corresponding to each piece of sub information.
6. The method according to claim 5, wherein encrypting the coordinate information corresponding to each piece of the at least two pieces of sub-information according to the private key and the key corresponding to each piece of sub-information to obtain the ciphertext of the coordinate information corresponding to each piece of sub-information includes:
obtaining the base point coordinates of the curve of the objective function;
obtaining the product of the base point coordinates and the private key to obtain candidate coordinates;
encrypting the candidate coordinates according to the secret key corresponding to each piece of sub information to obtain ciphertext of the candidate coordinates;
and fusing the coordinate information corresponding to each piece of sub information with the ciphertext of the corresponding candidate coordinate to obtain the ciphertext of the coordinate information corresponding to each piece of sub information.
7. An information processing apparatus that generates a random number based on an attribute of information, comprising:
The information acquisition module is used for acquiring an objective function for describing information and attribute information of each piece of sub information in target information to be processed, wherein the target information comprises at least two pieces of sub information, and the attribute information of each piece of sub information comprises at least one of generation time of each piece of sub information and length of each piece of sub information;
the key generation module is used 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;
the information adjustment module is used for generating a first random number corresponding to each piece of sub information according to the attribute information of each piece of sub information, and performing remainder calculation on each piece of sub information and the first random number to obtain each piece of sub information after remainder;
the information adjustment module is specifically configured to determine each piece of information after the remainder is obtained as each piece of adjusted sub information if each piece of sub information after the remainder is obtained is smaller than an information threshold;
the information adjustment module is specifically configured to adjust the first random number if each piece of the information after the remainder is greater than or equal to the information threshold; performing remainder operation on each piece of the remainder information and the adjusted first random number to obtain each piece of candidate piece of the remainder information; if each piece of sub information of the candidate is smaller than the information threshold value, determining each piece of sub information of the candidate as each piece of adjusted sub information;
The coordinate acquisition module is used for acquiring coordinate information corresponding to each piece of sub information in the at least two pieces of sub information according to the objective function and the adjusted piece of sub information;
the information encryption module is used for encrypting the coordinate information of the corresponding sub information in the at least two pieces of sub information by adopting the secret key corresponding to each piece of sub information to obtain the ciphertext of the coordinate information corresponding to each piece of sub information;
and the information storage module is used for determining the ciphertext of the coordinate information corresponding to each piece of sub information as the ciphertext of the target information and storing the ciphertext of the target information into a blockchain network.
8. A computer device, comprising: a processor, a memory, and a network interface;
the processor is connected to the memory, the network interface for providing data communication functions, the memory for storing program code, the processor for invoking the program code to perform the method of any of claims 1-6.
9. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of any of claims 1-6.
CN202011056601.6A 2020-09-29 2020-09-29 Information processing method, device and equipment for generating random number based on information attribute Active CN112202555B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011056601.6A CN112202555B (en) 2020-09-29 2020-09-29 Information processing method, device and equipment for generating random number based on information attribute
PCT/CN2021/097118 WO2022068235A1 (en) 2020-09-29 2021-05-31 Information processing method and apparatus for generating random number on the basis of attribute of information, and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011056601.6A CN112202555B (en) 2020-09-29 2020-09-29 Information processing method, device and equipment for generating random number based on information attribute

Publications (2)

Publication Number Publication Date
CN112202555A CN112202555A (en) 2021-01-08
CN112202555B true CN112202555B (en) 2023-07-18

Family

ID=74007110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011056601.6A Active CN112202555B (en) 2020-09-29 2020-09-29 Information processing method, device and equipment for generating random number based on information attribute

Country Status (2)

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

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112202555B (en) * 2020-09-29 2023-07-18 平安科技(深圳)有限公司 Information processing method, device and equipment for generating random number based on information attribute
CN112069525A (en) * 2020-09-29 2020-12-11 深圳壹账通智能科技有限公司 Encryption method, device and equipment for generating key based on attribute of information

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110570197A (en) * 2019-09-17 2019-12-13 腾讯科技(深圳)有限公司 Data processing method and device based on block chain
CN110601815A (en) * 2019-09-17 2019-12-20 腾讯科技(深圳)有限公司 Block chain data processing method and equipment
CN110839026A (en) * 2019-11-12 2020-02-25 深圳市网心科技有限公司 Data processing method based on block chain and related equipment
CN110881063A (en) * 2019-11-20 2020-03-13 腾讯科技(深圳)有限公司 Storage method, device, equipment and medium of private data
CN110958317A (en) * 2019-11-29 2020-04-03 腾讯科技(深圳)有限公司 Data processing method and equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3721578B1 (en) * 2017-12-08 2022-09-07 Ping Identity Corporation Methods and systems for recovering data using dynamic passwords
CN111553686A (en) * 2020-04-27 2020-08-18 腾讯科技(深圳)有限公司 Data processing method and device, computer equipment and storage medium
CN112202554B (en) * 2020-09-29 2022-03-08 平安科技(深圳)有限公司 Information processing method, device and equipment for generating key based on attribute of information
CN112202555B (en) * 2020-09-29 2023-07-18 平安科技(深圳)有限公司 Information processing method, device and equipment for generating random number based on information attribute
CN112199697A (en) * 2020-09-29 2021-01-08 深圳壹账通智能科技有限公司 Information processing method, device, equipment and medium based on shared root key

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110570197A (en) * 2019-09-17 2019-12-13 腾讯科技(深圳)有限公司 Data processing method and device based on block chain
CN110601815A (en) * 2019-09-17 2019-12-20 腾讯科技(深圳)有限公司 Block chain data processing method and equipment
CN110839026A (en) * 2019-11-12 2020-02-25 深圳市网心科技有限公司 Data processing method based on block chain and related equipment
CN110881063A (en) * 2019-11-20 2020-03-13 腾讯科技(深圳)有限公司 Storage method, device, equipment and medium of private data
CN110958317A (en) * 2019-11-29 2020-04-03 腾讯科技(深圳)有限公司 Data processing method and equipment

Also Published As

Publication number Publication date
CN112202555A (en) 2021-01-08
WO2022068235A1 (en) 2022-04-07

Similar Documents

Publication Publication Date Title
CN110915164B (en) Processing blockchain data based on smart contract operations performed in trusted execution environments
CN109493020B (en) Block chain based secure transaction method and device
KR102151907B1 (en) Blockchain data processing and storage in a trusted execution environment
CN112202554B (en) Information processing method, device and equipment for generating key based on attribute of information
CN109784931B (en) Query method of data query platform based on blockchain
CN111523133B (en) Block chain and cloud data collaborative sharing method
CN112184444B (en) Method, device, equipment and medium for processing information based on characteristics of information
WO2022068362A1 (en) Block chain-based information processing method and apparatus, device, and medium
WO2022068360A1 (en) Shared root key-based information processing method and apparatus, and device and medium
US11489660B2 (en) Re-encrypting data on a hash chain
CN112131227A (en) Data query method and device based on alliance chain
WO2022068356A1 (en) Blockchain-based information encryption method and apparatus, device and medium
CN112202555B (en) Information processing method, device and equipment for generating random number based on information attribute
WO2022068358A1 (en) Encryption method and apparatus for generating keys on basis of attributes of information, and device
WO2022068355A1 (en) Encryption method and apparatus based on feature of information, device, and storage medium
CN112182109A (en) Distributed data coding storage method based on block chain and electronic equipment
WO2022068359A1 (en) Encryption method and apparatus for compressing ciphertext of information, and device and medium
WO2022068234A1 (en) Encryption method and apparatus based on shared root key, device and medium
KR20210036700A (en) Blockchain system for supporting change of plain text data included in transaction
WO2022068361A1 (en) Encryption method and apparatus based on amendment amount, and device, and medium
JP2020099010A (en) Information processing method, information processing device, program, and information processing system
CN108494552A (en) Support the cloud storage data duplicate removal method of efficiently convergence key management
CN112202453A (en) Information processing method, device, equipment and medium for compressing ciphertext
Vamshi et al. Public data auditing scheme using rsa and blockchain for cloud storage
CN115801266A (en) Data transmission method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant