Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method and an apparatus for implementing a block chain ledger based on material spectral characteristics, which have multiple data transmission modes, can meet the user's requirements for diversified data transmission modes, and has high security of data transmission, in view of the above-mentioned defects in the prior art.
The technical scheme adopted by the invention for solving the technical problems is as follows: a block chain ledger implementation method based on material spectral characteristics is constructed, and comprises the following steps:
A) verifying spectral feature data associated with the material by equipment coupled to the processor to obtain verified spectral feature data, encrypting the spectral feature data by an encryption algorithm, and transmitting the encrypted spectral feature data to a block chain ledger for storage through a wireless communication module; the wireless communication module is any one or combination of any several of a 5G communication module, a 4G communication module, a Bluetooth module, a WiFi module, a GSM module, a CDMA2000 module, a WCDMA module, a TD-SCDMA module, a Zigbee module and a LoRa module;
B) generating, by the device coupled to a processor, a set of information corresponding to a transaction of the material in a blockchain associated with the material.
In the method for realizing the block chain ledger based on the material spectrum characteristics, the encryption algorithm is a DES encryption algorithm, an AES encryption algorithm, an RSA encryption algorithm, a Base64 encryption algorithm, an MD5 encryption algorithm, an SHA1 encryption algorithm, an HMAC encryption algorithm or an ECC encryption algorithm.
In the method for realizing the block chain ledger based on the material spectral characteristics, the equipment coupled to the processor provides verification and generation as a service in a cloud computing environment.
In the method for realizing the block chain ledger based on the material spectral characteristics, the spectral characteristic data comprises the near-infrared characteristics of the material.
The invention also relates to a device for realizing the block chain ledger implementation method based on the material spectral characteristics, which comprises the following steps:
the spectral characteristic encryption transmission unit: the device is coupled to the processor and used for verifying spectral feature data associated with the material to obtain verified spectral feature data, encrypting the spectral feature data through an encryption algorithm and transmitting the encrypted spectral feature data to the block chain ledger through the wireless communication module for storage; the wireless communication module is any one or combination of any several of a 5G communication module, a 4G communication module, a Bluetooth module, a WiFi module, a GSM module, a CDMA2000 module, a WCDMA module, a TD-SCDMA module, a Zigbee module and a LoRa module;
an information generation unit: generating, by the device coupled to a processor, a set of information corresponding to a transaction of the material in a blockchain associated with the material.
In the device of the present invention, the encryption algorithm is a DES encryption algorithm, an AES encryption algorithm, an RSA encryption algorithm, a Base64 encryption algorithm, an MD5 encryption algorithm, an SHA1 encryption algorithm, an HMAC encryption algorithm, or an ECC encryption algorithm.
In the apparatus of the present invention, authentication and generation as a service in a cloud computing environment is provided by the device coupled to the processor.
In the apparatus of the present invention, the spectral feature data includes a near-infrared feature of the material.
The implementation of the method and the device for realizing the block chain ledger based on the material spectral characteristics has the following beneficial effects: the spectral feature data associated with the material is verified by equipment coupled to the processor to obtain verified spectral feature data, and the spectral feature data is encrypted by an encryption algorithm and then transmitted to the block chain ledger for storage through the wireless communication module; the wireless communication module is any one or combination of any several of a 5G communication module, a 4G communication module, a Bluetooth module, a WiFi module, a GSM module, a CDMA2000 module, a WCDMA module, a TD-SCDMA module, a Zigbee module and a LoRa module; the invention has various data transmission modes, can meet the requirements of users on the various data transmission modes, and has higher data transmission safety.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the embodiment of the method and the device for implementing the blockchain ledger based on the material spectral characteristics, a flow chart of the method for implementing the blockchain ledger based on the material spectral characteristics is shown in fig. 1. In fig. 1, the method for implementing a blockchain ledger based on material spectral characteristics includes the following steps:
step S01, verifying spectral feature data associated with the material by a device coupled to the processor to obtain verified spectral feature data, encrypting the spectral feature data with an encryption algorithm, and transmitting the encrypted spectral feature data to a blockchain ledger for storage via a wireless communication module: in this step, the spectral feature data associated with the material is verified by a device coupled to the processor, such that verified spectral feature data is obtained, and the spectral feature data is encrypted by an encryption algorithm and then transmitted to the blockchain ledger for storage via the wireless communication module. The spectral feature data includes near infrared features of the material. Authentication and generation as a service in a cloud computing environment is provided by a device coupled to a processor.
The encryption algorithm is DES encryption algorithm, AES encryption algorithm, RSA encryption algorithm, Base64 encryption algorithm, MD5 encryption algorithm, SHA1 encryption algorithm, HMAC encryption algorithm or ECC encryption algorithm. By encrypting data, the security of data transmission is higher.
The DES encryption algorithm is a block cipher, data is encrypted by taking 64 bits as a block, the key length of the DES encryption algorithm is 56 bits, and the same algorithm is used for encryption and decryption. The DES encryption algorithm is to keep secret a key, while the public algorithm includes encryption and decryption algorithms. In this way, only a person who has mastered the same key as the sender can interpret the ciphertext data encrypted by the DES encryption algorithm. Thus, deciphering the DES encryption algorithm is actually the encoding of the search key. For a 56 bit long key, the number of operations is 256 if the search is done exhaustively. As the capabilities of computer systems continue to evolve, the security of the DES encryption algorithm is much weaker than it would have been if it had just appeared, yet it can still be considered sufficient from the practical standpoint of non-critical nature. However, the DES encryption algorithm is now only used for authentication of old systems, and new encryption standards are more selected.
The AES encryption algorithm is an advanced encryption standard in cryptography, adopts a symmetric block cipher system, the minimum support of the key length is 128, 192 and 256, the block length is 128 bits, and the algorithm is easy to realize by various hardware and software. This encryption algorithm is a block encryption standard adopted by the federal government in the united states, which is used to replace the original DES encryption algorithm, has been analyzed by many parties and is widely used throughout the world. The AES encryption algorithm is designed to support 128/192/256 bit (/32 ═ nb) data block sizes (i.e., packet lengths); the cipher length of 128/192/256 bits (/32 ═ nk) is supported, and in a 10-bit system, 34 × 1038, 62 × 1057 and 1.1 × 1077 keys are corresponded.
The RSA encryption algorithm is currently the most influential public key encryption algorithm and is generally considered to be one of the most elegant public key schemes at present. RSA is the first algorithm that can be used for both encryption and parity signing, which is resistant to all cryptographic attacks known so far, and has been recommended by ISO as the public key data encryption standard. The RSA encryption algorithm is based on a very simple number theory fact: it is easy to multiply two large prime numbers, but it is then desirable, but it is then extremely difficult to factorize their product, so the product can be made public as an encryption key.
The Base64 encryption algorithm is one of the most common encoding modes for transmitting 8-bit byte codes on a network, and the Base64 encoding can be used for transmitting longer identification information under the HTTP environment. For example, in the JAVAPERSISTENCE system HIBEMATE, Base64 was used to encode a longer unique identifier as a string used as a parameter in HTTP forms and HTTP GETTL. In other applications, it is also often necessary to encode the binary data into a form suitable for placement in a URL (including a hidden form field). In this case, the encoding by Base64 is not only relatively short, but also has the property of being unreadable, i.e., the encoded data cannot be directly seen by human eyes.
The MD5 encryption algorithm is a hash function widely used in the field of computer security to provide integrity protection for messages. A brief description of the MD5 encryption algorithm may be: MD5 processes incoming information in 512-bit packets, each of which is divided into 16 32-bit sub-packets, and after a series of processing, the output of the algorithm consists of four 32-bit packets, which are concatenated to produce a 128-bit hash value. The MD5 encryption algorithm is widely used for password authentication and key identification of various software. The MD5 encryption algorithm uses a hash function, and its typical application is to digest a piece of information to prevent tampering. A typical application of the MD5 encryption algorithm is to generate a finger print for a piece of Message to prevent "tampering". The use of the MD5 encryption algorithm also prevents "repudiation" by the author of the document if there is a third party certificate authority, a so-called digital signature application. The MD5 encryption algorithm is also widely used for login authentication of operating systems, such as UNIX, various BSD system login passwords, digital signatures, and so on.
The SHA1 encryption algorithm is a message digest algorithm that is as popular as the MD5 encryption algorithm. The SHA encryption algorithm mimics the MD4 encryption algorithm. TheSHA encryption algorithm 1 is designed to be used with a Digital Signature Algorithm (DSA). The SHA1 encryption algorithm is mainly applicable to the digital signature algorithm defined in the digital signature standard. For messages less than 2 "64 bits in length, the SHA1 encryption algorithm would generate a 160-bit message digest. This message digest may be used to verify the integrity of the data when the message is received. During the transmission, the data is likely to change, and then different message digests are generated at this time. The SHA1 encryption algorithm may not recover information from a message digest, and two different messages may not produce the same message digest. Thus, the SHA1 encryption algorithm can verify the integrity of the data, so the SHA1 encryption algorithm is said to be a technique for ensuring the integrity of the file.
The SHA1 encryption algorithm may take no more than 264 bits of data input and produce a 160-bit digest. The input is divided into blocks of 512 bits and processed separately. A 160-bit buffer is used to hold the intermediate and final results of the hash function. The buffer may be represented by 5 32-bit registers (A, B, C, D and E). The SHA1 encryption algorithm is an algorithm with stronger security than the MD5 encryption algorithm, and theoretically, all digital authentication algorithms adopting a message digest mode have collision, namely, message digests calculated by two different things are the same, so that the intercommunication cheating graph is the same. However, the algorithm with high security is difficult to find the 'collision' of the specified data, and the 'collision' is more difficult to calculate by using the formula, so far, only the MD5 in the general security algorithm is broken.
The HMAC encryption algorithm is a key-dependent Hash-based message authentication Code (Hash-based message authentication Code), and the HMAC encryption algorithm uses a Hash algorithm (MD5, SHA1, etc.) and takes a key and a message as inputs to generate a message digest as an output. The keys of the sender and the receiver of the HMAC encryption algorithm are calculated, and a third party without the keys cannot calculate the correct hash value, so that data can be prevented from being tampered.
The ECC encryption algorithm is also an asymmetric encryption algorithm, the main advantage being that it provides a comparable or higher level of security in some cases using a smaller key than other methods, such as the RSA encryption algorithm. One disadvantage, however, is that the encryption and decryption operations are implemented longer than other mechanisms (which are more CPU-intensive than the RSA algorithm).
The wireless communication module is any one or combination of any several of a 5G communication module, a 4G communication module, a Bluetooth module, a WiFi module, a GSM module, a CDMA2000 module, a WCDMA module, a TD-SCDMA module, a Zigbee module and a LoRa module. Through setting up multiple wireless communication mode, not only can increase the flexibility of wireless communication mode, can also satisfy the demand of different users and different occasions. Especially, when adopting the loRa module, its communication distance is far away, and communication performance is comparatively stable, is applicable to the occasion that requires the communication quality to be higher. The adoption of the 5G communication mode can achieve high data rate, reduce delay, save energy, reduce cost, improve system capacity and realize large-scale equipment connection. The method has multiple data transmission modes and can meet the requirements of users on diversified data transmission modes.
Step S02 generates, by a device coupled to the processor, a set of information corresponding to a transaction for a material in a blockchain associated with the material.
The embodiment also relates to a device for implementing the method for implementing the block chain ledger based on the material spectral characteristics, and a schematic structural diagram of the device is shown in fig. 2. In fig. 2, the apparatus includes a spectral featureencryption transmission unit 1 and aninformation generation unit 2; the spectral characteristicencryption transmission unit 1 is used for verifying spectral characteristic data associated with a material by equipment coupled to a processor to obtain verified spectral characteristic data, encrypting the spectral characteristic data by an encryption algorithm, and transmitting the encrypted spectral characteristic data to a block chain ledger through a wireless communication module for storage; the spectral feature data includes near infrared features of the material. Authentication and generation as a service in a cloud computing environment is provided by a device coupled to a processor.
The encryption algorithm is DES encryption algorithm, AES encryption algorithm, RSA encryption algorithm, Base64 encryption algorithm, MD5 encryption algorithm, SHA1 encryption algorithm, HMAC encryption algorithm or ECC encryption algorithm. By encrypting data, the security of data transmission is higher.
The DES encryption algorithm is a block cipher, data is encrypted by taking 64 bits as a block, the key length of the DES encryption algorithm is 56 bits, and the same algorithm is used for encryption and decryption. The DES encryption algorithm is to keep secret a key, while the public algorithm includes encryption and decryption algorithms. In this way, only a person who has mastered the same key as the sender can interpret the ciphertext data encrypted by the DES encryption algorithm. Thus, deciphering the DES encryption algorithm is actually the encoding of the search key. For a 56 bit long key, the number of operations is 256 if the search is done exhaustively. As the capabilities of computer systems continue to evolve, the security of the DES encryption algorithm is much weaker than it would have been if it had just appeared, yet it can still be considered sufficient from the practical standpoint of non-critical nature. However, the DES encryption algorithm is now only used for authentication of old systems, and new encryption standards are more selected.
The AES encryption algorithm is an advanced encryption standard in cryptography, adopts a symmetric block cipher system, the minimum support of the key length is 128, 192 and 256, the block length is 128 bits, and the algorithm is easy to realize by various hardware and software. This encryption algorithm is a block encryption standard adopted by the federal government in the united states, which is used to replace the original DES encryption algorithm, has been analyzed by many parties and is widely used throughout the world. The AES encryption algorithm is designed to support 128/192/256 bit (/32 ═ nb) data block sizes (i.e., packet lengths); the cipher length of 128/192/256 bits (/32 ═ nk) is supported, and in a 10-bit system, 34 × 1038, 62 × 1057 and 1.1 × 1077 keys are corresponded.
The RSA encryption algorithm is currently the most influential public key encryption algorithm and is generally considered to be one of the most elegant public key schemes at present. RSA is the first algorithm that can be used for both encryption and parity signing, which is resistant to all cryptographic attacks known so far, and has been recommended by ISO as the public key data encryption standard. The RSA encryption algorithm is based on a very simple number theory fact: it is easy to multiply two large prime numbers, but it is then desirable, but it is then extremely difficult to factorize their product, so the product can be made public as an encryption key.
The Base64 encryption algorithm is one of the most common encoding modes for transmitting 8-bit byte codes on a network, and the Base64 encoding can be used for transmitting longer identification information under the HTTP environment. For example, in the JAVAPERSISTENCE system HIBEMATE, Base64 was used to encode a longer unique identifier as a string used as a parameter in HTTP forms and HTTP GETTL. In other applications, it is also often necessary to encode the binary data into a form suitable for placement in a URL (including a hidden form field). In this case, the encoding by Base64 is not only relatively short, but also has the property of being unreadable, i.e., the encoded data cannot be directly seen by human eyes.
The MD5 encryption algorithm is a hash function widely used in the field of computer security to provide integrity protection for messages. A brief description of the MD5 encryption algorithm may be: MD5 processes incoming information in 512-bit packets, each of which is divided into 16 32-bit sub-packets, and after a series of processing, the output of the algorithm consists of four 32-bit packets, which are concatenated to produce a 128-bit hash value. The MD5 encryption algorithm is widely used for password authentication and key identification of various software. The MD5 encryption algorithm uses a hash function, and its typical application is to digest a piece of information to prevent tampering. A typical application of the MD5 encryption algorithm is to generate a finger print for a piece of Message to prevent "tampering". The use of the MD5 encryption algorithm also prevents "repudiation" by the author of the document if there is a third party certificate authority, a so-called digital signature application. The MD5 encryption algorithm is also widely used for login authentication of operating systems, such as UNIX, various BSD system login passwords, digital signatures, and so on.
The SHA1 encryption algorithm is a message digest algorithm that is as popular as the MD5 encryption algorithm. The SHA encryption algorithm mimics the MD4 encryption algorithm. TheSHA encryption algorithm 1 is designed to be used with a Digital Signature Algorithm (DSA). The SHA1 encryption algorithm is mainly applicable to the digital signature algorithm defined in the digital signature standard. For messages less than 2 "64 bits in length, the SHA1 encryption algorithm would generate a 160-bit message digest. This message digest may be used to verify the integrity of the data when the message is received. During the transmission, the data is likely to change, and then different message digests are generated at this time. The SHA1 encryption algorithm may not recover information from a message digest, and two different messages may not produce the same message digest. Thus, the SHA1 encryption algorithm can verify the integrity of the data, so the SHA1 encryption algorithm is said to be a technique for ensuring the integrity of the file.
The SHA1 encryption algorithm may take no more than 264 bits of data input and produce a 160-bit digest. The input is divided into blocks of 512 bits and processed separately. A 160-bit buffer is used to hold the intermediate and final results of the hash function. The buffer may be represented by 5 32-bit registers (A, B, C, D and E). The SHA1 encryption algorithm is an algorithm with stronger security than the MD5 encryption algorithm, and theoretically, all digital authentication algorithms adopting a message digest mode have collision, namely, message digests calculated by two different things are the same, so that the intercommunication cheating graph is the same. However, the algorithm with high security is difficult to find the 'collision' of the specified data, and the 'collision' is more difficult to calculate by using the formula, so far, only the MD5 in the general security algorithm is broken.
The HMAC encryption algorithm is a key-dependent Hash-based message authentication Code (Hash-based message authentication Code), and the HMAC encryption algorithm uses a Hash algorithm (MD5, SHA1, etc.) and takes a key and a message as inputs to generate a message digest as an output. The keys of the sender and the receiver of the HMAC encryption algorithm are calculated, and a third party without the keys cannot calculate the correct hash value, so that data can be prevented from being tampered.
The ECC encryption algorithm is also an asymmetric encryption algorithm, the main advantage being that it provides a comparable or higher level of security in some cases using a smaller key than other methods, such as the RSA encryption algorithm. One disadvantage, however, is that the encryption and decryption operations are implemented longer than other mechanisms (which are more CPU-intensive than the RSA algorithm).
The wireless communication module is any one or combination of any several of a 5G communication module, a 4G communication module, a Bluetooth module, a WiFi module, a GSM module, a CDMA2000 module, a WCDMA module, a TD-SCDMA module, a Zigbee module and a LoRa module. Through setting up multiple wireless communication mode, not only can increase the flexibility of wireless communication mode, can also satisfy the demand of different users and different occasions. Especially, when adopting the loRa module, its communication distance is far away, and communication performance is comparatively stable, is applicable to the occasion that requires the communication quality to be higher. The adoption of the 5G communication mode can achieve high data rate, reduce delay, save energy, reduce cost, improve system capacity and realize large-scale equipment connection. The device of the invention has various data transmission modes and can meet the requirements of users on diversified data transmission modes.
Theinformation generating unit 2 is for generating, by a device coupled to the processor, a set of information corresponding to a transaction of a material in a blockchain associated with the material.
In summary, in this embodiment, the spectral feature data associated with the material is verified by the device coupled to the processor to obtain verified spectral feature data, and the spectral feature data is encrypted by the encryption algorithm and then transmitted to the block chain ledger for storage through the wireless communication module; the wireless communication module is any one or combination of any several of a 5G communication module, a 4G communication module, a Bluetooth module, a WiFi module, a GSM module, a CDMA2000 module, a WCDMA module, a TD-SCDMA module, a Zigbee module and a LoRa module; the invention has various data transmission modes, can meet the requirements of users on the various data transmission modes, and has higher data transmission safety.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.