CN112613760A - Product quality evaluation method and system based on block chain technology - Google Patents
Product quality evaluation method and system based on block chain technology Download PDFInfo
- Publication number
- CN112613760A CN112613760A CN202011570336.3A CN202011570336A CN112613760A CN 112613760 A CN112613760 A CN 112613760A CN 202011570336 A CN202011570336 A CN 202011570336A CN 112613760 A CN112613760 A CN 112613760A
- Authority
- CN
- China
- Prior art keywords
- data
- product
- digital signature
- block
- block data
- 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.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0639—Performance analysis of employees; Performance analysis of enterprise or organisation operations
- G06Q10/06395—Quality analysis or management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K17/00—Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
- G06K17/0022—Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device
- G06K17/0025—Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device the arrangement consisting of a wireless interrogation device in combination with a device for optically marking the record carrier
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
- G06Q50/02—Agriculture; Fishing; Mining
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/21—Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/2151—Time stamp
Abstract
The invention relates to a product quality evaluation method based on a block chain technology, which comprises the following steps: collecting initial data of a product; processing the initial data of the product to obtain structured data of the product; carrying out digital signature on the product structured data and adding a timestamp to obtain block data; the digital signature is obtained by a digital signature method based on GRS codes of a finite field; carrying out workload certification on the block data; broadcasting the block data with the workload proved to be successful through a block chain; receiving the block data of the broadcast, and verifying the digital signature of the block data; if the verification is successful, the block data is proved not to be tampered; and performing quality evaluation on the block data after the verification is successful according to a set product quality evaluation rule. The scheme of the invention can ensure the real effectiveness of the input product parameters for quality evaluation, improve the reliability and credibility of the quality evaluation result and provide effective and real reference data for consumers.
Description
Technical Field
The invention belongs to the technical field of product quality evaluation, and particularly relates to a method and a system for evaluating product quality based on a block chain technology.
Background
In order to increase the yield or improve the appearance of the agricultural products, various fertilizers and pesticides are used in large quantities in the planting process of the agricultural products, and the produced agricultural products have direct influence on the health of people.
Although many organic products are available in the market, consumers are not willing to buy bills for higher prices of organic products because the consumers cannot effectively confirm the specific planting information and the product quality of the organic products when purchasing the organic products.
Disclosure of Invention
In order to solve the above problems in the prior art, the present invention provides a method and a system for evaluating product quality based on a block chain technique. The technical problem to be solved by the invention is realized by the following technical scheme:
in a first aspect, an embodiment of the present invention provides a method for evaluating product quality based on a block chain technique, including:
acquiring initial data of a product, wherein the initial data comprises soil data, product type data, region data and time data;
processing the initial data of the product to obtain structured data of the product;
carrying out digital signature on the product structured data and adding a timestamp to obtain block data; the digital signature is obtained by a digital signature method based on GRS codes of a finite field;
carrying out workload certification on the block data;
broadcasting the block data with the workload proved to be successful through a block chain;
receiving the broadcasted block data and verifying a digital signature of the block data; if the verification is successful, the block data is proved to be not tampered;
and performing quality evaluation on the block data after the verification is successful according to a set product quality evaluation rule.
In an embodiment of the present invention, after the quality evaluation is performed on the successfully verified block data according to the set product quality evaluation rule, the method further includes:
and generating a new two-dimensional code by using the quality evaluation result and the corresponding block information of the product so as to provide the new two-dimensional code for consumer query.
In an embodiment of the present invention, the processing the initial data of the product to obtain the structured data of the product includes:
processing operation of eliminating abnormal data and unifying precision values of various types of data is carried out on the initial data of the product; and inputting the preprocessed product initial data into a relational database to form product structured data.
In one embodiment of the present invention, the digital signature is obtained by a digital signature method based on a GRS code of a finite field, including:
constructing a GRS code based on a finite field;
generating a public key and a private key according to the GRS code;
performing hash operation on the storage address to obtain an abstract value;
and encrypting the digest value by using the private key to obtain a digital signature.
In an embodiment of the present invention, the verifying the digital signature of the block data includes:
decrypting the digital signature by using the public key to obtain a digest value to be verified;
carrying out Hash operation on the block data to obtain an abstract value;
and comparing the abstract value to be verified with the abstract value, and if the abstract value to be verified is equal to the abstract value, successfully verifying.
In a second aspect, an embodiment of the present invention provides a product quality assessment system based on a block chain technique, including:
the system comprises a data acquisition module, a data processing module and a data processing module, wherein the data acquisition module is used for acquiring initial data of a product, and the initial data comprises soil data, product type data, region data and time data;
the data processing module is used for processing the initial data of the product to obtain structured data of the product;
the block data generation module is used for carrying out digital signature on the product structured data and adding a timestamp to obtain block data; the digital signature is obtained by a digital signature method based on GRS codes of a finite field;
the workload certification module is used for carrying out workload certification on the block data;
the block data broadcasting module is used for broadcasting the block data after the workload is proved to be successful through a block chain;
the block data verification module is used for receiving the broadcasted block data and verifying the digital signature of the block data; if the verification is successful, the block data is proved to be not tampered;
and the product quality evaluation module is used for evaluating the quality of the block data after the verification is successful according to the set product quality evaluation rule.
In one embodiment of the present invention, further comprising:
and the quality query module is used for generating a new two-dimensional code from the quality evaluation result and the corresponding block information of the product so as to provide the new two-dimensional code for consumers to query.
In an embodiment of the present invention, the processing the initial data of the product to obtain the structured data of the product includes:
and inputting the initial data of the product into a relational database to form structured data of the product.
In one embodiment of the present invention, the digital signature is obtained by a digital signature method based on a GRS code of a finite field, including:
constructing a GRS code based on a finite field;
generating a public key and a private key according to the GRS code;
performing hash operation on the storage address to obtain an abstract value;
and encrypting the digest value by using the private key to obtain a digital signature.
In an embodiment of the present invention, the verifying the digital signature of the block data includes:
decrypting the digital signature by using the public key to obtain a digest value to be verified;
carrying out Hash operation on the block data to obtain an abstract value;
and comparing the abstract value to be verified with the abstract value, and if the abstract value to be verified is equal to the abstract value, successfully verifying.
According to the product quality evaluation method and system based on the block chain technology, provided by the embodiment of the invention, by adopting the block chain technology and the digital signature technology based on the GRS code of the finite field, the authenticity and effectiveness of the input product parameters for quality evaluation can be ensured, the reliability and credibility of the quality evaluation result are improved, and effective and authentic reference data are provided for consumers.
The present invention will be described in further detail with reference to the accompanying drawings and examples.
Drawings
Fig. 1 is a flowchart of a method for evaluating product quality based on a block chain technique according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a product quality assessment system based on a block chain technique according to an embodiment of the present invention;
FIG. 3 is a diagram of a feasibility simulation result of a signature method provided by an embodiment of the invention;
FIG. 4 is a diagram of a result of a feasibility simulation of a signature method provided by an embodiment of the present invention under different error correction capabilities;
fig. 5 is a simulation result diagram of the signature method provided by the embodiment of the present invention under the ISD decoding attack;
fig. 6 is a diagram of a simulation result of the public key amount of the signature method provided in the embodiment of the present invention under different error correction capabilities.
Detailed Description
The present invention will be described in further detail with reference to specific examples, but the embodiments of the present invention are not limited thereto.
In order to realize effective evaluation of the quality of agricultural products and achieve traceability and tamper resistance of information, the embodiment of the invention provides a method and a system for evaluating the quality of the products by using a block chain technology.
In a first aspect, an embodiment of the present invention provides a method for evaluating product quality based on a block chain technique, including:
and S11, collecting initial data of the product, wherein the initial data comprises soil data, product type data, region data and time data.
Optionally, the soil data may be data of nutrient element content, heavy metal content, and the like, and the data may be acquired by a soil component detector and a soil heavy metal detector arranged in the soil; the product variety data refers to the specific variety of the agricultural product; the regional data refers to the specific geographical position where the agricultural product is planted; the time data refers to the specific picking time of the produce. The initial data of the product can effectively evaluate the quality of the product and can also be visually provided for consumers to refer.
And S12, processing the initial data of the product to obtain the structured data of the product.
The collected initial data of the product may have some abnormal data or data obviously not conforming to the collection cycle rule; or the precision of the collected various data is not uniform; therefore, the collected initial data of the product needs to be preprocessed, and the collected data needs to be further structured into structured data after being preprocessed for the subsequent generation of block data.
Optionally, the step may include:
processing operation of eliminating abnormal data and unifying precision values of various data is carried out on initial data of the product; and inputting the preprocessed product initial data into a relational database to form product structured data.
S13, carrying out digital signature on the product structured data and stamping a time stamp to obtain block data; the digital signature is obtained by a digital signature method based on GRS codes of a finite field.
The step can ensure that the acquired product data cannot be falsified in the transmission process and ensure the effectiveness of quality evaluation by carrying out digital signature on the product structured data and adding a timestamp.
As a preferred embodiment, the digital signature method in this step may include the steps of:
s131, constructing a GRS code based on a finite field;
s132, generating a public key and a private key according to the GRS code;
s133, carrying out hash operation on the storage address to obtain an abstract value;
and S134, encrypting the digest value by using a private key to obtain a digital signature.
Compared with the traditional digital signature method adopting a Hash algorithm, the digital signature method adopting the GRS code based on the finite field has higher safety and higher signature efficiency.
And S14, carrying out workload certification on the block data.
Workload certification is an economic strategy to deal with abuse of services and resources, or to block service attacks. Generally, the user is required to perform some complex operations with a time consuming and appropriate amount, and the answer can be quickly verified by the server, so that the consumed time, equipment and energy are used as warranty cost to ensure that the services and resources are used by the real demand.
As an implementation manner, the scheme of the embodiment of the present invention uses a Hash algorithm to perform workload verification, for example, uses a Hash256 algorithm. And if the calculated number of the first n-bit zeros of the character string is consistent with that set by the system, the workload is considered to prove successful, and then the block information is propagated to other nodes.
And S15, broadcasting the block data after the workload certification is successful through the block chain.
And connecting the block data with the successful workload verification to the corresponding blocks to form a block chain. If the block information of a certain block is to be modified, the workload certification work of all blocks needs to be recalculated, when the number of blocks connected behind a certain block reaches a certain value, the recalculation of all workload certifications of the block and the blocks behind the block is almost impossible, and therefore the data in the block cannot be tampered. Meanwhile, the block broadcasts the received block information to the neighbor nodes, so that the information of the whole block chain is updated, the information of all the nodes is kept basically consistent, and all the node data is maintained collectively, thereby embodying the disclosure and fairness of the system.
S16, receiving the broadcasted block data, and verifying the digital signature of the block data; if the verification is successful, the block data is proved not to be tampered.
After each node receives the block data, the time stamp needs to be checked, and the authenticity of the received block data is verified through the signature verification of the digital signature.
Optionally, verifying the digital signature of the block data includes:
s161, decrypting the digital signature by using the public key to obtain a digest value to be verified;
s162, carrying out hash operation on the block data to obtain an abstract value;
and S163, comparing the digest value to be verified with the digest value, and if the digest value to be verified is equal to the digest value, the verification is successful.
It should be noted that the verification process of the digital signature corresponds to the digital signature method, that is, the process of verifying the digital signature generated by the digital signature method, the public key used is the public key generated in the signature process, and the public key and the block data are transmitted to each node through the block chain.
And S17, performing quality evaluation on the block data after the verification is successful according to the set product quality evaluation rule.
The block data is successfully verified, which indicates that the block data is not tampered in the transmission process, and can be used as a valid input for quality evaluation.
The set product quality evaluation rule can be any existing quality evaluation rule containing the corresponding agricultural product acquisition parameters, for example, the weight of soil data, product type data, region data and time data of the agricultural products can be specifically set, and evaluation is carried out according to a certain rule.
As an embodiment, the set product quality assessment rule may be performed according to the following formula:
wherein, V(t)Representing the mass fraction, a, of different agricultural products calculated by a formulatmIs the weight of product quality in different time periods, n is the number of time intervals, t is the type of different agricultural products, wtiWeights of NPK elements, p, obtained by training for different agricultural productsiIs the value of the soil after the content of nutrient elements is pretreated, j is the kind of heavy metal elements in the soil, MtjWeight of influence of heavy metals in the calculation, q, obtained by training for different agricultural productsjIs the result of heavy metal element content pretreatment obtained by a soil heavy metal detector.
And inputting the collected data into the formula to evaluate the quality of the specific agricultural products.
The product quality evaluation method based on the block chain technology of the invention, after the block data after the successful verification is subjected to quality evaluation according to the set product quality evaluation rule, further comprises the following steps:
and generating a new two-dimensional code by the quality evaluation result and the corresponding block information of the product so as to provide the new two-dimensional code for the consumer to inquire.
According to the product quality evaluation method based on the block chain technology, provided by the embodiment of the invention, by adopting the block chain technology and the digital signature technology based on the GRS code of the finite field, the authenticity and validity of the input product parameters for quality evaluation can be ensured, the reliability and credibility of the quality evaluation result are improved, and effective and authentic reference data are provided for consumers.
In a second aspect, an embodiment of the present invention further provides a product quality evaluation system based on a block chain technique.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a product quality evaluation system based on a block chain technique according to an embodiment of the present invention. The product quality evaluation system based on the block chain technology comprises the following steps:
the data acquisition module 21 is configured to acquire initial data of a product, where the initial data includes soil data, product category data, region data, and time data.
Optionally, the soil data may be data of nutrient element content, heavy metal content, and the like, and the data may be acquired by a soil component detector and a soil heavy metal detector arranged in the soil; the product variety data refers to the specific variety of the agricultural product; the regional data refers to the specific geographical position where the agricultural product is planted; the time data refers to the specific picking time of the produce. The initial data of the product can effectively evaluate the quality of the product and can also be visually provided for consumers to refer.
And the data processing module 22 is used for processing the initial data of the product to obtain the structured data of the product.
The collected initial data of the product may have some abnormal data or data obviously not conforming to the collection cycle rule; or the precision of the collected various data is not uniform; therefore, the collected initial data of the product needs to be preprocessed, and the collected data needs to be further structured into structured data after being preprocessed for the subsequent generation of block data.
Optionally, the module may be used as:
processing operation of eliminating abnormal data and unifying precision values of various data is carried out on initial data of the product; and inputting the preprocessed product initial data into a relational database to form product structured data.
The block data generation module 23 is configured to digitally sign the product structured data and add a timestamp to the product structured data to obtain block data; the digital signature is obtained by a digital signature method based on GRS codes of a finite field.
The module can ensure that the acquired product data cannot be falsified in the transmission process by carrying out digital signature on the product structured data and adding the timestamp, and ensures the effectiveness of quality evaluation.
As a preferred embodiment, the digital signature method in this step may include the steps of:
s231, constructing a GRS code based on a finite field;
s232, generating a public key and a private key according to the GRS code;
s233, carrying out hash operation on the storage address to obtain an abstract value;
and S234, encrypting the digest value by using a private key to obtain a digital signature.
Compared with the traditional digital signature method adopting a Hash algorithm, the digital signature method adopting the GRS code based on the finite field has higher safety and higher signature efficiency.
And a workload certification module 24, configured to perform workload certification on the block data.
Workload certification is an economic strategy to deal with abuse of services and resources, or to block service attacks. Generally, the user is required to perform some complex operations with a time consuming and appropriate amount, and the answer can be quickly verified by the server, so that the consumed time, equipment and energy are used as warranty cost to ensure that the services and resources are used by the real demand.
As an implementation manner, the scheme of the embodiment of the present invention uses a Hash algorithm to perform workload verification, for example, uses a Hash256 algorithm. And if the calculated number of the first n-bit zeros of the character string is consistent with that set by the system, the workload is considered to prove successful, and then the block information is propagated to other nodes.
The block data broadcasting module 25 is configured to broadcast the block data with the workload proven successful through the block chain.
The module is used for connecting the block data with the successful workload certification to the corresponding blocks so as to form a block chain. If the block information of a certain block is to be modified, the workload certification work of all blocks needs to be recalculated, when the number of blocks connected behind a certain block reaches a certain value, the recalculation of all workload certifications of the block and the blocks behind the block is almost impossible, and therefore the data in the block cannot be tampered. Meanwhile, the block broadcasts the received block information to the neighbor nodes, so that the information of the whole block chain is updated, the information of all the nodes is kept basically consistent, and all the node data is maintained collectively, thereby embodying the disclosure and fairness of the system.
A block data verification module 26, configured to receive the broadcasted block data and verify a digital signature of the block data; if the verification is successful, the block data is proved not to be tampered.
After each node receives the block data, the time stamp needs to be checked, and the authenticity of the received block data is verified through the signature verification of the digital signature.
Optionally, verifying the digital signature of the block data includes:
s261, decrypting the digital signature by using the public key to obtain a digest value to be verified;
s262, carrying out hash operation on the block data to obtain an abstract value;
and S263, comparing the abstract value to be verified with the abstract value, and if the abstract value to be verified is equal to the abstract value, the verification is successful.
It should be noted that the verification process of the digital signature corresponds to the digital signature method, that is, the process of verifying the digital signature generated by the digital signature method, the public key used is the public key generated in the signature process, and the public key and the block data are transmitted to each node through the block chain.
And the product quality evaluation module 27 is used for evaluating the quality of the block data after the verification is successful according to the set product quality evaluation rule.
The block data is successfully verified, which indicates that the block data is not tampered in the transmission process, and can be used as a valid input for quality evaluation.
The set product quality evaluation rule can be any existing quality evaluation rule containing the corresponding agricultural product acquisition parameters, for example, the weight of soil data, product type data, region data and time data of the agricultural products can be specifically set, and evaluation is carried out according to a certain rule.
As an embodiment, the set product quality assessment rule may be performed according to the following formula:
wherein, V(t)Representing the mass fraction, a, of different agricultural products calculated by a formulatmIs the weight of product quality in different time periods, n is the number of time intervals, t is the type of different agricultural products, wtiWeights of NPK elements, p, obtained by training for different agricultural productsiIs the value of the soil after the content of nutrient elements is pretreated, j is the kind of heavy metal elements in the soil, MtjWeight of influence of heavy metals in the calculation, q, obtained by training for different agricultural productsjIs the result of heavy metal element content pretreatment obtained by a soil heavy metal detector.
And inputting the collected data into the formula to evaluate the quality of the specific agricultural products.
Optionally, the product quality evaluation system based on the block chain technique provided in the embodiment of the present invention may further include:
and the quality query module is used for generating a quality evaluation result and the corresponding block information of the product into a new two-dimensional code so as to provide the new two-dimensional code for consumers to query.
According to the product quality evaluation system based on the block chain technology, provided by the embodiment of the invention, by adopting the block chain technology and the digital signature technology based on the GRS code of the finite field, the authenticity and validity of the input product parameters for quality evaluation can be ensured, the reliability and credibility of the quality evaluation result are improved, and effective and authentic reference data are provided for consumers.
The method and system for evaluating product quality based on block chain technology of the present invention all use the digital signature method based on the GRS code of the finite field, and the digital signature method and the verification method are described in detail below, but it should be understood that the digital signature method and the verification method are only one or more alternative embodiments of the digital signature method of the GRS code of the finite field.
For example, the method for digitally signing the GRS code based on the finite field may include the following steps:
s131, constructing a GRS code based on a finite field.
By way of example, this step may include: constructing a finite field, and constructing a GRS code (generalized Reed-Solomon code) with a code length of n, a dimension of k and an error correction capability of t according to the finite field, wherein n, k and t are all any positive integers and satisfy the requirement of
Wherein the finite field can select a finite field F comprising q elementsqAnd selecting a positive integer m so that q satisfies q 2m。
It should be noted that the selection of the embodiment of the present invention is based on the finite field FqInstead of being based on the normal binary system, because the code with the same security level (such as Goppa code) is based on the finite field F when facing the ISD decoding attackqThe Goppa code of (2) has a smaller public key amount than the binary-based Goppa code. For example, a finite field based Goppa code with a security level of 128, with a public key amount of 725740 bits; and a binary Goppa code-based, public key quantity of 1537536bits with a security level of 128. In contrast, based on the finite field FqThe amount of public keys of Goppa code is nearly an order of magnitude smaller than that of the public keys based on binary Goppa code.
In addition, the GRS code is selected rather than the other codes (e.g., Goppa code) because the GRS code is a very large distance separable (MDS) code, which has good performance; the existing coder and decoder of the GRS code has a plurality of applications in various fields and good practicability; furthermore, GRS codes are more flexible than Goppa codes; and the GRS code has the advantage of stronger expandability.
And S132, generating a public key and a private key according to the GRS code.
The public key and the private key are generated based on the GRS code of the finite field, so that the public key and the private key can be ensured to have higher safety performance and smaller occupied space, and different public keys and private keys are generated aiming at different logistics information. One public key can decrypt only one encrypted tag.
In an alternative embodiment, S132 may include steps S1321 to S1324.
S1321, selecting an (n-k) x (n-k) nonsingular matrix, an n x n dense matrix and an n x n sparse matrix in a finite field, wherein the rank of the dense matrix is z, the average row weight and the column weight of the sparse matrix are x, z is a natural number, z is smaller than n, and x is smaller than n.
As an embodiment of the present invention, a dense matrix may be adopted, in which the rank z is much smaller than n, and the average row weight and column weight x of the sparse matrix are much smaller than n.
In particular, a dense matrix may be represented by the product of the transpose of the matrix and the matrix, i.e.WhereinIs a finite field FqTwo zxn matrices are defined above, and the rank of the matrix is z.
Optionally, in the scheme of the present invention, the following choices for selecting the parameters m, n, k, t, and x are available as reference in table 1, and there are some choices and not limited to these, but considering the correctness, feasibility, and security of the scheme, and the public key amount and signature length, the scheme of the present invention preferably adopts three sets of parameter values listed in table 1.
TABLE 1 parameter selection
m | n | k | t | x |
12 | 4094 | 4074 | 10 | 1~1.1 |
16 | 65534 | 65516 | 9 | 1~1.1 |
10 | 1022 | 1002 | 10 | 1~1.1 |
And S1322, performing matrix addition operation on the dense matrix and the sparse matrix to obtain a transformation matrix.
Specifically, the addition operation adopts formula (1):
wherein the content of the first and second substances,a transformation matrix is represented that is,a dense matrix is represented that is,a sparse matrix is represented.
S1323, performing matrix multiplication on the inverse matrix of the nonsingular matrix, the check matrix and the transposed matrix of the transformation matrix to obtain a public key; wherein, the check matrix is an (n-k) x n matrix of the GRS code.
Specifically, the multiplication operation adopts formula (2):
wherein the content of the first and second substances,which represents the public key(s),representing the inverse of the non-singular matrix,a check matrix is represented that is,representing a transpose of the transform matrix.
S1324, converting the nonsingular matrixCheck matrixTransformation matrixAnd decoding algorithmAs the private key.
It will be appreciated that the public key is used for external disclosure and the private key is used for storage. The public key and the private key are two different parameter sets in an algorithm, but are inherently associated with each other, and are generated simultaneously but can be used independently.
And S133, carrying out hash operation on the storage address to obtain the digest value.
The hash operation refers to an algorithm that can map a message with any length into a message with a fixed length, and the hash operation implemented by the present invention can adopt any one of MD4, MD5, or SHA 256. The address is stored as unencrypted plaintext, the plaintext is characters which can be intuitively understood by a person, the plaintext is encrypted by a Hash algorithm to map the plaintext with any length into a string of ciphertext with fixed length, the ciphertext is an encrypted character string, the person cannot intuitively understand the meaning of the string of ciphertext, and the string of ciphertext is a digital abstract. In the step, through Hash operation, a digest value is generated from the plaintext of the storage address, and the digest value is used for the next encryption of the storage address.
In an alternative embodiment, S133 may include S1331 to S1332.
And S1331, performing primary hash operation on the storage address needing to be digitally signed.
If M represents the block data plaintext, the initial hash operation is performed on the storage address to obtain h (M).
And S1332, performing hash operation on the result obtained by the primary hash operation again to obtain the abstract value.
In this step, the result h (M) obtained by the primary hash operation is subjected to the hash operation again to obtain the storage address abstract SxI.e. calculating SxH (m) i), wherein i is 0,1,2 … …. In the embodiment of the invention, i is taken to be 0, so that the storage address abstract S is storedxIs a vector of length n-k.
In other embodiments, the digest value may be obtained by one or more hash operations, and the output length may be satisfied.
And S134, encrypting the digest value by using a private key to obtain a digital signature.
Illustratively, this step may include S1341 to S1342:
s1341, multiplying the nonsingular matrix and the abstract value to obtain a syndrome to be translated.
Specifically, the multiplication operation adopts formula (3):
wherein, S'xWhich represents the syndrome to be interpreted,representing a non-singular matrix, SxRepresenting the digest value.
S1342, decoding the syndrome to be decoded and using the obtained error vector as a digital signature.
Illustratively, this step may include, in turn, S14421 to S14423:
s13421, decoding the syndrome to be decoded by using a decoding algorithm by combining the transformation matrix of the private key to obtain a first error vector.
Any existing decoding algorithm can be selected as the decoding algorithm, and in this embodiment, the decoding algorithm is preferably an iterative decoding algorithm in the time domain, that is,: BM iterative decoding algorithms (Berlekamp-Massey), Chien search algorithms (Chien), and Forney algorithms. The decoding algorithm is fast in speed, simple to implement and easy to implement by a computer, so that the decoding algorithm is a fast decoding algorithm.
Optionally, the decoding algorithm may include the following steps:
the method comprises the following steps: calculating a syndrome;
step two: determining an error location polynomial;
step three: determining an error estimation function;
step four: and solving the error position number and the error numerical value, and correcting errors.
Completing the four steps to finish one-time decoding, and if the decoding is successful, directly decoding an error vector; otherwise, it is considered as decoding failure.
With reference to the scheme of the embodiment of the present invention, if the decoding fails, i' is changed to i +1, and the hash operation is restarted from S1331 to decode again until the decoding succeeds, so as to obtain the first error vector.
S13422, performing matrix multiplication operation on the first error vector and an inverse matrix of the transformation matrix of the private key to obtain a second error vector, wherein the weight of the second error vector is less than or equal to the error correction capability value of the GRS code.
Specifically, the multiplication operation in this step adopts formula (4):
wherein the content of the first and second substances,which represents a second error vector, is,which represents a first error vector, is shown,an inverse matrix of a transformation matrix representing the private key.
S13423, the second error vector is used as a digital signature.
So far, a digital signature based on an error vector error correction code has been obtained, but the error vector occupies more bits due to the existence of a plurality of 0 elements. In order to reduce the bit number, the scheme provided by the invention can be further optimized on the basis of the embodiment.
Preferably, after obtaining the second error vector, the method further includes the following steps:
and constructing an index pair for the second error vector to obtain the index pair of the second error vector.
Specifically, the index pair of the second error vector can be obtained according to equation (5).
Wherein, IeRepresenting an index pair.
Extracting non-zero elements in the second error vector and marking as error values, and constructing an index pair I of the second error vector by using the error position alpha and the error position ce。
Accordingly, the index pair is treated as a digital signature.
In a preferred scheme, by further establishing an index pair for the generated second error vector and using the index as a digital signature, the number of bits can be reduced, thereby reducing the signature length.
The signature method is based on a finite field FqThe GRS code generates a public key and a private key, a digest value is obtained according to a plaintext, and the digest value is encrypted by using the private key to obtain a digital signature. The digital signature scheme has high feasibility, and can reduce the public key amount, improve the digital signature efficiency and further improve the security.
By way of example, the method for verifying the digital signature includes:
s161, the digital signature is decrypted by using the public key to obtain the digest value to be verified.
Corresponding to the scheme that the obtained second error vector is used as the digital signature in the signature method, the step is to directly decrypt the second error vector by using a public key to obtain a digest value to be verified.
Corresponding to the scheme that the obtained index pair is used as the digital signature in the signature method, in the step, the second error vector needs to be restored according to the index pair, and then the public key is used for decrypting the second error vector to obtain the digest value to be verified.
In particular, the second error vector needs to be recovered from the index pair, i.e. in index pair IeMiddle alphajPosition of index by cjFilling in at αjThe positions outside the index are filled with 0's until the vectorUp to (n-k).
And decrypting the second error vector by using the public key, namely obtaining a digest value to be verified according to a formula (6):
wherein y represents the digest value to be verified.
Computing public keysAccording to ajValue of corresponding row of index and cjAnd taking the product as the digest value to be verified.
And S162, carrying out Hash operation on the plaintext to obtain the digest value.
Similarly, the hash operation needs to be performed on the plaintext twice, and the specific steps are the same as S13, which is not described herein again. The digest value y' is obtained by two hash operations, i.e., h (m) i).
And S163, comparing the abstract value to be verified with the abstract value, and if the abstract value to be verified is equal to the abstract value, the verification is successful.
In the embodiment of the invention, the digest value y to be verified is compared with the digest value y ', if y is equal to y', the digest value to be verified is equal to the digest value, and the signature is verified successfully; otherwise, the signature fails to be verified.
In the following, the scheme provided by the embodiment of the present invention is verified in terms of five aspects, namely, the correctness, feasibility, security, public key amount and signature length of the digital signature.
(1) Correctness:
the verification of the correctness is also the verification of whether the signature verification is successful or not, and the correctness can be proved by proving that the digest value to be verified obtained by decrypting the second error vector by using the public key is equal to the digest value obtained in the process of generating the signature. The specific process is as follows:
using a public key pairDecrypting the two error vectors to obtain a digest value to be verified, wherein the public key is obtained by performing matrix multiplication on the basis of an inverse matrix of a nonsingular matrix, a check matrix and a transpose matrix of a change matrix, namely the formula (2); the second error vector is obtained by matrix multiplication based on the first error vector and the inverse matrix of the change matrix of the private key, namely, the formula (4); the digest value to be verified is based on each column in the public key according to alphajValue of corresponding row of index and cjThe product of (a) is obtained, i.e., the above formula (6).
Therefore, by substituting the formula (2) and the formula (4) into the formula (6),
by simplifying the formula in the above formula (7), the following can be obtained:
wherein y represents the digest value to be verified,representing the inverse, S 'of the nonsingular matrix'xRepresenting the syndrome to be translated.
The syndrome to be translated is obtained by multiplying the non-singular matrix by the digest value, i.e. the above formula (3).
Thus, according to equation (3), y is obtained as SxThat is, y' can be obtained, and the verification is successful, which indicates that the signature is correct.
(2) Feasibility:
based on a finite field FqThe total syndrome number of the GRS code is N, and N is qn-k=q2t=q2mtThe number of syndromes that can be decoded is M, anTherefore to the digest value SxThe probability of finding success isI.e. the average number of lookups is
Based on finite field FqThe parameter pair (m, t) of the GRS code signature is selected to ensure that the average search times is below ten million orders of magnitude, and the selection of the parameter pair cannot be too small.
Referring to fig. 3, fig. 3 is a diagram illustrating a feasibility simulation result of the signature method according to the embodiment of the present invention. The figure shows the log of the error correction capability t and the average number of lookups2The relationship between Z. As can be seen from fig. 3, the log of the error correction capability t and the average number of lookups2Z is proportional, i.e. the average number of seeks Z is exponential to the error correction capability t.
The horizontal line in FIG. 3 represents operations of the order of tens of millions, where data x represents m and y represents log2Z。
When the value of the error correction capability t is greater than 10, the average search times will be too large, and therefore, it is more suitable that the error correction capability t is selected to be less than or equal to 10.
Referring to fig. 4, fig. 4 is a diagram of a feasibility simulation result of the signature method provided by the embodiment of the present invention under different error correction capabilities. Fig. 4 shows the relationship between m and the logarithm of the average number of lookups when the error correction capability t is 9 and 10. In the figure, x represents m, and y represents log2And Z. As can be seen from FIG. 4, when m.gtoreq.12, log increases with m2Z tends to be smooth with little change; when m is<12, the average number of lookups is increased. Therefore, m is greater thanA value equal to 12 is suitable.
In addition, two sets of data from table 2 can be obtained from fig. 4:
TABLE 2(a)
m(t=10) | 6 | 8 | 10 | 12 | 14 | 16 | 18 |
log2Z | 23.33 | 22.16 | 21.88 | 21.81 | 21.80 | 21.79 | 21.79 |
TABLE 2(b)
m(t=9) | 6 | 8 | 10 | 12 | 14 | 16 | 18 |
log2Z | 19.74 | 18.78 | 18.55 | 18.49 | 18.47 | 18.4703 | 18.47 |
The CFS signature is known to use parameter pairs (m, t) of (15,10) and (16, 9). When the parameter pair is (15,10), the logarithm value of the average search number of the CFS signature is 27.7911, based on the finite field FqThe logarithm value of the average search times of the GRS code signature is 21.7933; logarithm of average number of lookups for CFS signature when parameter pair is (16,9)Value 18.4691, based on finite field FqThe log value of the average number of lookups of the GRS code signature of (a) is 18.4703.
In contrast, under two parameter pairs, the CFS signature is based on the finite field FqThe average search times of GRS code signatures have little difference, so the invention is based on the finite field FqThe GRS code digital signature method has feasibility.
(3) Safety:
referring to fig. 5, fig. 5 is a simulation result diagram of the signature method provided by the embodiment of the present invention under the ISD decoding attack. Fig. 5 shows the relationship of m to the security level SL in the case of an ISD decoding attack.
And the product of the security level coefficient under the ISD decoding attack and m and t is in an exponential relation, and t is selected to be less than or equal to 10 based on the condition. I.e. when t is determined, the larger m, the higher the security level coefficient.
In the figure, data x represents m, and y represents SL. As can be seen from FIG. 5, based on the finite field FqThe digital signature of the GRS code of (1) can reach a security level SL of 80 when the parameter pair is selected as (10,10), the general security level has been reached, and the security level SL exceeds 128 when the parameter pair is selected as (16, 9).
Under the ISD decoding attack, when the parameter pair is (15,10), the security level coefficient SL of the CFS signature is 76.89 and is based on a finite field FqThe security level coefficient SL of the GRS code signature of is 135.42; when the parameter pair is (16,9), the security level coefficient SL of the CFS signature is 76.92 based on the finite field FqThe security level coefficient SL of the GRS code signature of (a) is 135.56.
In comparison, the finite field F-based method provided by the embodiment of the inventionqThe GRS code signature has a higher security level coefficient under the attack of ISD decoding.
In addition, the embodiment of the invention provides a finite field FqThe GRS code signature can also effectively resist the distinguishing attack, and the parameter selection of the CFS signature under the distinguishing attack has defects.
(4) Public key quantity:
in the embodiment of the invention, check matrix of GRS code is enteredLine Gaussian elimination to obtain a line ladder matrix, i.e. a public keyThe public key quantity of (a) is k (n-k). Thus, based on the finite field FqThe public key quantity is k (n-k) log on the GRS code2q。
Referring to fig. 6, fig. 6 is a graph of a simulation result of the public key quantity of the signature method provided by the embodiment of the present invention under different error correction capabilities. Fig. 6 shows the relationship between m and the public key amount when the error correction capability t is 9 and 10. In the figure, data x represents m, and y represents k (n-k) log2q is calculated. As can be seen from fig. 6, the public key amount has an exponential relationship with m, and the influence on the public key amount is not obvious under different error correction capabilities t. Although when m is larger, based on the finite field FqThe more secure the GRS code signature, but also the larger the amount of public keys. Therefore, a more suitable m is selected, so that the safety factor is higher and the public key quantity is smaller, for example, m is 10 or 12.
(5) Signature length:
the embodiment of the invention provides a finite field FqThe signature length of the GRS code is 2 m.tp+log2Z。
Table 3 is based on the finite field FqThe GRS code signature and the CFS signature are compared with each other in average search times, security level, public key amount and signature length under two different parameter pairs.
Table 3 parameter comparison of finite field Fq-based GRS code signature and CFS signature under different parameter pairs
As can be seen from table 3, the finite field F-based method provided by the embodiment of the present invention is based on different parameter pairsqThe security level coefficient of the GRS code signature is higher than that of the CFS signature, but the amount of public keys and the length of the digital signature are larger.
Therefore, selecting several different sets of parameter pairs is based on the finite field FqSigned by GRS code ofThe results of the simulation are shown in Table 4.
TABLE 4 different parameter pairs based on finite field FqParameter of GRS code signature
Parameter pair | Average number of lookups | Security Level (SL) | Amount of public key | Signature Length (bits) |
(11,9) | 18.5072 | 85.5239 | 401544 | 195 |
(10,10) | 21.8829 | 80.3254 | 200400 | 202 |
(12,10) | 21.8140 | 102.3972 | 977760 | 238 |
The GRS code signature based on the finite field Fq provided by the embodiment of the invention can reduce the selection of parameter pairs and reduce the public key amount and the signature length on the premise of improving the security level coefficient.
The verification shows that the digital signature scheme of the invention has the effects of correctness, feasibility, safety, reduction of public key quantity, reduction of signature length and the like.
Therefore, as a more preferable scheme, the product quality assessment method and system based on the block chain technology based on the digital signature method and the verification method further improve the tamper resistance and the security of the product input data for quality assessment, and the signature efficiency and the verification efficiency are high.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.
Claims (10)
1. A method for evaluating product quality based on block chain technology is characterized by comprising the following steps:
acquiring initial data of a product, wherein the initial data comprises soil data, product type data, region data and time data;
processing the initial data of the product to obtain structured data of the product;
carrying out digital signature on the product structured data and adding a timestamp to obtain block data; the digital signature is obtained by a digital signature method based on GRS codes of a finite field;
carrying out workload certification on the block data;
broadcasting the block data with the workload proved to be successful through a block chain;
receiving the broadcasted block data and verifying a digital signature of the block data; if the verification is successful, the block data is proved to be not tampered;
and performing quality evaluation on the block data after the verification is successful according to a set product quality evaluation rule.
2. The method according to claim 1, further comprising, after the quality evaluation of the verified block data according to the set product quality evaluation rule:
and generating a new two-dimensional code by using the quality evaluation result and the corresponding block information of the product so as to provide the new two-dimensional code for consumer query.
3. The method of claim 1, wherein the processing the initial data of the product to obtain the structured data of the product comprises:
processing operation of eliminating abnormal data and unifying precision values of various types of data is carried out on the initial data of the product; and inputting the preprocessed product initial data into a relational database to form product structured data.
4. The method of claim 1, wherein the digital signature is obtained by a finite field GRS code-based digital signature method, and comprises:
constructing a GRS code based on a finite field;
generating a public key and a private key according to the GRS code;
performing hash operation on the storage address to obtain an abstract value;
and encrypting the digest value by using the private key to obtain a digital signature.
5. The method of claim 4, wherein the verifying the digital signature of the block data comprises:
decrypting the digital signature by using the public key to obtain a digest value to be verified;
carrying out Hash operation on the block data to obtain an abstract value;
and comparing the abstract value to be verified with the abstract value, and if the abstract value to be verified is equal to the abstract value, successfully verifying.
6. A system for assessing product quality based on block chain technology, comprising:
the system comprises a data acquisition module, a data processing module and a data processing module, wherein the data acquisition module is used for acquiring initial data of a product, and the initial data comprises soil data, product type data, region data and time data;
the data processing module is used for processing the initial data of the product to obtain structured data of the product;
the block data generation module is used for carrying out digital signature on the product structured data and adding a timestamp to obtain block data; the digital signature is obtained by a digital signature method based on GRS codes of a finite field;
the workload certification module is used for carrying out workload certification on the block data;
the block data broadcasting module is used for broadcasting the block data after the workload is proved to be successful through a block chain;
the block data verification module is used for receiving the broadcasted block data and verifying the digital signature of the block data; if the verification is successful, the block data is proved to be not tampered;
and the product quality evaluation module is used for evaluating the quality of the block data after the verification is successful according to the set product quality evaluation rule.
7. The system of claim 6, further comprising:
and the quality query module is used for generating a new two-dimensional code from the quality evaluation result and the corresponding block information of the product so as to provide the new two-dimensional code for consumers to query.
8. The system according to claim 6, wherein said processing said product initial data to obtain product structured data comprises:
and inputting the initial data of the product into a relational database to form structured data of the product.
9. The system of claim 6, wherein the digital signature is obtained by a digital signature method based on finite field GRS codes, and comprises:
constructing a GRS code based on a finite field;
generating a public key and a private key according to the GRS code;
performing hash operation on the storage address to obtain an abstract value;
and encrypting the digest value by using the private key to obtain a digital signature.
10. The system according to claim 9, wherein the verifying the digital signature of the block data comprises:
decrypting the digital signature by using the public key to obtain a digest value to be verified;
carrying out Hash operation on the block data to obtain an abstract value;
and comparing the abstract value to be verified with the abstract value, and if the abstract value to be verified is equal to the abstract value, successfully verifying.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011570336.3A CN112613760A (en) | 2020-12-26 | 2020-12-26 | Product quality evaluation method and system based on block chain technology |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011570336.3A CN112613760A (en) | 2020-12-26 | 2020-12-26 | Product quality evaluation method and system based on block chain technology |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112613760A true CN112613760A (en) | 2021-04-06 |
Family
ID=75247948
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011570336.3A Withdrawn CN112613760A (en) | 2020-12-26 | 2020-12-26 | Product quality evaluation method and system based on block chain technology |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112613760A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113129038A (en) * | 2021-06-21 | 2021-07-16 | 浙江数秦科技有限公司 | Green food evaluation system based on block chain |
CN113609510A (en) * | 2021-09-28 | 2021-11-05 | 武汉泰乐奇信息科技有限公司 | Big data encryption transmission method and device based on distributed storage |
-
2020
- 2020-12-26 CN CN202011570336.3A patent/CN112613760A/en not_active Withdrawn
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113129038A (en) * | 2021-06-21 | 2021-07-16 | 浙江数秦科技有限公司 | Green food evaluation system based on block chain |
CN113609510A (en) * | 2021-09-28 | 2021-11-05 | 武汉泰乐奇信息科技有限公司 | Big data encryption transmission method and device based on distributed storage |
CN113609510B (en) * | 2021-09-28 | 2021-12-24 | 武汉泰乐奇信息科技有限公司 | Big data encryption transmission method and device based on distributed storage |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11853171B2 (en) | Systems and methods for quorum-based data processing | |
Gaborit et al. | Identity-based encryption from codes with rank metric | |
Wang et al. | FPGA-based Niederreiter cryptosystem using binary Goppa codes | |
US20100281336A1 (en) | Method and entity for probabilistic symmetrical encryption | |
CN104412538A (en) | Secure communication | |
CN112613760A (en) | Product quality evaluation method and system based on block chain technology | |
Megias et al. | Privacy-aware peer-to-peer content distribution using automatically recombined fingerprints | |
CN112635009A (en) | Medical data encryption method based on block chain | |
CN112613008A (en) | Student identity online authentication method and system | |
CN112635008A (en) | Medical examination report generation method based on digital signature | |
Kim et al. | PALOMA: binary separable Goppa-based KEM | |
CN112769573B (en) | Digital signature method, signature verification method and device based on GRS code | |
CN112614001A (en) | Agricultural product tracing method and system based on block chain | |
US20150089333A1 (en) | Circuit arrangement and method for realizing check bit compacting for cross parity codes | |
CN112633712A (en) | Online bidding method and system based on GRS codes | |
WO2022134119A1 (en) | Blockchain-based electronic medical record sharing method and electronic device | |
CN112738210A (en) | Pavement maintenance method and system | |
CN112631992A (en) | Electronic file filing method and system | |
Gupta et al. | Analog Lagrange Coded Computing: On the Curious Case of Adversarial Workers | |
CN112614557A (en) | Electronic medical record encryption archiving method | |
CN112614558A (en) | Electronic medical record sharing method based on block chain and electronic equipment | |
CN112613018A (en) | Block chain-based digital certificate using system | |
Wang et al. | How to construct polar codes for ring-LWE-based public key encryption | |
CN112632076A (en) | Crop planting management method and system based on block chain | |
CN101897149B (en) | Method to trace traceable parts of original private keys in a public-key cryptosystem |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20210406 |
|
WW01 | Invention patent application withdrawn after publication |