CN111861480B - Traffic detection model transaction method and device, electronic equipment and storage medium - Google Patents

Traffic detection model transaction method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111861480B
CN111861480B CN202010993880.2A CN202010993880A CN111861480B CN 111861480 B CN111861480 B CN 111861480B CN 202010993880 A CN202010993880 A CN 202010993880A CN 111861480 B CN111861480 B CN 111861480B
Authority
CN
China
Prior art keywords
key
detection model
hash value
flow detection
transaction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010993880.2A
Other languages
Chinese (zh)
Other versions
CN111861480A (en
Inventor
曹新乐
周哲磊
刘健
张秉晟
任奎
赵俊
单夏烨
任新新
段吉瑞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangtong Tianxia Network Technology Co ltd
Zhejiang University ZJU
Original Assignee
Guangtong Tianxia Network Technology Co ltd
Zhejiang University ZJU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangtong Tianxia Network Technology Co ltd, Zhejiang University ZJU filed Critical Guangtong Tianxia Network Technology Co ltd
Priority to CN202010993880.2A priority Critical patent/CN111861480B/en
Publication of CN111861480A publication Critical patent/CN111861480A/en
Application granted granted Critical
Publication of CN111861480B publication Critical patent/CN111861480B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Abstract

The invention discloses a traffic detection model transaction method, a traffic detection model transaction device, electronic equipment and a storage medium, wherein the traffic detection model transaction method comprises the following steps: based on a flow detection model to be traded, constructing a virtual circuit based on a libsnark code library and generating a corresponding common reference character string CRS; giving test data, and acquiring a non-interactive zero-knowledge proof of flow detection model parameters w for verifying correctness by utilizing Random Oracle according to the virtual circuit and the common reference character string CRS
Figure 379922DEST_PATH_IMAGE001
(ii) a Selecting a key, and using a hash function to hash the key and the combination of the key and a public counter respectively to obtain a hash value H (key) and a hash value k; encrypting the flow detection model parameter w by using the hash value k to obtain a ciphertext c, and obtaining a non-interactive zero knowledge proof of the encryption process
Figure 494508DEST_PATH_IMAGE002
(ii) a Sending non-interactive zero knowledge proofs
Figure 511268DEST_PATH_IMAGE001
And
Figure 27700DEST_PATH_IMAGE002
and the ciphertext c and the hash value H (key) are sent to the buyer, the hash value H (key) of the key is put on the block chain, and the safe transaction of the flow detection model is completed by using the intelligent contract.

Description

Traffic detection model transaction method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of zero knowledge or payment, in particular to a traffic detection model transaction method, a traffic detection model transaction device, electronic equipment and a storage medium.
Background
Zero-knowledge proof is a proof scheme that enables a verifier to believe that a claim is true without revealing any additional information. Since the concept of zero knowledge proof was proposed in the eighties of the last century, zero knowledge proof has become an important cryptographic tool in widespread use.
In 1988, the concept of non-interactive zero knowledge proof was formally proposed, and the application range of the zero knowledge proof is further widened. Compared with interactive, the non-interactive zero-knowledge proof scheme has better properties: (1) the expandability is better: the interactive zero-knowledge proof scheme only supports one pair of provers and verifiers, but can support one prover and a plurality of verifiers in an interactive way; (2) the usability is better: the interactive zero-knowledge proof system requires that the prover and the verifier can be on line at the same time, but the non-interactive proof allows the prover to send proof when the verifier is off line, and then the proof is verified when the verifier is on line; (3) the initialization conditions are inconsistent: the non-interactive zero knowledge proof system must have a third party (i.e., Setup) to complete initialization, such as generating common parameters, while in interactive this condition is not necessary. Non-interactive zero-knowledge proofs are therefore more widely used in a variety of cryptographic tasks.
Zero knowledge or pay is an important application of non-interactive zero knowledge proof. Zero knowledge or payment enables both parties to complete fair transactions of digital products by means of blockchains, i.e., the digital products are guaranteed to meet the requirements of buyers without any information of the digital products provided by sellers being leaked. This may prevent the purchaser from not paying for the digital product when they have received the digital product, or the seller from providing a counterfeit product when they have received the money. The most classical of zero-knowledge or pay is pay-to-sudoku (https:// githu. com/zcash-hackworks/pay-to-sudoku) (Sean Bowe), which is a secure transaction for the sudoku solution, employs sha256 hash and Xor encryption, and this scheme can only transact for the solution with a small order and a small circuit. This is one of the reasons why there is currently no practical solution for transactions with a traffic detection model. The flow detection model involves too many model parameters, and in practical application, a very large memory and a long running time are required, and although the industry has proposed the idea of applying zero knowledge proof to various multi-parameter model transactions, a mature and feasible scheme is not available.
Disclosure of Invention
The embodiment of the invention aims to provide a traffic detection model transaction method, a traffic detection model transaction device, electronic equipment and a storage medium.
The purpose of the invention is realized by the following technical scheme:
in a first aspect, an embodiment of the present invention provides a traffic detection model transaction method, including:
based on a flow detection model to be traded, constructing a virtual circuit based on a libsnark code library and generating a corresponding common reference character string CRS;
giving test data, and acquiring a non-interactive zero-knowledge proof of flow detection model parameters w for verifying correctness by utilizing Random Oracle according to the virtual circuit and the common reference character string CRS
Figure 614595DEST_PATH_IMAGE001
Selecting a key, and using a hash function to hash the key and the combination of the key and a public counter respectively to obtain a hash value H (key) and a hash value k;
encrypting the flow detection model parameter w by using the hash value k to obtain a ciphertext c, and obtaining a non-interactive zero knowledge proof of the encryption process
Figure 538689DEST_PATH_IMAGE002
Sending non-interactive zero knowledge proofs
Figure 156621DEST_PATH_IMAGE001
And
Figure 394835DEST_PATH_IMAGE002
and the ciphertext c and the hash value H (key) are sent to the buyer, the hash value H (key) of the key is put on the block chain, and the safe transaction of the flow detection model is completed by using the intelligent contract.
In a second aspect, an embodiment of the present invention provides a traffic detection model transaction apparatus, including:
the building module is used for building a virtual circuit for a libsnark code base and generating a corresponding common reference character string CRS based on a flow detection model to be traded;
a first zero knowledge proof obtaining module for giving test data, according to the virtual circuit and the common reference character string CRS, using Random Oracle to give non-interactive zero knowledge proof of flow detection model parameter w for verifying correctness
Figure 165345DEST_PATH_IMAGE001
The hash module is used for selecting the key and respectively hashing the key and the combination of the key and the public counter by utilizing a hash function to obtain a hash value H (key) and a hash value k;
a second zero knowledge proof obtaining module for encrypting the flow detection model parameter w by using the hash value k to obtain a ciphertext c and obtainingTaking non-interactive zero knowledge proof of encryption process
Figure 745493DEST_PATH_IMAGE002
A transaction module for sending non-interactive zero knowledge proofs
Figure 601454DEST_PATH_IMAGE001
And
Figure 705676DEST_PATH_IMAGE002
and the ciphertext c and the hash value H (key) are sent to the buyer, the hash value H (key) of the key is put on the block chain, and the safe transaction of the flow detection model is completed by using the intelligent contract.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method as described in the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, wherein the program is configured to, when executed by a processor, implement the method according to the first aspect.
According to the technical scheme, the invention has the following beneficial effects:
1. the method of the invention enables the buyer and the seller to complete safe and privacy-guaranteed transaction on the block chain;
2. the random oracle is applied to the scheme, so that the efficiency of the proving and verifying processes in the scheme is greatly improved, the requirement on a memory is reduced, the time required by operation is reduced, and the safety transaction of the traffic detection model is completed on the premise of hardly influencing Soundness, so that the completion of the traffic detection model transaction by applying zero knowledge proving can be really realized in a commercial scene for the first time.
3. The invention has the advantages of simple and convenient use, high efficiency, less memory and time consumption and the like.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
fig. 1 is a flowchart of a traffic detection model transaction method according to an embodiment of the present invention;
FIG. 2 is a graph of the ratio of a seller modifying a picture (modifying only the result of the calculation) to the probability that he modifies the picture without being found, in the case of checking 15% of the circuit calculation for each picture using the method, and the graph is used for explaining the reliability of checking only part of the virtual circuit;
fig. 3 is a block diagram of a traffic detection model transaction apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, 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 application.
Explanation: as a network administrator and a network security maintainer, with the rapid development of the Internet, the application mode of the information technology has changed greatly, and the application of new technology brings about various network connection modes, and the scale of the network is also getting larger and larger. Therefore, from the perspective of a network administrator, all of them require an end-to-end network management measure to minimize the system and network failure time, and the administrator can detect the operating conditions of the system and network through a network management tool to perform network traffic analysis and statistics. The traffic detection and detection model is used for analyzing and counting network traffic and detecting abnormal traffic existing in the network so as to deal with malicious attacks.
The present application is directed to the transaction of such a flow detection model, and the seller has a designed and trained flow model to sell to the buyer, so that the seller and the buyer can fairly, safely and privately complete the transaction of the model, and the buyer and the seller all believe that the transaction is fairly and safe. The technical solution of the present application will be described in detail with reference to the following examples.
Example 1:
suppose that a mobile company a entrusts a network security company B with a traffic detection model that can be used to detect abnormal traffic in response to malicious attacks. The network security company B generates a flow detection model for the mobile company A
Figure 517643DEST_PATH_IMAGE003
Wherein
Figure 783539DEST_PATH_IMAGE004
Is the parameter of the model and is,
Figure 861217DEST_PATH_IMAGE005
is the model input. Network security company B does not want to present the traffic detection model before mobile company a pays, and mobile company a does not want to pay before verifying that the traffic detection model provided by network security company B is authentic. To address this situation, mobile company a (hereinafter buyer a) and network security company B (hereinafter seller B) may complete a secure transaction using the traffic detection model transaction method presented below.
Fig. 1 is a flowchart of a traffic detection model transaction method according to an embodiment of the present invention; the traffic detection model transaction method provided by the embodiment comprises the following steps:
step S101, constructing a virtual circuit based on a libsnark code base and generating a corresponding common reference character string CRS based on a flow detection model to be traded;
specifically, buyer A asks seller B to establish a corresponding traffic detection model for the seller A
Figure 503551DEST_PATH_IMAGE003
The seller B constructs a virtual circuit based on the libsnr library according to the flow detection model and generates a public reference character string corresponding to the virtual circuit so that the virtual circuit can select parameters required in the subsequent certification and verification process. Once the proof generated by the virtual circuit is successfully verified, buyer A will believe that the model is correct.
Step S1011, aiming at the flow detection model to be traded, a circuit of the flow detection model is designed in a layered mode by utilizing a libsnark library, wherein corresponding R1CS limitation is given to the arithmetic process of each layer, and a complete virtual circuit is formed;
specifically, seller B detects the mathematical expression of the model according to the flow
Figure 2315DEST_PATH_IMAGE003
And designing a virtual circuit of the flow detection model, and layering in the virtual circuit. The virtual circuit of the flow detection model can be divided into three layers,
Figure 173533DEST_PATH_IMAGE006
Figure DEST_PATH_IMAGE007
Figure 925457DEST_PATH_IMAGE008
seller B notifies buyer a of the corresponding hierarchy and the corresponding R1CS (a language used to describe the virtual circuit), ensuring that the circuit is transparent for disclosure. The advantage of this is to ensure the simplicity and clarity of the disclosed circuit, and the distinct modules, so that the buyer a and the seller B can choose uniformly when selecting the R1CS of the virtual circuit for certification and verification, and maximize the credibility of the transaction with the same amount of calculation.
Step S1012, generating a corresponding common reference string CRS for the complete virtual circuit, wherein the common reference string CRS includes vk transmitted to the buyer and pk transmitted to the seller, where vk represents the data key required for verification and pk represents the data key required for certification.
Specifically, after negotiation, the buyer a and the seller B select a manner (e.g., secure multiparty computation) that both parties trust to obtain a randomly generated common reference character string CRS, where the common reference character CRS includes two parts, which are referred to as pk and vk. Buyer a receives vk for subsequent verification and seller B receives pk for subsequent certification. This has the advantage that both buyer a and seller B trust the strings they have received and the certification and verification results obtained with the corresponding strings, and both parties thus maintain trust in the transaction.
Step S102, giving test data, and obtaining a non-interactive zero-knowledge proof of flow detection model parameters w for verifying correctness by utilizing Random Oracle according to the virtual circuit and the common reference character string CRS
Figure 105903DEST_PATH_IMAGE001
Specifically, seller B randomly selects R1CS of each layer according to the received pk, and completes the certification of the entire virtual circuit on the basis of only selecting part R1CS, in this certification, seller B uses the flow detection model parameter w to be traded to certify the correctness of the operation process and result of the flow detection model. This has the advantage that on the one hand, buyer a's confidence in the correctness of seller B's traffic detection model is maintained, and on the other hand, the time and memory required for virtual circuit generation certification are greatly reduced.
Step S1021, given test data and taking the test data as the input of a virtual circuit, and generating a corresponding complete non-interactive zero knowledge proof of a flow detection model parameter w according to a common reference character string CRS;
specifically, the buyer a selects a part of the test set and sends the test set to the seller B, the seller B uses the test set as an input of a virtual circuit and uses a libsnr library to generate a corresponding non-interactive zero knowledge proof, and then the non-interactive zero knowledge proof is hashed, and the obtained hash value hash is used in a subsequent random selection process. This has the advantage that randomness of the subsequent picking process is guaranteed.
Step S1022, aiming at the complete non-interactive zero knowledge proof of the flow detection model parameter w, selecting parts with the same proportion in each layer of virtual circuit by utilizing Random Oracle for combination, and acquiring the selected non-interactive zero knowledge proof
Figure 439932DEST_PATH_IMAGE001
Specifically, vendor B uses pk and hash value hash generated by the previous process as the input of Random Oracle, which randomly stores R1CS of the hierarchical circuit in advance, so that the output of Random Oracle can be used as the Random selection result of R1CS of the hierarchical circuit. Seller B then verifies the complete test set at R1CS of the selected hierarchical circuit, i.e., uses libsnark library to generate non-interactive zero-knowledge proof for verifying correctness of flow detection model parameters w
Figure 47631DEST_PATH_IMAGE001
. This has the advantage of ensuring that buyer A has both trust credentials
Figure 850633DEST_PATH_IMAGE001
The verification result of the seller B also improves the efficiency of the seller B for proving, and greatly saves the generation of the seller B
Figure 569191DEST_PATH_IMAGE001
Memory and time required.
Step S103, selecting a key, and using a hash function to hash the key and the combination of the key and the public counter respectively to obtain a hash value H (key) and a hash value k;
specifically, the seller B randomly generates a key for encryption, and applies a hash function to the combination of the key and the public counter to generate a corresponding hash value k for subsequent encryption, and further generates the hash value h (key) of the key separately for subsequent verification of the correctness of the key. The advantage of this is that the size of the key is compressed, so that the seller B can not only encrypt all parameters of the traffic monitoring model, but also enable the seller B to decrypt only with a very small amount of data (only the size of a key) that needs to be transferred to the buyer a.
In step S1031, the key and the public counter are hashed by using a hash function to obtain a hash value k, where the hash function used is MiMC or SHA256, which is not limited to those listed here. Specifically, the seller B randomly generates a key for encryption, and applies a MiMC or SHA256 hash function to the combination of the key and the public counter to generate a corresponding hash value k for subsequent encryption. Seller B publishes the initial value of the public counter to buyer a. The method has the advantages that the model parameters are encrypted, the safety is guaranteed, the generation speed of the key is improved, the size of the key is reduced, and the data size of the transaction between the buyer A and the seller B is only one key.
In step S1032, the key is hashed by using a hash function to obtain a hash value h (key), where the hash function used is AES or SHA256, but is not limited to the list here. Specifically, the seller B uses the MiMC or SHA256 function to generate a corresponding hash value h (key) for the subsequent buyer a to verify the received key or verify the key of the smart contract on the blockchain. This has the advantage of enabling the buyer a to verify that the key he received is correct, so that the transactions between the two parties remain secure and private.
Step S104, the flow detection model parameter w is encrypted by using the Hash value k to obtain a ciphertext c, and a non-interactive zero knowledge proof of the encryption process is obtained
Figure 23306DEST_PATH_IMAGE002
Specifically, the seller B performs xor on the obtained hash value k and the parameter w of the flow detection model to obtain a ciphertext c, generates a virtual circuit for the encryption process, and obtains a non-interactive zero knowledge proof of the encryption process
Figure 801906DEST_PATH_IMAGE002
. The method has the advantages that on the basis of ensuring that the buyer A trusts the ciphertext c to be the encryption of w, the flow detection model parameter w is encrypted by using a one-time pad method, and the safety of the model parameter of the seller B is ensured. The encryption mode is not limited to a one-time pad encryption mode, and any safe and reliable symmetric encryption technology can be used in the scene.
Step S105, sending non-interactive zero knowledge proof
Figure 590739DEST_PATH_IMAGE001
And
Figure 112987DEST_PATH_IMAGE002
and the ciphertext c and the hash value H (key) are sent to the buyer, the hash value H (key) of the key is put on the block chain, and the safe transaction of the flow detection model is completed by using the intelligent contract.
In particular, seller B will generate a non-interactive zero knowledge proof
Figure 421609DEST_PATH_IMAGE001
And
Figure 167848DEST_PATH_IMAGE002
and the ciphertext c and the hash value H (key) are sent to the buyer A, the hash value H (key) of the key is put on the block chain, and the intelligent contract is used for requiring that the transaction is automatically completed only when the key 'sent to the chain by the seller meets H (key') = H (key). The benefit of this is that the security and privacy of the transaction between buyer a and seller B is guaranteed, and buyer a pays seller B and if and only if buyer a gets the correct key, the key can be used to unlock all parameters of the correct traffic detection model.
Step S1051, sending non-interactive zero knowledge proof
Figure 929131DEST_PATH_IMAGE001
And
Figure 2872DEST_PATH_IMAGE002
ciphertext c, hash value H (key) to buyer A, buyer A's non-interactive zero knowledge proof
Figure 166001DEST_PATH_IMAGE001
And
Figure 286403DEST_PATH_IMAGE002
and (6) carrying out verification. In particular, buyer A sends non-interactive zero knowledge proof to seller B
Figure 800561DEST_PATH_IMAGE001
And
Figure 913880DEST_PATH_IMAGE002
and performing verification, and when the two verification results are true, the buyer A believes that the seller B has a correct flow detection model, and the ciphertext c is an encryption result of the flow detection model parameter. Buyer a initiates a smart contract inviting seller B to send a key. The advantage of this is that the seller B proves to the buyer a that he/she has a reliable traffic detection model without revealing the traffic detection model parameter w, thereby ensuring the security and reliability of the transaction.
Step S1052, after the verification is successful, the buyer puts the hash value h (key) of the key on the block chain and issues the transaction by using the smart contract, and the user side providing the original image of the hash value h (key) can complete the transaction. Specifically, the buyer a and the seller B transact with the published intelligent contract, the buyer a pays the intelligent contract, once the key 'sent by the seller B satisfies the hash value H (key') = H (key), the intelligent contract is automatically executed, the buyer a obtains the corresponding key, and the seller B obtains the corresponding account. The benefit of this is that buyer A and seller B complete the transaction through the intelligent contract, so that both parties complete the transaction at the same time, so that both parties maintain trust in the transaction.
And step S1053, after the buyer obtains the key through the intelligent contract, hashing the obtained key and the public counter by using a hash function to generate a hash value k, decoding the ciphertext c by using the hash value k to obtain a parameter w of the flow detection model, and finishing the safe transaction of the flow detection model. Specifically, the buyer a obtains the key encrypted by the model parameter, hashes the combination of the key and the public counter according to the hash mode of the seller B to obtain the hash value k, and completes decoding by performing xor on the ciphertext c and the hash value k to obtain the parameter w of the complete flow detection model. This has the advantage that transactions between the parties are completed with a very small amount of data (only the size of a key), keeping the transaction efficient and enabling the transaction to be conducted on the blockchain.
The core technology of the invention is a traffic detection model transaction method based on the block chain, which enables a buyer and a seller to complete safe and privacy-guaranteed commercial transactions on the block chain, and adopts random oracle, thereby greatly improving the efficiency of the certification and verification process in the scheme, reducing the requirement on memory, reducing the time required by operation, and completing the safe transaction of the traffic detection model on the premise of hardly influencing Soundness.
Example 2:
fig. 3 is a block diagram of a traffic detection model transaction apparatus according to an embodiment of the present invention, which can execute any traffic detection model transaction method according to any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method. As shown in fig. 3, the apparatus includes:
a building module 901, configured to build a virtual circuit for a libsnark code base and generate a corresponding common reference character string CRS based on a traffic detection model to be traded;
a first zero knowledge proof obtaining module 902, configured to give test data, and according to the virtual circuit and the common reference character string CRS, give a non-interactive zero knowledge proof of the flow detection model parameter w for verifying correctness by using Random Oracle
Figure 665935DEST_PATH_IMAGE001
A hash module 903, configured to select a key, and hash the key and a combination of the key and a public counter by using a hash function to obtain a hash value h (key) and a hash value k;
a second zero knowledge proof obtaining module 904, configured to encrypt the flow detection model parameter w by using the hash value k to obtain a ciphertext c, and obtain a non-interactive zero knowledge proof of the encryption process
Figure 488397DEST_PATH_IMAGE002
Transaction module 905 for sending non-interactive zero knowledge proof
Figure 958693DEST_PATH_IMAGE001
And
Figure 377167DEST_PATH_IMAGE002
and the ciphertext c and the hash value H (key) are sent to the buyer, the hash value H (key) of the key is put on the block chain, and the safe transaction of the flow detection model is completed by using the intelligent contract.
Example 3:
the present embodiment provides an electronic device, including:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of embodiment 1.
Example 4:
the present embodiment provides a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the method as described in embodiment 1.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described device embodiments are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
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.

