CN115603906A - Data processing method, device, equipment and medium - Google Patents
Data processing method, device, equipment and medium Download PDFInfo
- Publication number
- CN115603906A CN115603906A CN202211244805.1A CN202211244805A CN115603906A CN 115603906 A CN115603906 A CN 115603906A CN 202211244805 A CN202211244805 A CN 202211244805A CN 115603906 A CN115603906 A CN 115603906A
- Authority
- CN
- China
- Prior art keywords
- random number
- data
- key
- target
- preset
- 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.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 14
- 238000000034 method Methods 0.000 claims abstract description 70
- 238000012545 processing Methods 0.000 claims description 68
- 238000012163 sequencing technique Methods 0.000 claims description 22
- 238000004590 computer program Methods 0.000 claims description 15
- 230000008569 process Effects 0.000 abstract description 24
- 238000010586 diagram Methods 0.000 description 22
- 238000004891 communication Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 230000001133 acceleration Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 229910002056 binary alloy Inorganic materials 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 229910002059 quaternary alloy Inorganic materials 0.000 description 1
- 238000001583 randomness test Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0861—Generation of secret information including derivation or calculation of cryptographic keys or passwords
- H04L9/0869—Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Power Engineering (AREA)
- Storage Device Security (AREA)
Abstract
Embodiments of the present application provide a data processing method, an apparatus, a device, and a medium, so as to solve a problem in the prior art that when a key is generated, a random number needs to be generated in a hardware manner, which results in a small application range of a method for generating a key. The electronic equipment processes the received data through Hash operation to generate a corresponding random number, the Hash operation has strong anti-collision performance, and the random number processed through the Hash operation has high quality, so that a high-quality random number meeting requirements can be generated.
Description
Technical Field
The present application relates to the field of information security technologies, and in particular, to a data processing method, apparatus, device, and medium.
Background
With the continuous development of information security technology, more and more scenes need to be applied to the key, wherein the application to the key is needed in the cryptographic algorithm. In generating a key, generally, a random number is generated first, and a corresponding key is generated based on the generated random number.
However, because of the high requirement of the secret key on the quality of the random number, the prior art proposes to generate the random number in a hardware manner, specifically, shift the data stored in the Register by using the property of the primitive polynomial through a Linear Feedback Shift Register (LFSR), and output an m sequence with high random characteristics. The method is realized by depending on an application specific integrated circuit, so that only equipment provided with corresponding hardware can generate random numbers meeting high requirements in the prior art, and corresponding keys are generated based on the random numbers, namely, the method for generating the keys in the prior art is greatly limited, and the application range of the method is influenced.
Disclosure of Invention
Embodiments of the present application provide a data processing method, an apparatus, a device, and a medium, so as to solve a problem in the prior art that when a key is generated, a random number needs to be generated in a hardware manner, which results in a small application range of a method for generating a key.
In a first aspect, an embodiment of the present application provides a data processing method, where the method includes:
receiving data sent by any sensor arranged in a terminal;
processing the data through Hash operation to generate a corresponding random number;
and storing the random number in a random number entropy pool, wherein the random number in the random number entropy pool is used for generating a key.
Further, after receiving data sent by any sensor arranged in the terminal and before processing the data through the hash operation, the method further includes:
acquiring last data of the data sent by the sensor sending the data;
determining the correlation degree of the previous data and the data according to the value of each bit of the previous data and the value of each bit of the data;
judging whether the correlation degree is greater than a preset correlation degree;
and if not, executing the subsequent step of processing the data through hash operation.
Further, the processing the data through the hash operation includes:
splicing the data and the time for receiving the data according to a preset splicing mode;
and performing at least one hash operation on the spliced data.
Further, after receiving data sent by any sensor arranged in the terminal and before processing the data through the hash operation, the method further includes:
judging whether the number of the random numbers in the random number entropy pool reaches a preset number or not;
and if not, executing the subsequent step of processing the data through hash operation.
Further, the method further comprises:
receiving a request to generate a key;
acquiring any target random number in the random number entropy pool;
and generating a corresponding key according to the target random number and a pre-configured generation algorithm.
Further, after acquiring any target random number, before generating a corresponding key according to the target random number and a pre-configured generation algorithm, the method further includes:
acquiring a preset target length; wherein the target length does not exceed the length of any random number in the random number entropy pool;
acquiring a sub-random number of the target length from the target random number; and updating the target random number by adopting the sub-random number, and executing the subsequent step of generating a corresponding key according to the target random number and a preset generation algorithm aiming at the updated target random number.
Further, the request carries a key identifier of a key to be generated; the method further comprises the following steps:
acquiring a pixel value of each preset pixel point in a pre-stored image; acquiring data of a preset system corresponding to the secret key; the number of each preset pixel point is the same as the number of bits of the data;
adjusting the pixel value of each preset pixel point in sequence according to the numerical value of the corresponding bit in the data according to a preset sorting mode corresponding to each preset pixel point; and storing the corresponding relation between the image with the adjusted pixel value and the key identifier.
Further, the method further comprises:
if a key acquisition request carrying a target key identifier is received, acquiring a target image correspondingly stored aiming at the target key identifier; acquiring a pixel value of each preset pixel point in the target image;
and correspondingly sequencing the numerical values corresponding to the pixel values of each preset pixel point according to a preset sequencing mode corresponding to each preset pixel point, and taking the numerical values formed after sequencing as target numerical values of the key corresponding system of the target key identifier to be obtained.
In a second aspect, an embodiment of the present application further provides a data processing apparatus, where the apparatus includes:
the receiving module is used for receiving data sent by any sensor arranged in the terminal;
the processing module is used for processing the data through Hash operation to generate corresponding random numbers;
and the storage module is used for storing the random number in a random number entropy pool, wherein the random number in the random number entropy pool is used for generating a key.
Further, the processing module is further configured to obtain previous data of the data sent by the sensor that sent the data; determining the correlation degree of the previous data and the data according to the value of each bit of the previous data and the value of each bit of the data; judging whether the correlation degree is greater than a preset correlation degree or not; and if not, executing the subsequent step of processing the data through hash operation.
Further, the processing module is specifically configured to splice the data and the time for receiving the data according to a preset splicing manner; and performing at least one hash operation on the spliced data.
Further, the processing module is further configured to determine whether the number of the random numbers in the random number entropy pool reaches a preset number; if not, executing the subsequent step of processing the data through hash operation.
Further, the processing module is further configured to receive a request for generating a key; acquiring any target random number in the random number entropy pool; and generating a corresponding key according to the target random number and a pre-configured generation algorithm.
Further, the processing module is further configured to obtain a preset target length; wherein the target length does not exceed the length of any random number in the random number entropy pool; acquiring a sub-random number of the target length from the target random number; and updating the target random number by adopting the sub-random number, and executing the subsequent step of generating a corresponding key according to the target random number and a preset generation algorithm aiming at the updated target random number.
Further, the processing module is further configured to obtain a pixel value of each preset pixel point in a pre-stored image; acquiring data of a preset system corresponding to the secret key; the number of each preset pixel point is the same as the number of bits of the data; adjusting the pixel value of each preset pixel point in sequence according to the value of the corresponding bit in the data according to a preset sorting mode corresponding to each preset pixel point; storing the corresponding relation between the image with the adjusted pixel value and the key identifier; the request carries a key identifier of a key to be generated.
Further, the processing module is further configured to, if a key acquisition request carrying a target key identifier is received, acquire a target image correspondingly stored for the target key identifier; acquiring a pixel value of each preset pixel point in the target image; and correspondingly sequencing the values corresponding to the pixel values of the preset pixel points according to a preset sequencing mode corresponding to each preset pixel point, and taking the sequenced values as target values of the key corresponding scale of the target key identification to be obtained.
In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes at least a processor and a memory, and the processor is configured to execute the steps of the data processing method according to any one of the foregoing methods when executing the computer program stored in the memory.
In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, performs the steps of the data processing method described in any one of the above.
In the embodiment of the application, the electronic device receives data sent by any sensor arranged in a terminal, processes the received data through hash operation, generates a corresponding random number, and stores the generated random number in a random number entropy pool, wherein the random number in the random number entropy pool is used for generating a secret key. In the embodiment of the application, the electronic device processes the received data through the hash operation to generate the corresponding random number, and the hash operation has strong collision resistance, so that the random number processed through the hash operation has high quality, and thus the random number can generate a high-quality random number meeting requirements.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic diagram of a data processing process according to an embodiment of the present application;
fig. 2 is a schematic diagram of a process for generating random numbers according to an embodiment of the present application;
fig. 3 is a schematic diagram of a key steganography process provided in an embodiment of the present application;
fig. 4 is a schematic diagram of a process for obtaining a target key according to an embodiment of the present application;
fig. 5 is a detailed schematic diagram of a key correlation process provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present application will now be described more fully hereinafter with reference to the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
In order to improve the application range of the key generation method, embodiments of the present application provide a data processing method, apparatus, device, and medium. The data processing method comprises the following steps: the electronic equipment receives data sent by any sensor arranged in a terminal, processes the received data through Hash operation, generates a corresponding random number, and stores the generated random number in a random number entropy pool, wherein the random number in the random number entropy pool is used for generating a secret key. The random number in the random number entropy pool is not required to be generated in a hardware mode, and the key is generated based on the random number in the random number entropy pool, so that the application range of the key generation method can be widened.
Example 1:
fig. 1 is a schematic diagram of a data processing process provided in an embodiment of the present application, where the process includes the following steps:
s101: and receiving data sent by any sensor arranged in the terminal.
The data processing method provided by the embodiment of the application is applied to electronic equipment, and the electronic equipment can be equipment such as a terminal or a server.
In this embodiment of the present application, in order to generate a random number that meets a high requirement of a secret key, a plurality of sensors are provided in a terminal, where the sensors provided in the terminal may include: a plurality of sensors such as an acceleration sensor, a magnetic sensor, a direction sensor, a gyroscope sensor, a light ray sensing sensor, a pressure sensor, a temperature sensor, a proximity sensor, a gravity sensor, a linear acceleration sensor, and a rotation vector sensor.
If the electronic device is a terminal, the terminal can acquire data sent by any sensor arranged in the terminal, and if the electronic device is a non-terminal device such as a server, the terminal can send the data to the non-terminal device such as the server after acquiring the data sent by any sensor arranged in the terminal, and the non-terminal device such as the server can receive the data sent by any sensor arranged in the terminal. The terminal can also acquire data sent by a plurality of sensors arranged in the terminal, and if the data sent by the plurality of sensors are acquired, the terminal performs subsequent processing on each data, or sends each data to non-terminal equipment such as a server, and the non-terminal equipment such as the server performs subsequent processing on each data. In the embodiment of the present application, it is equivalent to that the acquisition of the source data can be performed by each sensor.
S102: and processing the data through Hash operation to generate a corresponding random number.
After receiving data sent by any sensor arranged in the terminal, the electronic device may process the received data by using a hash operation to generate a random number corresponding to the data. Specifically, the data can be processed by using an SM3 cryptographic hash algorithm. In this embodiment, the electronic device may perform multiple hash operations on the received data. In the embodiment of the present application, the length of the random number generated by the hash operation is 256 bits (bit).
It is worth noting that the hash operation has strong collision resistance, can fully confuse the input sensor data, generates a random number with high quality, can meet the high requirement of a secret key, and does not need to be generated in a hardware mode.
S103: and storing the random number in a random number entropy pool, wherein the random number in the random number entropy pool is used for generating a key.
In this embodiment, after generating the random number, the electronic device may store the random number in a random number entropy pool, where a plurality of random numbers generated in the manner described in this embodiment are stored, and the random number in the random number entropy pool is used to generate the key. Subsequent electronic devices or other devices may generate keys based on the random numbers in the random number entropy pool.
It should be noted that, in order to generate a high-quality random number in the prior art, a random number corresponding to acquired data generally needs to be generated in a hardware manner, and in the embodiment of the present application, a hash operation is adopted to generate a high-quality random number, which does not need to be implemented in a hardware manner. The random number generated by the method provided by the embodiment of the application is a qualified random number meeting the requirements of GM/T0005-2021 randomness test standard, and is a parameter of an important algorithm for generating a key and the like.
The prior art approach significantly reduces the portability, scalability and convenience of the constructed system. Along with the blowout type development of the mobile internet technology, the data processing method adopted in the embodiment of the application is realized in a hardware mode when the random number is generated, and has an important significance for the quotient secret algorithm meeting the standard requirement of the random number. The random number generated in the embodiment of the application can be used for generating a secret key, and the secret key can be applied to a national secret algorithm, wherein the national secret algorithm is widely applied to various information systems, and can protect the security of sensitive data, so that the transmitted information has confidentiality, integrity, authenticable property and non-repudiatable property.
In the embodiment of the application, the electronic device processes the received data through the hash operation to generate the corresponding random number, and the hash operation has strong collision resistance, so that the random number processed through the hash operation has high quality, and thus the random number can generate a high-quality random number meeting requirements.
Example 2:
in order to generate a random number that meets the requirement, on the basis of the foregoing embodiment, in this embodiment of the present application, after receiving data sent by any sensor disposed in a terminal, before the data is processed by a hash operation, the method further includes:
acquiring last data of the data sent by the sensor sending the data;
determining the correlation degree of the previous data and the data according to the value of each bit of the previous data and the value of each bit of the data;
judging whether the correlation degree is greater than a preset correlation degree or not;
and if not, executing the subsequent step of processing the data through hash operation.
In an actual application scenario, data acquired by the sensors have strong time correlation, and data continuously transmitted by the same sensor may be relatively close. In order to ensure the quality of the generated random number, after receiving data sent by any connected sensor, the electronic device may first calculate the correlation between the data and the last data sent by the sensor, and if the correlation between the data and the last data sent by the sensor is low, it indicates that the random number corresponding to the data is random, and then determines to generate the random number corresponding to the data.
In this embodiment of the application, after receiving data sent by any one of the sensors set in the terminal, the electronic device may acquire last data of the data sent by the sensor sending the data, specifically, if the electronic device is a terminal, the terminal may determine, according to the acquired time of each data sent by each sensor, the last data of the data sent by the sensor sending the data; if the electronic device is a non-terminal device such as a server, the terminal sends the identifier corresponding to the sensor and the data to the non-terminal device such as the server after acquiring the data sent by any sensor, and the non-terminal device such as the server can determine the last data of the data sent by the sensor sending the data according to the time when each data is received and the identifier of the corresponding sensor.
Because the data sent by the same sensor has the same number of bits, for example, the data sent by a certain sensor is 32-bit data, after the previous data is determined, the electronic device can determine the correlation degree of the data and the previous data according to the value of each bit of the data and the value of each bit of the previous data, specifically, the electronic device can determine the number of each bit of the data, which is the same as the number of the corresponding bit of the previous data, and determine that the ratio of the number to the number of bits of the data is the correlation degree of the data and the previous data. For example, if the number of each bit of the data is 31, which is the same as the number of the corresponding bit of the previous data, and the number of bits of the data is 32, the correlation is determined to be 31/32.
After determining the correlation degree between the previous data and the data, the electronic device may determine whether the correlation degree is greater than a preset correlation degree, where the preset correlation degree may be 15/16, if the correlation degree is not greater than the preset correlation degree, it is indicated that the data is closer to the previous data, the data has a stronger correlation with the previous data, and if a corresponding random number is generated according to the data, the corresponding random number is not random enough, so that it is determined that the electronic device with invalid data may delete the data without performing a subsequent step of processing the data through a hash operation; if the correlation degree is greater than the preset correlation degree, it indicates that the difference between the data and the previous data is large, and if a corresponding random number is generated according to the data, the corresponding random number is random, so that the electronic device can perform a subsequent step of processing the data through a hash operation on the data.
In the embodiment of the application, when the adjacent data sent by the same sensor have a large difference, the electronic device processes the received data to generate the corresponding random number, and adds the generated random number into the random number entropy pool, so that the random number in the random number entropy pool is relatively random, and the corresponding key can be accurately generated based on the random number in the random number entropy pool.
Fig. 2 is a schematic diagram of a process for generating a random number according to an embodiment of the present disclosure.
As can be seen from fig. 2, the electronic device may receive data sent by any sensor disposed in the terminal, where the sensor disposed in the terminal includes an acceleration sensor, a gyroscope sensor, a magnetic field sensor, and the like, and after receiving the data sent by any sensor, the electronic device determines whether the data is invalid, specifically, if a difference between a last data of the data sent by the sensor that sends the data and the data is within a preset range, the electronic device determines that the data is invalid and deletes the invalid data, and if the data is valid, the electronic device performs a hash operation on the data, generates a random number corresponding to the data, and adds the random number to a random number entropy pool.
Example 3:
in order to accurately generate a random number, in the embodiments of the present application, on the basis of the above embodiments, the processing the data by the hash operation according to the data includes:
splicing the data and the time for receiving the data according to a preset splicing mode;
and performing at least one hash operation on the spliced data.
In order to further ensure the randomness of the generated random numbers, in the embodiment of the present application, the electronic device may splice the received data and the time for receiving the data according to a preset splicing manner, and generate corresponding random numbers based on the spliced data. Specifically, the electronic device can splice the data and the time for receiving the data after the time for receiving the data before the received data; or the data received before the data receiving time is received later, so that the data and the data receiving time are spliced. How to splice the received data and the time for receiving the data is not limited herein.
After the spliced data is obtained, the electronic device may perform at least one hash operation on the spliced data to generate a corresponding random number. It should be noted that, processing data through hash operation may generate relatively random data, and in the embodiment of the present application, the electronic device may perform hash operation on the spliced data twice to obtain a random number, add the random number to the random number entropy pool, and may refer to the random number as a true random number.
If the data collected by the sensor is 512-bit data, the electronic device can splice the 512-bit data with the time for receiving the data, and perform at least one hash operation on the spliced data to generate a 256-bit random number.
Example 4:
in order to avoid resource waste, on the basis of the foregoing embodiments, in an embodiment of the present application, after receiving data sent by any sensor provided in a terminal, before processing the data through a hash operation, the method further includes:
judging whether the number of the random numbers in the random number entropy pool reaches a preset number or not;
and if not, executing the subsequent step of processing the data through hash operation.
In this embodiment of the present application, the number of random numbers that can be stored in the random number entropy pool is limited, and therefore in this embodiment of the present application, a preset number is pre-stored in the electronic device, where the preset number is the maximum number of random numbers that can be stored in the random number entropy pool. After receiving data sent by any sensor arranged in a terminal, the electronic equipment can judge whether the number of the random numbers in the random number entropy pool reaches the preset number, and if the number of the random numbers in the random number entropy pool reaches the preset number, the electronic equipment indicates that no space for storing newly generated random numbers exists in the random number entropy pool, so that the step of processing the data through Hash operation and generating corresponding random numbers does not need to be executed; if the number of the random numbers in the random number entropy pool does not reach the preset number, it indicates that a space for continuously storing the newly generated random numbers still exists in the random number entropy pool, and the electronic device can execute the step of processing the data through the hash operation subsequently to generate the corresponding random numbers.
In the embodiment of the present application, the total maximum length of the random numbers that can be stored in the random number entropy pool is fixed, the maximum length may be 8192 bits, and the length of the random number after the hash operation is fixed, which is 256 bits, so that the preset number may be 32, that is, 8192 bits/256 bits.
Example 5:
for generating the key, on the basis of the foregoing embodiments, in an embodiment of the present application, the method further includes:
receiving a request to generate a key;
acquiring any target random number in the random number entropy pool;
and generating a corresponding key according to the target random number and a preset generation algorithm.
When the user has a need to generate the key, the user can operate the terminal used by the user, and the terminal used by the user can identify the user operation, so that the terminal can receive the request for generating the key. If the electronic device is a server, the terminal may send a request for generating the key to the server, and the server may receive the request for generating the key. In this step, when the user has a need for generating the key, the user may click a preset button, for example, a "generation button", on a preset page in the terminal used by the user, and the terminal may receive a request for generating the key.
In order to generate the key, a plurality of random numbers are stored in the random number entropy pool, and after receiving a request for generating the key, the electronic device may obtain one random number from the random number entropy pool, where the random number is a target random number. The random numbers in the random number entropy pool can be arranged randomly, and when the electronic device obtains the target random number, the electronic device can randomly obtain one random number in the random number entropy pool. The random number in the random number entropy pool is relatively random, and the random number in the random number entropy pool is a random number which meets the high requirement of the secret key on the quality of the random number.
After the target random number is obtained, the electronic device may generate a corresponding key according to the target random number and a pre-configured generation algorithm. In the prior art, how to generate the corresponding key is performed under the condition that the random number and the generation algorithm are known, and details are not described herein.
After the key is generated, the business cryptographic algorithm can be executed according to the key, and the business cryptographic algorithm includes an SM2 signature verification, an SM2 encryption and decryption, an SM3 digest, an SM4 symmetric encryption and decryption algorithm, and the like, and the specific electronic device can utilize a simplified national cryptographic algorithm library software (opennssl) operation library to realize a software-form business cryptographic algorithm by using C or C + + language.
Example 6:
in order to accurately generate a key, on the basis of the above embodiment, in this embodiment of the application, after acquiring any target random number, before generating a corresponding key according to the target random number and a pre-configured generation algorithm, the method further includes:
acquiring a preset target length; wherein the target length does not exceed the length of any random number in the random number entropy pool;
acquiring a sub-random number of the target length from the target random number; and updating the target random number by adopting the sub-random number, and executing the subsequent step of generating a corresponding key according to the target random number and a preset generation algorithm aiming at the updated target random number.
In an actual application scenario, when different types of keys are generated, the lengths of the required random numbers may be different, so in this embodiment of the application, after the electronic device acquires the target random number, the electronic device may acquire a sub-random number of the current required length from the target random number, and generate a corresponding key according to the sub-random number.
In this embodiment of the application, a target length is preconfigured in the electronic device, where the target length is a length of a random number required by the electronic device when generating a key, where the target length does not exceed a length of any random number in a random number entropy pool, and in order to generate a corresponding key, the electronic device may obtain the preconfigured target length after obtaining the target random number, and obtain a sub-random number of the target length from the obtained target random numbers. In the embodiment of the application, the electronic device can obtain the sub-random number with the target length from the target random number, which is equivalent to obtain the sub-random number with the corresponding length according to the actual application requirement.
It should be noted that, the length of the sub-random number is equal to the target length, for example, the electronic device may obtain the sub-random number of the target length after the target random number is 10 bits, where the preset length may be 10 bits (bits), 20 bits, and the like.
For example, the length of the target random number is 256 bits, the preset target length is 10 bits, and the preset length is 10 bits, then the electronic device may obtain sub-random numbers from 11 th bit to 20 th bit in the target random number.
After obtaining the sub-random number, the electronic device may update the target random number with the sub-random number, and generate a corresponding key according to the updated target random number and a pre-configured generation algorithm.
In the embodiment of the application, after the electronic device acquires the target random number, the electronic device acquires the sub-random number with the preset target length according to the target random number, and generates the corresponding key according to the sub-random number and the preset generation algorithm, so that the generation requirement of the key can be met, and the corresponding key can be accurately generated.
In the embodiment of the application, after the key is generated, the key is applied to the cryptographic algorithm. Aiming at the operation of elliptic curve, large number operation and the like related in the national cryptographic algorithm, business personnel can introduce files such as large number operation, elliptic curve, high-level cryptographic functions (EVP) packaging, multiply Accumulation (MAC) operation and the like in an openssl library, and design an efficient national cryptographic algorithm based on a programming tool (Visual Studio2022, VS 2022) of a software developer according to national cryptographic algorithm standards such as GM/T0002 SM4 grouping algorithm, GM/T0003 SM2 elliptic curve public key national cryptographic algorithm, GM/T0004 SM3 cryptographic hash algorithm and the like. According to the function division, the SM2 signature verification, the SM2 encryption and decryption, the SM4 encryption and decryption, the SM3 digest generation and the like are included, and a simplified software algorithm of the national cryptographic algorithm can be provided. The operation efficiency and the resource utilization rate of the electronic equipment can be improved by adopting a simplified openssl operation library.
Example 7:
in order to improve the security of the key, on the basis of the above embodiments, in the embodiment of the present application, the request carries a key identifier of the key to be generated; the method further comprises the following steps:
acquiring a pixel value of each preset pixel point in a pre-stored image; acquiring data of a preset system corresponding to the secret key; the number of each preset pixel point is the same as the number of bits of the data;
adjusting the pixel value of each preset pixel point according to the corresponding numerical value of the corresponding bit in the data in sequence according to the corresponding preset sorting mode of each preset pixel point; and storing the corresponding relation between the image with the adjusted pixel value and the key identifier.
In the embodiment of the application, after the key is generated, if the key is directly stored in the electronic device, the security of the key is low, and in order to improve the security of the key, the electronic device may adjust the pixel values of some pixel points in the image to the pixel values corresponding to the key, so that the key is steganographically written in the image, and the security of the key is improved.
In this embodiment of the application, an image is pre-stored in an electronic device, and after the electronic device generates a key, the electronic device may obtain a pixel value of each pre-set pixel point in the pre-stored image, where each pre-set pixel point may be a pre-set number of pixel points at a lower left corner of the image (where the upper, lower, left, and right sides mentioned here are the upper, lower, left, and right sides in the image), and obtain data of a pre-set system corresponding to the generated key, where the pre-set system may be a binary system, a quaternary system, and the like, and the number of the pre-set pixel points is the same as the number of bits of the data of the pre-set system corresponding to the key.
The electronic device may adjust the pixel value of each preset pixel point to be the value of the corresponding bit of the described data, and specifically, the electronic device may adjust the pixel value of each preset pixel point to be the value of the corresponding bit of the data in sequence according to a preset sorting manner corresponding to each preset pixel point.
In this embodiment, the electronic device may also determine the adjusted pixel value according to the pixel value of each preset pixel point and the value of the corresponding bit of the data. In order to make the adjusted amplitude of the pixel value in the image smaller, the electronic device may adjust the value of the Least Significant Bit (LSB) of the pixel value of each preset pixel point to the value of the corresponding bit in the data, for example, the value of the corresponding bit is 0, the pixel value of the preset pixel point is 255, and the value of the least significant bit of the pixel value is 5, and then the electronic device may adjust the pixel value to 250. How to obtain the LSB value of a certain pixel value is the prior art, and is not described herein again.
In this step, after the key is steganographically written to the image, that is, after the pixel value of the image is adjusted, the corresponding relationship between the image with the pixel value adjusted and the key identifier carried in the request may be saved, so that when the key is obtained, the corresponding image may be obtained. Specifically, when a user has a need for generating a key, the user can select a key identifier on a preset page of a terminal used by the user, and click a preset button, so that the terminal can receive a request for generating the key, and the request for generating the key carries the key identifier of the key to be generated. If the electronic device is a server, the terminal may send the request for generating the key, which carries the key identifier of the key to be generated, to the electronic device.
In this embodiment, in order to steganographically write the key in the image, the electronic device may determine whether the stored image is an image in a Bitmap (BMP) format, convert the image into the image in the BMP format if the stored image is not the image in the BMP format, and perform the above-described adjustment based on the pixel value of each preset pixel in the image after the format conversion.
In the embodiment of the application, the electronic equipment steganographically writes the secret key in the image which is stored in advance, so that the safety of the secret key can be ensured, and the secret key can be safely stored. The pre-stored image can be an image with the highest access authority, that is, the electronic device can steganographically write the key in the image with the highest access authority, so that eavesdropping attack of an adversary can be effectively prevented, and other processes are prevented from contacting sensitive data, namely the key mentioned in the embodiment of the application, so that the security of the key is ensured. The key can be a symmetric key in a cryptographic algorithm, a private key in a public key pair, and other sensitive information.
Fig. 3 is a schematic diagram of a key steganography process provided in an embodiment of the present application.
The electronic device may first obtain the locally stored image, determine whether the image is in the BMP format, and convert the image into the BMP format if the image is not in the BMP format. And aiming at the image in the BMP format, acquiring the pixel value of each preset pixel point in the image, acquiring the data of a preset system corresponding to the secret key, and sequentially adjusting the pixel value of each preset pixel point to the value corresponding to the corresponding bit in the acquired data according to the preset sorting mode corresponding to each preset pixel point. And saving the image after adjusting the pixel values.
In the embodiment of the application, the openssl operation library is used for realizing a specific cryptographic algorithm, wherein a required key is embedded into a predetermined image through a steganographic algorithm and can be encrypted and stored by using a cryptographic library, so that the problem of key security is solved.
Example 8:
in order to obtain a corresponding key, on the basis of the foregoing embodiments, in an embodiment of the present application, the method further includes:
if a key acquisition request carrying a target key identifier is received, acquiring a target image correspondingly stored aiming at the target key identifier; acquiring a pixel value of each preset pixel point in the target image;
and correspondingly sequencing the values corresponding to the pixel values of the preset pixel points according to a preset sequencing mode corresponding to each preset pixel point, and taking the sequenced values as target values of the key corresponding scale of the target key identification to be obtained.
In this step, the terminal may identify an operation of the user, so as to determine that the key acquisition request carrying the target key identifier is received, and if the electronic device is a server, the terminal may send the key acquisition request to the electronic device. Specifically, when a user has a request for acquiring a key, the user may select a target key identifier through a preset page of the terminal used by the user, and click a preset button, for example, an "acquisition button", at this time, the terminal may receive the key acquisition request carrying the target key identifier, if the electronic device is a server, the terminal may send the key acquisition request carrying the target key identifier to the server, and the server may receive the key acquisition request carrying the target key identifier.
In order to obtain the target key, after receiving the key obtaining request carrying the target key identifier, the electronic device may determine, according to a correspondence between a pre-stored key identifier and an image, a target image corresponding to the target key identifier, where the target image is an image obtained by steganographically writing the target key corresponding to the target key identifier, and the electronic device may determine the corresponding target key based on pixel values of pixels in the target image. The electronic device can obtain the pixel value of each preset pixel point in the target image, and after the pixel value of each preset pixel point is obtained, the numerical values corresponding to the pixel values of each preset pixel point can be correspondingly sequenced according to the preset sequencing mode corresponding to each preset pixel point, the electronic device can obtain the numerical values formed after sequencing, and the numerical values are used as the target numerical values of the target key identification corresponding to the to-be-obtained system.
In the above embodiment, if the key is steganographically written in the image, the pixel value of each preset pixel point is adjusted to the value of the corresponding bit in the acquired data of the preset system, and for each preset pixel point, the value corresponding to the pixel value of the preset pixel point is the pixel value of the preset pixel point; if the key is hidden in the image, the LSB value in the pixel value of each preset pixel point is adjusted to the value of the corresponding bit in the acquired data of the preset system, aiming at each preset pixel point, the value corresponding to the pixel value of the preset pixel point is the value of the LSB in the pixel value of the preset pixel point, in the step, the electronic equipment can acquire the value of the LSB in the pixel value of each preset pixel point when the key is generated, correspondingly sequence the LSB value in the pixel value of each preset pixel point according to the preset sequencing mode corresponding to each preset pixel point, acquire the sequenced numerical value, and use the numerical value as the target numerical value of the target key identification corresponding to the system to be acquired.
In this embodiment of the present application, if the decimal system is converted into the binary system when the key is steganographically written in the image, in this step, after the electronic device acquires the value, the electronic device performs binary-to-decimal conversion on the value, and the converted value is the key corresponding to the target key identifier.
Fig. 4 is a schematic diagram of a process for obtaining a target key according to an embodiment of the present application.
As can be seen from fig. 4, after receiving a key acquisition request carrying a target key identifier, the electronic device acquires a target image correspondingly stored for the target key identifier, and if there is a corresponding target image, acquires a pixel value of each preset pixel point in the target image, and correspondingly sorts values corresponding to the pixel values of each preset pixel point according to a preset sorting manner corresponding to each preset pixel point, and uses the sorted values as target values of a key correspondence system of the target key identifier to be acquired. Thereby extracting the target key from the target image.
When the target key is required to be used in the embodiment of the present application, the key can be recovered from the image in the manner described in the above embodiment, so as to ensure the security of the key.
The preset pixel points in the image can be pixel points in an area with complex textures and obvious edges preset by business personnel, so that the electronic equipment can adopt the steganographic method described in the embodiment to steganographically display the secret key in the area with complex textures and obvious edges in the image, and the texture characteristics of the image are fully considered. The application has the advantages that: the method can keep the image information externally presented by the image, keep the integrity of vision, reduce the analysis accuracy of the special steganalysis algorithm and have stronger analysis resistance.
Fig. 5 is a detailed schematic diagram of a key correlation process provided in an embodiment of the present application.
As can be seen from fig. 5, the electronic device may obtain a random number in the random number entropy pool, generate a key based on the random number, and steganographically store the key in an image that is saved in advance, where the image may be an image with the highest access right, and when there is a need to apply the key, extract the key from the image. The secret key can be applied to a national secret algorithm, wherein an opennsl operation library can be adopted for realizing the national secret algorithm.
In order to accurately generate the secret key, on the basis of the foregoing embodiments, in an embodiment of the present application, the method further includes:
and deleting the target random number from a random number entropy pool.
In this embodiment of the application, after a key is generated according to an acquired target random number and a preconfigured algorithm, the electronic device may delete the target random number from the random number entropy pool, so that the random number in the random number entropy pool is not used, and the randomness of the random number in the random number entropy pool is further increased.
In order to further improve the generation rate of the random number, in the embodiment of the application, a sensor data pool may be further stored in the electronic device, data sent by the sensor is stored in the sensor data pool before being processed, the electronic device may process connected sensor data by using a thread concurrency mechanism, and a producer process writes data generated by each sensor into the sensor data pool until the sensor data pool is full; the consumer process continuously consumes the data in the sensor data pool, and generates a random number by using two times of hash operation until the random number entropy pool for storing the random number is full.
Example 9:
fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application, where the apparatus includes:
a receiving module 601, configured to receive data sent by any sensor set in a terminal;
a processing module 602, configured to process the data through a hash operation to generate a corresponding random number;
a storing module 603, configured to store the random number in a random number entropy pool, where the random number in the random number entropy pool is used to generate a key.
In a possible implementation manner, the processing module 602 is further configured to obtain previous data of the data sent by the sensor sending the data; determining the correlation degree of the previous data and the data according to the value of each bit of the previous data and the value of each bit of the data; judging whether the correlation degree is greater than a preset correlation degree or not; and if not, executing the subsequent step of processing the data through hash operation.
In a possible implementation manner, the processing module 602 is specifically configured to splice the data and the time for receiving the data according to a preset splicing manner; and performing at least one hash operation on the spliced data.
In a possible implementation manner, the processing module 602 is further configured to determine whether the number of the random numbers in the random number entropy pool reaches a preset number; and if not, executing the subsequent step of processing the data through hash operation.
In a possible implementation, the processing module 602 is further configured to receive a request for generating a key; acquiring any target random number in the random number entropy pool; and generating a corresponding key according to the target random number and a preset generation algorithm.
In a possible implementation, the processing module 602 is further configured to obtain a preset target length; wherein the target length does not exceed the length of any random number in the random number entropy pool; acquiring a sub-random number of the target length from the target random number; and updating the target random number by adopting the sub-random number, and executing the subsequent step of generating a corresponding key according to the target random number and a preset generation algorithm aiming at the updated target random number.
In a possible implementation manner, the processing module 602 is further configured to obtain a pixel value of each preset pixel point in a pre-stored image; acquiring data of a preset system corresponding to the secret key; the number of each preset pixel point is the same as the number of bits of the data; adjusting the pixel value of each preset pixel point in sequence according to the numerical value of the corresponding bit in the data according to a preset sorting mode corresponding to each preset pixel point; storing the corresponding relation between the image after the pixel value adjustment and the key identification; the request carries a key identifier of a key to be generated.
In a possible implementation manner, the processing module 602 is further configured to, if a key obtaining request carrying a target key identifier is received, obtain a target image correspondingly stored for the target key identifier; acquiring a pixel value of each preset pixel point in the target image; and correspondingly sequencing the numerical values corresponding to the pixel values of each preset pixel point according to a preset sequencing mode corresponding to each preset pixel point, and taking the numerical values formed after sequencing as target numerical values of the key corresponding system of the target key identifier to be obtained.
Example 10:
on the basis of the foregoing embodiments, fig. 7 is a schematic structural diagram of an electronic device provided in an embodiment of the present application, and as shown in fig. 7, the electronic device includes: the system comprises a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702 and the memory 703 are communicated with each other through the communication bus 704.
The memory 703 has stored therein a computer program which, when executed by the processor 701, causes the processor 701 to perform the steps of:
receiving data sent by any sensor arranged in a terminal;
processing the data through Hash operation to generate a corresponding random number;
and storing the random number in a random number entropy pool, wherein the random number in the random number entropy pool is used for generating a key.
Further, the processor 701 is further configured to obtain previous data of the data sent by the sensor that sent the data;
determining the correlation degree of the previous data and the data according to the value of each bit of the previous data and the value of each bit of the data;
judging whether the correlation degree is greater than a preset correlation degree;
if not, executing the subsequent step of processing the data through hash operation.
Further, the processor 701 is specifically configured to splice the data and the time for receiving the data according to a preset splicing manner;
and performing at least one hash operation on the spliced data.
Further, the processor 701 is further configured to determine whether the number of the random numbers in the random number entropy pool reaches a preset number;
and if not, executing the subsequent step of processing the data through hash operation.
Further, the processor 701 is further configured to receive a request for generating a key;
acquiring any target random number in the random number entropy pool;
and generating a corresponding key according to the target random number and a preset generation algorithm.
Further, the processor 701 is further configured to obtain a preset target length; wherein the target length does not exceed the length of any random number in the random number entropy pool;
acquiring a sub-random number of the target length from the target random number; and updating the target random number by adopting the sub-random number, and executing the following steps of generating a corresponding key according to the target random number and a preset generation algorithm aiming at the updated target random number.
Further, the processor 701 is further configured to obtain a pixel value of each preset pixel point in a pre-stored image; acquiring data of a preset system corresponding to the secret key; the number of each preset pixel point is the same as the number of bits of the data;
adjusting the pixel value of each preset pixel point in sequence according to the numerical value of the corresponding bit in the data according to a preset sorting mode corresponding to each preset pixel point; storing the corresponding relation between the image with the adjusted pixel value and the key identifier; the request carries a key identifier of a key to be generated.
Further, the processor 701 is further configured to, if a key acquisition request carrying a target key identifier is received, acquire a target image correspondingly stored for the target key identifier; acquiring a pixel value of each preset pixel point in the target image;
and correspondingly sequencing the numerical values corresponding to the pixel values of each preset pixel point according to a preset sequencing mode corresponding to each preset pixel point, and taking the numerical values formed after sequencing as target numerical values of the key corresponding system of the target key identifier to be obtained.
The communication bus mentioned in the above server may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface 702 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
Example 11:
on the basis of the foregoing embodiments, an embodiment of the present application further provides a computer-readable storage medium, where a computer program executable by an electronic device is stored in the computer-readable storage medium, and when the program is run on the electronic device, the electronic device is caused to perform the following steps:
the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
receiving data sent by any sensor arranged in a terminal;
processing the data through Hash operation to generate a corresponding random number;
and storing the random number in a random number entropy pool, wherein the random number in the random number entropy pool is used for generating a key.
In a possible implementation manner, after receiving data sent by any sensor provided in the terminal and before processing the data through the hash operation, the method further includes:
acquiring the last data of the data sent by the sensor sending the data;
determining the correlation degree of the previous data and the data according to the value of each bit of the previous data and the value of each bit of the data;
judging whether the correlation degree is greater than a preset correlation degree;
and if not, executing the subsequent step of processing the data through hash operation.
In a possible embodiment, the processing the data through the hash operation includes:
splicing the data and the time for receiving the data according to a preset splicing mode;
and performing at least one hash operation on the spliced data.
In a possible implementation manner, after receiving data sent by any sensor provided in the terminal and before processing the data through the hash operation, the method further includes:
judging whether the number of the random numbers in the random number entropy pool reaches a preset number or not;
if not, executing the subsequent step of processing the data through hash operation.
In one possible embodiment, the method further comprises:
receiving a request to generate a key;
acquiring any target random number in the random number entropy pool;
and generating a corresponding key according to the target random number and a pre-configured generation algorithm.
In a possible implementation manner, after the obtaining of any target random number, before the generating of the corresponding key according to the target random number and a pre-configured generation algorithm, the method further includes:
acquiring a preset target length; wherein the target length does not exceed the length of any random number in the random number entropy pool;
acquiring a sub-random number of the target length from the target random number; and updating the target random number by adopting the sub-random number, and executing the following steps of generating a corresponding key according to the target random number and a preset generation algorithm aiming at the updated target random number.
In a possible implementation, the request carries a key identifier of a key to be generated; the method further comprises the following steps:
acquiring a pixel value of each preset pixel point in a pre-stored image; acquiring data of a preset system corresponding to the secret key; the number of each preset pixel point is the same as the number of bits of the data;
adjusting the pixel value of each preset pixel point in sequence according to the numerical value of the corresponding bit in the data according to a preset sorting mode corresponding to each preset pixel point; and storing the corresponding relation between the image with the adjusted pixel value and the key identifier.
In one possible embodiment, the method further comprises:
if a key acquisition request carrying a target key identifier is received, acquiring a target image correspondingly stored aiming at the target key identifier; acquiring a pixel value of each preset pixel point in the target image;
and correspondingly sequencing the numerical values corresponding to the pixel values of each preset pixel point according to a preset sequencing mode corresponding to each preset pixel point, and taking the numerical values formed after sequencing as target numerical values of the key corresponding system of the target key identifier to be obtained.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
Claims (11)
1. A method of data processing, the method comprising:
receiving data sent by any sensor arranged in a terminal;
processing the data through Hash operation to generate a corresponding random number;
and storing the random number in a random number entropy pool, wherein the random number in the random number entropy pool is used for generating a key.
2. The method according to claim 1, wherein after receiving data sent by any sensor provided in the terminal and before processing the data through the hash operation, the method further comprises:
acquiring the last data of the data sent by the sensor sending the data;
determining the correlation degree of the previous data and the data according to the value of each bit of the previous data and the value of each bit of the data;
judging whether the correlation degree is greater than a preset correlation degree;
and if not, executing the subsequent step of processing the data through hash operation.
3. The method of claim 1, wherein the processing the data by a hash operation comprises:
splicing the data and the time for receiving the data according to a preset splicing mode;
and performing at least one hash operation on the spliced data.
4. The method according to claim 1, wherein after receiving data sent by any sensor provided in a terminal and before processing the data through the hash operation, the method further comprises:
judging whether the number of the random numbers in the random number entropy pool reaches a preset number or not;
if not, executing the subsequent step of processing the data through hash operation.
5. The method according to any one of claims 1-4, further comprising:
receiving a request to generate a key;
acquiring any target random number in the random number entropy pool;
and generating a corresponding key according to the target random number and a pre-configured generation algorithm.
6. The method according to claim 5, wherein after the obtaining of any target random number, before the generating of the corresponding key according to the target random number and a pre-configured generation algorithm, the method further comprises:
acquiring a preset target length; wherein the target length does not exceed the length of any random number in the random number entropy pool;
acquiring a sub-random number of the target length from the target random number; and updating the target random number by adopting the sub-random number, and executing the subsequent step of generating a corresponding key according to the target random number and a preset generation algorithm aiming at the updated target random number.
7. The method according to claim 5, wherein the request carries a key identifier of a key to be generated; the method further comprises the following steps:
acquiring a pixel value of each preset pixel point in a pre-stored image; acquiring data of a preset system corresponding to the secret key; the number of each preset pixel point is the same as the number of bits of the data;
adjusting the pixel value of each preset pixel point in sequence according to the numerical value of the corresponding bit in the data according to a preset sorting mode corresponding to each preset pixel point; and storing the corresponding relation between the image with the adjusted pixel value and the key identifier.
8. The method of claim 7, further comprising:
if a key acquisition request carrying a target key identifier is received, acquiring a target image correspondingly stored aiming at the target key identifier; acquiring a pixel value of each preset pixel point in the target image;
and correspondingly sequencing the numerical values corresponding to the pixel values of each preset pixel point according to a preset sequencing mode corresponding to each preset pixel point, and taking the numerical values formed after sequencing as target numerical values of the key corresponding system of the target key identifier to be obtained.
9. A data processing apparatus, characterized in that the apparatus comprises:
the receiving module is used for receiving data sent by any sensor arranged in the terminal;
the processing module is used for processing the data through Hash operation to generate corresponding random numbers;
and the storage module is used for storing the random number in a random number entropy pool, wherein the random number in the random number entropy pool is used for generating a key.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor realizes the steps of the data processing method according to any of claims 1-8 when executing the program.
11. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the data processing method according to any one of claims 1 to 8.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211244805.1A CN115603906A (en) | 2022-10-12 | 2022-10-12 | Data processing method, device, equipment and medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211244805.1A CN115603906A (en) | 2022-10-12 | 2022-10-12 | Data processing method, device, equipment and medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115603906A true CN115603906A (en) | 2023-01-13 |
Family
ID=84847737
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211244805.1A Pending CN115603906A (en) | 2022-10-12 | 2022-10-12 | Data processing method, device, equipment and medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115603906A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118611867A (en) * | 2024-05-30 | 2024-09-06 | 东风商用车有限公司 | Random number generation method, device, vehicle and storage medium |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105429959A (en) * | 2015-11-02 | 2016-03-23 | 北京旷视科技有限公司 | Image processing method and client device, image verification method and server |
| CN110168494A (en) * | 2016-11-29 | 2019-08-23 | 大陆-特韦斯股份有限公司 | For to the control unit of vehicle network provide random number method and vehicle network used to perform the method |
| CN111190570A (en) * | 2018-11-15 | 2020-05-22 | 北京创原天地科技有限公司 | High-quality random number generator and random number generation method |
| CN111259419A (en) * | 2020-01-15 | 2020-06-09 | 海南新软软件有限公司 | Random number encryption method and device based on multiple sensors |
| CN111930343A (en) * | 2020-06-09 | 2020-11-13 | 山东浪潮质量链科技有限公司 | Method, device and medium for acquiring random number and generating random number |
| CN112580077A (en) * | 2020-12-21 | 2021-03-30 | 歌尔光学科技有限公司 | Information processing method, device, equipment and storage medium |
| US20220147319A1 (en) * | 2018-07-16 | 2022-05-12 | STMicroelectronics (Grand Ouest) SAS | Method and system for managing the operation of a group of several connected objects |
-
2022
- 2022-10-12 CN CN202211244805.1A patent/CN115603906A/en active Pending
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105429959A (en) * | 2015-11-02 | 2016-03-23 | 北京旷视科技有限公司 | Image processing method and client device, image verification method and server |
| CN110168494A (en) * | 2016-11-29 | 2019-08-23 | 大陆-特韦斯股份有限公司 | For to the control unit of vehicle network provide random number method and vehicle network used to perform the method |
| US20220147319A1 (en) * | 2018-07-16 | 2022-05-12 | STMicroelectronics (Grand Ouest) SAS | Method and system for managing the operation of a group of several connected objects |
| CN111190570A (en) * | 2018-11-15 | 2020-05-22 | 北京创原天地科技有限公司 | High-quality random number generator and random number generation method |
| CN111259419A (en) * | 2020-01-15 | 2020-06-09 | 海南新软软件有限公司 | Random number encryption method and device based on multiple sensors |
| CN111930343A (en) * | 2020-06-09 | 2020-11-13 | 山东浪潮质量链科技有限公司 | Method, device and medium for acquiring random number and generating random number |
| CN112580077A (en) * | 2020-12-21 | 2021-03-30 | 歌尔光学科技有限公司 | Information processing method, device, equipment and storage medium |
Non-Patent Citations (1)
| Title |
|---|
| ERBAY, C ;ERGÜN, S: "Random Number Generator Based on Hydrogen Gas Sensor for Security Applications", 2018 IEEE 61ST INTERNATIONAL MIDWEST SYMPOSIUM ON CIRCUITS AND SYSTEMS (MWSCAS), 1 March 2019 (2019-03-01), pages 1 - 4 * |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118611867A (en) * | 2024-05-30 | 2024-09-06 | 东风商用车有限公司 | Random number generation method, device, vehicle and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111698088A (en) | Key alternation method, key alternation device, electronic equipment and medium | |
| US12261935B2 (en) | Protecting polynomial hash functions from external monitoring attacks | |
| TWI835300B (en) | A data matching method, device, equipment and medium | |
| CN110611568B (en) | Dynamic encryption and decryption method, device and equipment based on multiple encryption and decryption algorithms | |
| CN109787754B (en) | Data encryption and decryption method, computer readable storage medium and server | |
| CN112073444B (en) | Data set processing method and device and server | |
| CN108173885B (en) | Data encryption method, data decryption method and related devices | |
| CN108431819B (en) | Method and system for protecting client access to service of DRM agent of video player | |
| US10333699B1 (en) | Generating a pseudorandom number based on a portion of shares used in a cryptographic operation | |
| CN114386058A (en) | A model file encryption and decryption method and device | |
| WO2017006118A1 (en) | Secure distributed encryption system and method | |
| CN111316250B (en) | Protecting cryptographic keys stored in non-volatile memory | |
| CN116260572B (en) | Data hash processing method, data verification method and electronic equipment | |
| CN116132065B (en) | Key determination method, device, computer equipment and storage medium | |
| CN113901502A (en) | Data processing method and device, electronic equipment and storage medium | |
| CN115603906A (en) | Data processing method, device, equipment and medium | |
| CN111404892A (en) | Data supervision method and device and server | |
| CN115361237A (en) | Data encryption transmission method and system for cloud terminal interaction | |
| CN118200049B (en) | Encryption method, encryption device, equipment and medium for financial data | |
| CN113505348B (en) | Watermark embedding method, watermark verifying method and watermark embedding device for data | |
| CN114785524A (en) | Electronic seal generation method, device, equipment and medium | |
| CN107133517B (en) | Data recovery method based on data encryption and calculation in memory | |
| US11924320B2 (en) | Devices and methods for protecting cryptographic programs | |
| CN116488922A (en) | Electronic commerce data transmission method and device based on block chain | |
| AU2021100948A4 (en) | Enhancing cyber security using high speed hybrid authentication technique |
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 |