Claims (10)

1. A traffic detection model transaction method, comprising:
based on a flow detection model to be traded, constructing a virtual circuit based on a libsnark code library and generating a corresponding common reference character string CRS;
giving test data, and acquiring a non-interactive zero-knowledge proof of flow detection model parameters w for verifying correctness by utilizing Random Oracle according to the virtual circuit and the common reference character string CRS
Figure DEST_PATH_IMAGE001
Selecting a key, and using a hash function to hash the key and the combination of the key and a public counter respectively to obtain a hash value H (key) and a hash value k;
encrypting the flow detection model parameter w by using the hash value k to obtain a ciphertext c, and obtaining a non-interactive zero knowledge proof of the encryption process
Figure DEST_PATH_IMAGE002
Sending non-interactive zero knowledge proofs
Figure 945355DEST_PATH_IMAGE001
And
Figure 206703DEST_PATH_IMAGE002
cipher text c and hash value H (key) to the buyer, putting the hash value H (key) of the key on the block chain, and utilizing intelligent combinationAnd completing the safe transaction of the flow detection model.
2. The traffic detection model transaction method according to claim 1, wherein, based on the traffic detection model to be transacted, a virtual circuit for a libsnr-code base is constructed and a corresponding common reference character string CRS is generated, specifically comprising:
for a flow detection model to be traded, a circuit of the flow detection model is designed hierarchically by utilizing a libsnark library, wherein corresponding R1CS limitation is given for the arithmetic process of each layer to form a complete virtual circuit;
for the complete virtual circuit, a corresponding common reference string CRS is generated, wherein the common reference string CRS comprises a vk delivered to the buyer and a pk delivered to the seller, wherein vk represents the data key required for verification and pk represents the data key required for certification.
3. The traffic monitoring model transaction method of claim 2, wherein the non-interactive zero-knowledge proof of traffic monitoring model parameter w for verifying correctness is obtained by Random Oracle based on the virtual circuit and common reference character string CRS given test data
Figure 252019DEST_PATH_IMAGE001
The method specifically comprises the following steps:
giving test data and taking the test data as the input of a virtual circuit, and generating a corresponding complete non-interactive zero knowledge proof of a flow detection model parameter w according to a common reference character string CRS;
aiming at the complete non-interactive zero knowledge proof of the flow detection model parameter w, parts with the same proportion are selected in each layer of virtual circuit by utilizing Random Oracle for combination, and the selected non-interactive zero knowledge proof is obtained
Figure 116070DEST_PATH_IMAGE001
4. The traffic detection model transaction method according to claim 3, wherein the key and the public counter are hashed by a hash function to obtain the hash value k, wherein the hash function used is MiMC or SHA 256.
5. The traffic detection model transaction method according to claim 3, wherein the key is hashed by a hash function to obtain a hash value H (key), wherein the hash function used is AES or SHA 256.
6. The traffic detection model transaction method according to claim 3, wherein the encryption is a symmetric encryption technique.
7. The traffic detection model transaction method of claim 4, wherein a non-interactive zero knowledge proof is sent
Figure 523918DEST_PATH_IMAGE001
And
Figure 815222DEST_PATH_IMAGE002
and the ciphertext c and the hash value H (key) are transmitted to the buyer, the buyer puts the hash value H (key) of the key on the block chain, and the safe transaction of the flow detection model is completed by using an intelligent contract, which specifically comprises the following steps:
sending non-interactive zero knowledge proofs
Figure 426463DEST_PATH_IMAGE001
And
Figure 828625DEST_PATH_IMAGE002
cipher text c, hash value H (key) to buyer who is proving non-interactive zero knowledge
Figure 90979DEST_PATH_IMAGE001
And
Figure 553185DEST_PATH_IMAGE002
carrying out verification;
after the verification is successful, the buyer puts the hash value H (key) of the key on the block chain and issues the transaction by using an intelligent contract, and the user side providing the original image of the hash value H (key) can complete the transaction;
and after the buyer obtains the key through the intelligent contract, hashing the obtained key and the public counter by using a hash function to generate a hash value k, decoding the ciphertext c by using the hash value k to obtain a parameter w of the flow detection model, and finishing the safe transaction of the flow detection model.
8. A traffic detection model transaction apparatus, comprising:
the building module is used for building a virtual circuit for a libsnark code base and generating a corresponding common reference character string CRS based on a flow detection model to be traded;
a first zero knowledge proof obtaining module for giving test data, according to the virtual circuit and the common reference character string CRS, using Random Oracle to give non-interactive zero knowledge proof of flow detection model parameter w for verifying correctness
Figure 573093DEST_PATH_IMAGE001
The hash module is used for selecting the key and respectively hashing the key and the combination of the key and the public counter by utilizing a hash function to obtain a hash value H (key) and a hash value k;
a second zero knowledge proof obtaining module for encrypting the flow detection model parameter w by using the hash value k to obtain a ciphertext c and obtaining a non-interactive zero knowledge proof of the encryption process
Figure 651383DEST_PATH_IMAGE002
A transaction module for sending non-interactive zero knowledge proofs
Figure 378031DEST_PATH_IMAGE001
And
Figure 401350DEST_PATH_IMAGE002
and the ciphertext c and the hash value H (key) are sent to the buyer, the hash value H (key) of the key is put on the block chain, and the safe transaction of the flow detection model is completed by using the intelligent contract.
9. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202010993880.2A 2020-09-21 2020-09-21 Traffic detection model transaction method and device, electronic equipment and storage medium Active CN111861480B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010993880.2A CN111861480B (en) 2020-09-21 2020-09-21 Traffic detection model transaction method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010993880.2A CN111861480B (en) 2020-09-21 2020-09-21 Traffic detection model transaction method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111861480A CN111861480A (en) 2020-10-30
CN111861480B true CN111861480B (en) 2020-12-18

Family

ID=72967801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010993880.2A Active CN111861480B (en) 2020-09-21 2020-09-21 Traffic detection model transaction method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111861480B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112865953B (en) * 2021-02-01 2022-05-17 浙江大学 Safe multi-party computing method, device and system based on auxiliary server
CN113779147B (en) * 2021-08-30 2023-11-07 武汉天喻信息产业股份有限公司 Data uplink and utilization method, device, equipment and readable storage medium
CN116933195A (en) * 2023-07-31 2023-10-24 浙江大学 Encryption traffic abnormality detection method and device based on deep learning

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108418689B (en) * 2017-11-30 2020-07-10 矩阵元技术(深圳)有限公司 Zero-knowledge proof method and medium suitable for block chain privacy protection
US11151558B2 (en) * 2018-12-12 2021-10-19 American Express Travel Related Services Company, Inc Zero-knowledge proof payments using blockchain
US10652019B1 (en) * 2019-08-28 2020-05-12 Qed-It Systems Ltd. Atomic swap using zero-knowledge proofs, and applications thereof
CN111600844A (en) * 2020-04-17 2020-08-28 丝链(常州)控股有限公司 Identity distribution and authentication method based on zero-knowledge proof

Also Published As

Publication number Publication date
CN111861480A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
CN111861480B (en) Traffic detection model transaction method and device, electronic equipment and storage medium
CN108681853B (en) Logistics information transmission method, system and device based on block chain
US20200313897A1 (en) Blockchain-based authentication and authorization
CN109889504B (en) Decentralized data access right transaction method and system
CN110135819B (en) Block chain-based third-party trusted data transaction system and method
US20180367531A1 (en) Token device re-synchronization through a network solution
WO2022126967A1 (en) Blockchain-based data supervision method, apparatus and device, and storage medium
WO2017107976A1 (en) Client apparatus, server apparatus and access control system for authorized access
US8281375B2 (en) One time password authentication of websites
CN108650077B (en) Block chain based information transmission method, terminal, equipment and readable storage medium
TW201944757A (en) Computer-implemented system and method suitable for increasing the security of instant off-line blockchain transactions
US11562451B1 (en) Apparatus for proportional calculation regarding non-fungible tokens
CN116561789B (en) Processing method and device of privacy data, electronic equipment and readable storage medium
US20200250655A1 (en) Efficient, environmental and consumer friendly consensus method for cryptographic transactions
CN110086626A (en) Quantum secret communication alliance chain method of commerce and system based on unsymmetrical key pond pair
CN112435026B (en) Method and device for protecting file transaction information by using zero-knowledge proof and electronic equipment
US20230237437A1 (en) Apparatuses and methods for determining and processing dormant user data in a job resume immutable sequential listing
CN109815659A (en) Safety certifying method, device, electronic equipment and storage medium based on WEB project
CN112769548A (en) Block chain numerical information transmission method, system, device and computer medium
Wang et al. A fair and privacy-preserving image trading system based on blockchain and group signature
CN108259180B (en) Method for quantum specifying verifier signature
US11516014B2 (en) Methods, systems, and apparatuses for cryptographic wireless detection and authentication of fluids
WO2024011863A9 (en) Communication method and apparatus, sim card, electronic device, and terminal device
CN112765668B (en) Zero-knowledge proof privacy protection method, system, storage medium and equipment
WO2022089518A1 (en) Address generation method, blockchain information processing method, and related device

Legal Events

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

Effective date of registration: 20230817

Granted publication date: 20201218

PP01 Preservation of patent right