CN115085934A - Contract management method based on block chain and combined key and related equipment - Google Patents
Contract management method based on block chain and combined key and related equipment Download PDFInfo
- Publication number
- CN115085934A CN115085934A CN202210668866.4A CN202210668866A CN115085934A CN 115085934 A CN115085934 A CN 115085934A CN 202210668866 A CN202210668866 A CN 202210668866A CN 115085934 A CN115085934 A CN 115085934A
- Authority
- CN
- China
- Prior art keywords
- contract
- combined
- hash value
- key
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000007726 management method Methods 0.000 title claims abstract description 47
- 238000004364 calculation method Methods 0.000 claims abstract description 46
- 238000013507 mapping Methods 0.000 claims abstract description 14
- 238000012795 verification Methods 0.000 claims description 44
- 238000000034 method Methods 0.000 abstract description 13
- 238000004891 communication Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000035515 penetration Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 238000011144 upstream manufacturing Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3236—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
- H04L9/3239—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
- H04L63/0442—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The embodiment of the application belongs to the field of block chain information security, and relates to a contract management method and related equipment based on a block chain and a combined key, wherein the contract management method comprises the steps of obtaining all participants on the block chain, combining the participants in pairs to obtain a combined result, and generating a public and private key pair corresponding to each combination according to the combined result, wherein the public and private key pair comprises a combined public key and a combined private key, and sending the combined private key to the corresponding participants in each combination; acquiring identification information of participants in the combination, performing hash calculation on the identification information to obtain a combined hash value, mapping the combined hash value and a combined public key of a corresponding public and private key pair, and storing the mapped combined hash value and the combined public key to a block chain; encrypting key information in a contract corresponding to a participant in the combination by using the combined public key to obtain an encrypted contract; and carrying out Hash calculation on the encryption contract to obtain a contract Hash value, and uploading the encryption contract and the contract Hash value to the block chain. The method and the device can improve the safety of data and avoid exposing commercial secrets.
Description
Technical Field
The present application relates to the field of blockchain information security technologies, and in particular, to a contract management method and related devices based on blockchains and combined keys.
Background
In recent years, with the development of digital technology, data assets have become one of the first factors in evaluating credit releases of small and medium-sized enterprises in the context of the vigorous national development of popular finance. Supply chain financial services have received considerable attention from financial institutions as a direct manifestation of affordable finance. Traditional supply chain finance is limited by the problems of information asymmetry, difficulty in multi-layer penetration of credit, complexity in on-line operation, difficulty in distinguishing trade authenticity and the like. The characteristics of de-centering, tamper resistance and traceability of the block chain are utilized, and technologies such as the internet of things and AIoT are combined to improve the rigid trust capability, so that credit worthiness of the core enterprise can be reliably and credibly synchronously circulated on the block chain, accounts receivable of the enterprise can be effectively checked, credible whole-process of trade is realized, and the problems of difficult financing and high financing of small and medium enterprises are solved.
However, the application of current blockchain, internet of things, AIoT, etc. technologies has not solved all the problems. In the service area, whether the core enterprise or the upstream and downstream suppliers and distributors uploads the core business data to the blockchain, the data leakage is still possible, and the enterprise privacy and the business data leakage are caused.
Disclosure of Invention
An object of the embodiment of the present application is to provide a contract management method and related device based on a block chain and a combined key, so as to solve the technical problems that in the related art, when core business data is uploaded to the block chain, data leakage is still possible, and enterprise privacy and business data leakage are caused.
In order to solve the above technical problem, an embodiment of the present application provides a contract management method based on a block chain and a combined key, which is applied to a contract end, and adopts the following technical scheme:
acquiring all participants on a block chain, combining the participants in pairs to obtain a combination result, and generating a public and private key pair corresponding to each combination according to the combination result, wherein the public and private key pair comprises a combined public key and a combined private key;
sending the combination private key to a corresponding participant in each combination;
acquiring identification information of participants in the combination, and performing hash calculation on the identification information to obtain a combined hash value;
mapping the combined hash value and a combined public key of the corresponding public and private key pair and storing the mapped combined hash value and the corresponding combined public key of the public and private key pair into the block chain;
encrypting key information in a contract corresponding to a participant in the combination by using the combined public key to obtain an encrypted contract;
performing hash calculation on the encryption contract to obtain a contract hash value;
uploading the encryption contract and the contract hash value to the blockchain.
Further, the step of mapping and storing the combined hash value and the combined public key of the corresponding public-private key pair to the blockchain includes:
taking the combined hash value as a key name and the combined public key as a key value;
storing the combined hash value and the corresponding combined public key in the form of a key-value pair to the blockchain.
In order to solve the above technical problem, an embodiment of the present application provides a contract management method based on a block chain and a combined key, which is applied to a contract verification end, and adopts the following technical scheme:
sending a contract acquisition request to a client corresponding to a target party;
receiving a partial decryption contract and a corresponding target combined hash value sent by the client, wherein the partial decryption contract is obtained by decrypting a target encryption contract obtained based on the contract acquisition request by the client;
obtaining a corresponding target combined public key according to the target combined hash value, and re-encrypting the partial decomposed close agreement by using the target combined public key to obtain a contract to be verified;
performing hash calculation on the contract to be verified to obtain a hash value to be verified;
and verifying the hash value to be verified to obtain a verification result.
Further, the step of verifying the hash value to be verified to obtain a verification result includes:
acquiring a target contract hash value corresponding to a target encryption contract from the block chain;
comparing the hash value to be verified with the target contract hash value to obtain a comparison result;
if the comparison result is consistent, the contract verification is passed, otherwise, the contract verification is not passed.
In order to solve the above technical problem, an embodiment of the present application provides a contract management method based on a blockchain and a combined key, which is applied to a client, and adopts the following technical solutions:
receiving a contract acquisition request sent by a contract checking end, and acquiring a corresponding target encryption contract from a block chain according to the contract acquisition request;
the combined private key of the target party is called to decrypt the target encryption contract to obtain a partial decryption contract;
obtaining a target combined hash value according to the identification information of the participants in the partial decryption contract;
and sending the partial decryption contract and the target hash value to the contract verification end.
In order to solve the above technical problem, an embodiment of the present application further provides a contract management apparatus based on a block chain and a combined key, which is applied to a contract end, and adopts the following technical scheme:
the combined module is used for acquiring all participants on a block chain, combining the participants in pairs to obtain a combined result, and generating a public and private key pair corresponding to each combination according to the combined result, wherein the public and private key pair comprises a combined public key and a combined private key;
the sending module is used for sending the combined private key to a corresponding participant in each combination;
the first calculation module is used for acquiring identification information of participants in the combination and carrying out hash calculation on the identification information to obtain a combined hash value;
the mapping module is used for mapping the combined hash value and a combined public key of the corresponding public and private key pair and storing the mapped combined hash value and the corresponding combined public and private key pair into the block chain;
the encryption module is used for encrypting the key information in the contract corresponding to the participant in the combination by using the combined public key to obtain an encrypted contract;
the second calculation module is used for carrying out hash calculation on the encryption contract to obtain a contract hash value;
and the uploading module is used for uploading the encryption contract and the contract hash value to the block chain.
In order to solve the above technical problem, an embodiment of the present application further provides a contract management apparatus based on a block chain and a combined key, which is applied to a contract verification end, and adopts the following technical scheme:
the sending module is used for sending the contract obtaining request to the client corresponding to the target party;
a receiving module, configured to receive a partial decryption contract sent by the client and a corresponding target combined hash value, where the partial decryption contract is obtained by decrypting, by the client, a target encryption contract obtained based on the contract acquisition request;
the encryption module is used for obtaining a corresponding target combined public key according to the target combined hash value, and re-encrypting the partial disassembly close agreement by using the target combined public key to obtain a contract to be verified;
the third calculation module is used for carrying out hash calculation on the contract to be verified to obtain a hash value to be verified;
and the verification module is used for verifying the hash value to be verified to obtain a verification result.
In order to solve the above technical problem, an embodiment of the present application further provides a contract management apparatus based on a blockchain and a combined key, which is applied to a client, and adopts the following technical solutions:
the acquisition module is used for receiving a contract acquisition request sent by a contract checking end and acquiring a corresponding target encryption contract from a block chain according to the contract acquisition request;
the decryption module is used for decrypting the target encryption contract by using the combined private key of the target party to obtain a partial decryption contract;
the fourth calculation module is used for obtaining a target combined hash value according to the identification information of the participants in the partial decryption contract;
and the sending module is used for sending the partial decryption contract and the target hash value to the contract verification end.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
the computer device comprises a contract end, a contract verifying end and a client end, wherein the contract end comprises a first memory and a first processor, the first memory stores computer readable instructions, and the first processor executes the computer readable instructions to realize the steps of the contract management method based on the block chain and the combined key; the contract verifying end comprises a second memory and a second processor, wherein the second memory stores computer readable instructions, and the second processor executes the computer readable instructions to realize the steps of the contract management method based on the blockchain and the combined key; the client includes a third memory having computer readable instructions stored therein which, when executed by the third processor, implement the steps of the contract management method based on blockchains and combined keys as described above.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
the computer readable storage medium has stored thereon computer readable instructions which, when executed by a processor, implement the steps of a blockchain and combination key based contract management method as described above.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
the method comprises the steps that all participants on a block chain are obtained, pairwise combination is carried out on the participants to obtain a combination result, a public and private key pair corresponding to each combination is generated according to the combination result, wherein the public and private key pair comprises a combination public key and a combination private key, the combination private key is sent to the corresponding participants in each combination, pairwise combination is carried out on all the participants on the block chain to generate a public and private key corresponding to the combination, and the participants store the private keys relevant to the participants for decrypting information relevant to the participants so that the privacy of the other party can be protected; acquiring identification information of participants in the combination, performing hash calculation on the identification information to obtain a combined hash value, mapping the combined hash value and a combined public key of a corresponding public and private key pair and storing the mapped combined public key and the combined public key to a block chain, and acquiring the combined public key through the combined hash value to avoid exposing excessive participant information and ensure information safety; the key information in the contract corresponding to the participant in the combination is encrypted by using the combined public key to obtain an encrypted contract, and the key information is encrypted, so that the data security can be improved, and the exposure of commercial secrets can be avoided; and performing hash calculation on the encryption contract to obtain a contract hash value, uploading the encryption contract and the contract hash value to a block chain, and performing contract verification through the contract hash value to ensure that the contract content is real, credible and free of falsification.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the description below are some embodiments of the present application, and that other drawings may be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a block chain and combination key based contract management method according to the present application;
FIG. 3 is a block chain and combination key based contract management apparatus in accordance with an embodiment of the present application;
FIG. 4 is a schematic block diagram of a second embodiment of a contract management apparatus based on blockchains and combined keys according to the present application;
fig. 5 is a schematic structural diagram of a third embodiment of a contract management apparatus based on a blockchain and a combined key according to the present application;
FIG. 6 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
The present application provides a contract management method based on blockchain and combined key, which can be applied to a system architecture 100 shown in fig. 1, where the system architecture 100 can include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that the contract management method based on the blockchain and the combined key provided in the embodiment of the present application is generally executed by the server/terminal device, and accordingly, the contract management apparatus based on the blockchain and the combined key is generally disposed in the server/terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flowchart of one embodiment of a blockchain and combination key based contract management method according to the present application is shown, including the steps of:
step S201, all the participants on the block chain are obtained, pairwise combination is carried out on the participants to obtain a combination result, and a public and private key pair corresponding to each combination is generated according to the combination result, wherein the public and private key pair comprises a combination public key and a combination private key.
In this embodiment, each participant joins the blockchain network, and the contract end invokes an intelligent contract to generate public and private key pairs corresponding to the number of combinations according to the possibility of pairwise combination according to the information of the uplink participants, where the participants may be enterprises, and the information of the participants includes enterprise names, enterprise addresses, enterprise types, enterprise business manners, business ranges, and the like; the public and private key pair may be an asymmetrically encrypted public and private key pair.
The intelligent contract is code written on a blockchain, is a computer transaction protocol which does not need an intermediary, is self-verified and automatically executes contract terms, and when the terms in the contract are triggered, the terms can be automatically executed by a program. The intelligent contracts on the block chains have the characteristics of decentralization, distrust, programmability, non-tampering and the like, various data and assets can be flexibly embedded, and the safe and efficient information exchange, value transfer and asset management are facilitated.
For example, assuming that there are three participants A, B and C in the blockchain, and the possible pairwise combinations are AB, AC and BC, an intelligent contract is invoked to generate three pairs of public and private key pairs, which correspond to the combinations AB, AC and BC, respectively, where the public and private key pairs include a combined public key and a combined private key, the private key is stored locally at the client corresponding to the participant, and the public key is stored in the blockchain.
Step S202, the combination private key is sent to the corresponding participant in each combination.
Each combination has a public and private key pair corresponding to the combination, and the combined private keys of the public and private key pair corresponding to a certain combination are respectively sent to the clients corresponding to both parties in the combination and are stored locally, so that each party only stores the combined private key related to the party.
For example, the public and private key pair of the AB is a first public key and a first private key, the public and private key pair of the AC is a second public key and a second private key, the public and private key pair of the BC is a third public key and a third private key, the first private key is respectively sent to the party a and the party B, the second private key is respectively sent to the party a and the party C, and the third private key is respectively sent to the party B and the party C. In this way, the participant a only stores the private key related to the participant a, i.e. AB (storage manner of the first private key in the participant a), AC (storage manner of the second private key in the participant a), and cannot obtain the private key of BC; similarly, the participant B only stores the private key related to the participant B, that is, stores BA (the storage manner of the first private key in the participant B) and BC (the storage manner of the third private key in the participant B), and cannot obtain the private key of the AC; the participant C only stores the private key related to the participant C, i.e., CA (storage manner of the second private key in the participant C) and CB (storage manner of the third private key in the participant C), and cannot obtain the private key of AB. This way the privacy of the other party in the combination can be guaranteed.
Step S203, obtaining identification information of the participants in the combination, and performing hash calculation on the identification information to obtain a combined hash value.
In this embodiment, identification information of both parties of the participant is obtained, the identification information of both parties is combined, and a hash algorithm is used to perform hash calculation on the combined identification information to obtain a combined hash value. The identification information may be a unique identification of the participant, may be a name, or may be an organization code, which is not limited herein.
The Hash algorithm (Hash Algorithms) is also called Hash algorithm, Hash algorithm or digital fingerprint, and is an algorithm that can compress a message of any length into a message of fixed length, and common Hash Algorithms include MD series Algorithms and SHA series Algorithms.
The mathematical expression of the hash algorithm is as follows:
h=Hash(m)
in the formula, h is an output value with a fixed length; m is an input value of arbitrary length. After the binary code of any input value (Message) is calculated by the hash algorithm, a hash value of a 0, 1 string of n bits can be obtained, and the value of n may be different in different hash algorithms, for example, 128, 160, 192, 256, 384 or 512.
If the input initial value is a text, the text needs to be converted into a character string, and then Hash calculation is carried out. Specifically, the identification information is a name of the participant, the name of the participant is generated into an alphabet array by using a regular matching algorithm, and the alphabet array is recombined into a character string to be used as an input value of a hash algorithm; for example, assuming that the name of the party a is a and the name of the party B is B, the names of the parties are combined into a character string "AB", and the character string "AB" is subjected to hash calculation to obtain a combined hash value.
Step S204, the combined hash value and the combined public key of the corresponding public and private key pair are mapped and stored in the block chain.
In this embodiment, the combined hash value and the combined public key of the public-private key pair corresponding to the combination are mapped in a key-value pair format, specifically, the combined hash value is used as a key name, the combined public key is used as a key value, and the combined hash value and the combined public key are stored in a block chain in a key-value pair format (key: value), that is, the combined hash value and the combined public key in the block chain are in one-to-one correspondence. The saved state on the blockchain is Hash (a + B), i.e., the combined public key of party a and party B.
By mapping the storage, the corresponding combined public key can be obtained more quickly from the combined hash value.
Step S205, using the combined public key to encrypt the key information in the contract corresponding to the participant in the combination, so as to obtain an encrypted contract.
In this embodiment, the key information related to both parties of the combined party in the contract is encrypted by using the combined public key to become a ciphertext, and then the corresponding plaintext in the original contract is replaced, so that the contract becomes an encrypted contract in a normal text + ciphertext combined form.
The key information includes but is not limited to the name of the participant, contract content and the like, and the information is encrypted, so that the privacy of the participant is prevented from being revealed, and the information security is improved.
And step S206, carrying out hash calculation on the encrypted contract to obtain a contract hash value.
In this embodiment, the encryption contract is subjected to hash calculation by using a hash algorithm, and the hash algorithm is synchronized as described in step S203.
The hash value of the contract is used for checking the contract, so that the content of the contract is real, credible and free of tampering.
Step S207, the encryption contract and the contract hash value are uploaded to the block chain.
In this embodiment, the encrypted contract is uploaded to the block chain, and the decryption key is held only by two parties involved in the contract, so that it can be ensured that a third party other than the two parties cannot decrypt the contract, and the security of the information is guaranteed.
It is emphasized that, to further ensure the privacy and security of the encryption contract and the contract hash value, the encryption contract and the contract hash value may also be stored in a node of a blockchain.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
In this embodiment, if the contract verifying end needs to verify the contract, the contract obtaining request is sent to the client corresponding to the target party, the contract verifying end may be a financial institution, and the target party receives the contract obtaining request through the client, where the contract obtaining request includes party information and a contract identifier related to the contract, the corresponding target encryption contract is pulled from the block chain according to the contract identifier in the contract obtaining request, the target encryption contract is decrypted by invoking a local combined private key of the target party, and it should be understood that only information related to the target party is decrypted, so that a partial decryption contract is obtained, the party identifier information in the partial decryption contract is obtained, and the party identifier information is subjected to hash calculation to obtain a target combined hash value.
In this embodiment, decryption is performed at the client, so as to further ensure the security of the information.
The client side sends the partial decryption contract and the target combined hash value to the contract verification end, and the contract verification end receives the partial decryption contract and can check contract content.
In this embodiment, the combined hash value and the combined public key are stored correspondingly, the contract verification end can obtain a corresponding target combined public key from the blockchain according to the target combined hash value, the target combined public key is used to re-encrypt the partial disassembly contract to obtain a to-be-verified contract, hash calculation is performed on the to-be-verified contract to obtain a to-be-verified hash value, the to-be-verified hash value is verified to obtain a verification result, and the verification result includes a contract verification pass and a contract verification fail.
In this embodiment, the decrypted contract is re-encrypted and subjected to hash calculation, and verification is performed according to the obtained hash value, so that the verification efficiency and the verification accuracy can be improved.
In this embodiment, the verifying the hash value to be verified to obtain a verification result includes:
acquiring a target contract hash value corresponding to a target encryption contract from the block chain;
comparing the hash value to be verified with the target contract hash value to obtain a comparison result;
if the comparison result is consistent, the contract verification is passed, otherwise, the contract verification is not passed.
In this embodiment, the comparison result is consistent, the contract passes the verification, which indicates that the contract is true, and has not been tampered, and if not, the contract is forged, and there is tampering, and the contract cannot be used as a proof.
The method has the advantages that all the participants on the block chain are combined pairwise, the public and private keys corresponding to the combination are generated, and the participants store the private keys relevant to the participants for decrypting the information relevant to the participants, so that the privacy of the other party can be protected; the combined hash value and the combined public key of the corresponding public and private key pair are mapped and stored in the block chain, and the combined public key can be obtained through the combined hash value, so that excessive exposure of participant information is avoided, and the information safety is ensured; the key information is encrypted, so that the data security can be improved, and the exposure of commercial secrets can be avoided; in addition, contract verification is carried out through the contract hash value, and the fact that the contract content is real, credible and free of tampering is guaranteed.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless otherwise indicated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a contract management apparatus based on a blockchain and a combined key, applied to a contract end, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 3, the contract management apparatus 300 based on the blockchain and the combined key according to the present embodiment includes: a combination module 301, a sending module 302, a first calculation module 303, a mapping module 304, an encryption module 305, a second calculation module 306, and an upload module 307. Wherein:
the combination module 301 is configured to obtain all participants on a block chain, combine the participants in pairs to obtain a combination result, and generate a public and private key pair corresponding to each combination according to the combination result, where the public and private key pair includes a combination public key and a combination private key;
the sending module 302 is configured to send the combination private key to a corresponding participant in each combination;
the first calculation module 303 is configured to obtain identification information of participants in the combination, and perform hash calculation on the identification information to obtain a combined hash value;
the encryption module 305 is configured to encrypt, by using the combined public key, key information in a contract corresponding to a party in the combination to obtain an encrypted contract;
the second calculation module 306 is configured to perform hash calculation on the encrypted contract to obtain a contract hash value;
the upload module 307 is configured to upload the encryption contract and the contract hash value to the blockchain.
Based on the contract management device based on the block chain and the combined key, all the participants on the block chain are combined pairwise to generate a public and private key corresponding to the combination, and the participants store the private key related to the participants for decrypting the information related to the participants so as to protect the privacy of the other party; the combined hash value and the combined public key of the corresponding public and private key pair are mapped and stored in the block chain, and the combined public key can be obtained through the combined hash value, so that excessive exposure of participant information is avoided, and the information safety is ensured; the key information is encrypted, so that the data security can be improved, and the exposure of commercial secrets can be avoided; in addition, contract verification is carried out through the contract hash value, and the fact that the contract content is real, credible and free of tampering is guaranteed.
In some optional implementations of this embodiment, the mapping module 304 is further configured to: taking the combined hash value as a key name and the combined public key as a key value; storing the combined hash value and the corresponding combined public key in the form of a key-value pair to the blockchain.
Referring to fig. 4, the present application provides another embodiment of a block chain and combined key based contract management apparatus applied to a contract verifying end, and the block chain and combined key based contract management apparatus 400 according to this embodiment includes: a sending module 401, a receiving module 402, an encryption module 403, a third calculation module 404 and a verification module 405. Wherein:
the sending module 401 is configured to send the contract obtaining request to a client corresponding to the target party;
the receiving module 402 is configured to receive a partial decryption contract sent by the client and a corresponding target combined hash value, where the partial decryption contract is obtained by decrypting, by the client, a target encryption contract obtained based on the contract acquisition request;
the encryption module 403 is configured to obtain a corresponding target combined public key according to the target combined hash value, and re-encrypt the partial split close contract using the target combined public key to obtain a contract to be verified;
the third calculation module 404 is configured to perform hash calculation on the contract to be verified to obtain a hash value to be verified;
the checking module 405 is configured to check the hash value to be checked to obtain a checking result.
In this embodiment, the checking module 405 is further configured to:
acquiring a target contract hash value corresponding to a target encryption contract from the block chain;
comparing the hash value to be verified with the target contract hash value to obtain a comparison result;
if the comparison result is consistent, the contract verification is passed, otherwise, the contract verification is not passed.
In this embodiment, the decrypted contract is re-encrypted and hash calculation is performed, and verification is performed according to the obtained hash value, so that the verification efficiency and the verification accuracy can be improved.
As shown in fig. 5, the contract management apparatus 500 based on the blockchain and the combined key according to the embodiment is applied to the client, and includes: an acquisition module 501, a decryption module 502, a fourth calculation module 503, and a sending module 504. Wherein:
the acquisition module is used for receiving a contract acquisition request sent by a contract checking end and acquiring a corresponding target encryption contract from a block chain according to the contract acquisition request;
the decryption module is used for decrypting the target encryption contract by using the combined private key of the target party to obtain a partial decryption contract;
the fourth calculation module is used for obtaining a target combined hash value according to the identification information of the participants in the partial decryption contract;
and the sending module is used for sending the partial decryption contract and the target hash value to the contract verification end.
In this embodiment, decryption is performed at the client, so as to further ensure the security of the information.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 6, fig. 6 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 6 comprises a contract end 61, a contract checking end 62 and a client 63, wherein the contract end 61 comprises a first memory 611 and a first processor 612, the contract checking end 62 comprises a second memory 621 and a second processor 622, the client 63 comprises a third memory 631 and a third processor 632, the first memory 611, the first processor 612 and the first network interface 613 are mutually connected in communication through a system bus, the second memory 621, the second processor 622 and the second network interface 623 are mutually connected in communication through the system bus, and the third memory 631, the second processor 632 and the third network interface 633 are mutually connected in communication through the system bus. It is noted that only a computer device 6 having components 61-63 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The first memory 611, the second memory 621, and the third memory 631 each include at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the first storage 611, the second storage 621, and the third storage 631 may be internal storage units of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the first memory 611, the second memory 621 and the third memory 631 may also be external storage devices of the computer device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) and the like equipped on the computer device 6. Of course, the first memory 611, the second memory 621 and the third memory 631 may also include both an internal storage unit and an external storage device of the computer device 6. In this embodiment, the first memory 611, the second memory 621, and the third memory 631 are generally used for storing an operating system and various types of application software installed on the computer device 6, such as computer readable instructions of a contract management method based on a blockchain and a combined key. In addition, the first memory 611, the second memory 621, and the third memory 631 may also be used to temporarily store various types of data that have been output or are to be output.
The first processor 612, the second processor 622, and the third processor 632 may be Central Processing Units (CPUs), controllers, microcontrollers, microprocessors, or other data Processing chips in some embodiments. The first processor 612, the second processor 622 and the third processor 632 are typically used to control the overall operation of the computer device 6. In this embodiment, the first processor 612, the second processor 622, and the third processor 632 are configured to execute computer readable instructions or processing data stored in the corresponding first memory 611, the second memory 621, and the third memory 631, for example, computer readable instructions for executing the contract management method based on the blockchain and the combined key.
The first network interface 613, the second network interface 623 and the third network interface 633 can include wireless network interfaces or wired network interfaces, and the first network interface 613, the second network interface 623 and the third network interface 633 are generally used for establishing communication connection between the computer device 6 and other electronic devices.
In this embodiment, when the processor executes the computer readable instructions stored in the memory, the steps of the contract management method based on the blockchain and the combined key as in the above embodiments are implemented, and by pairwise combining all the participants on the blockchain and generating a public and private key corresponding to the combination, the participants can protect the privacy of the other party by storing the private key related to themselves for decrypting the information related to themselves; the combined hash value and the combined public key of the corresponding public and private key pair are mapped and stored in the block chain, and the combined public key can be obtained through the combined hash value, so that excessive exposure of participant information is avoided, and the information safety is ensured; the key information is encrypted, so that the data security can be improved, and the exposure of commercial secrets can be avoided; in addition, contract verification is carried out through the contract hash value, and the fact that the contract content is real, credible and free of tampering is guaranteed.
Another embodiment of the present application provides a computer-readable storage medium, which stores computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the contract management method based on blockchain and combined key as described above, wherein the privacy of another party can be protected by combining two parties on blockchain and generating a combined public and private key, and the parties store their own private keys for decrypting their own related information; the combined hash value and the combined public key of the corresponding public and private key pair are mapped and stored in the block chain, and the combined public key can be obtained through the combined hash value, so that excessive exposure of participant information is avoided, and the information safety is ensured; the key information is encrypted, so that the data security can be improved, and the exposure of commercial secrets can be avoided; in addition, contract verification is carried out through the contract hash value, and the fact that the contract content is real, credible and free of tampering is guaranteed.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.
Claims (10)
1. A contract management method based on a block chain and a combined key is applied to a contract end and is characterized by comprising the following steps:
acquiring all participants on a block chain, combining the participants in pairs to obtain a combination result, and generating a public and private key pair corresponding to each combination according to the combination result, wherein the public and private key pair comprises a combined public key and a combined private key;
sending the combination private key to a corresponding participant in each combination;
acquiring identification information of participants in the combination, and performing hash calculation on the identification information to obtain a combined hash value;
mapping the combined hash value and a combined public key of the corresponding public and private key pair and storing the mapped combined hash value and the corresponding combined public key of the public and private key pair into the block chain;
encrypting key information in a contract corresponding to a participant in the combination by using the combined public key to obtain an encrypted contract;
performing hash calculation on the encryption contract to obtain a contract hash value;
uploading the encryption contract and the contract hash value to the blockchain.
2. The blockchain and combined key based contract management method of claim 1, wherein the step of mapping and storing the combined hash value and the combined public key of the corresponding public-private key pair to the blockchain comprises:
taking the combined hash value as a key name and the combined public key as a key value;
storing the combined hash value and the corresponding combined public key in the form of a key-value pair to the blockchain.
3. A contract management method based on block chains and combined keys is applied to a contract verifying end and is characterized by comprising the following steps:
sending a contract acquisition request to a client corresponding to a target party;
receiving a partial decryption contract and a corresponding target combined hash value sent by the client, wherein the partial decryption contract is obtained by decrypting a target encryption contract obtained based on the contract acquisition request by the client;
obtaining a corresponding target combined public key according to the target combined hash value, and re-encrypting the partial decomposed close agreement by using the target combined public key to obtain a contract to be verified;
performing hash calculation on the contract to be verified to obtain a hash value to be verified;
and verifying the hash value to be verified to obtain a verification result.
4. The contract management method based on the blockchain and the combined key according to claim 3, wherein the step of verifying the hash value to be verified to obtain the verification result comprises:
acquiring a target contract hash value corresponding to a target encryption contract from the block chain;
comparing the hash value to be verified with the target contract hash value to obtain a comparison result;
if the comparison result is consistent, the contract verification is passed, otherwise, the contract verification is not passed.
5. A contract management method based on a block chain and a combined key is applied to a client and is characterized by comprising the following steps:
receiving a contract acquisition request sent by a contract checking end, and acquiring a corresponding target encryption contract from a block chain according to the contract acquisition request;
the combined private key of the target party is called to decrypt the target encryption contract to obtain a partial decryption contract;
obtaining a target combined hash value according to the identification information of the participants in the partial decryption contract;
and sending the partial decryption contract and the target hash value to the contract verification end.
6. A contract management device based on a block chain and a combined key is applied to a contract end and is characterized by comprising:
the combined module is used for acquiring all participants on a block chain, combining the participants in pairs to obtain a combined result, and generating a public and private key pair corresponding to each combination according to the combined result, wherein the public and private key pair comprises a combined public key and a combined private key;
the sending module is used for sending the combination private key to a corresponding participant in each combination;
the first calculation module is used for acquiring identification information of participants in the combination and carrying out hash calculation on the identification information to obtain a combined hash value;
the mapping module is used for mapping the combined hash value and a combined public key of the corresponding public and private key pair and storing the mapped combined hash value and the corresponding combined public and private key pair into the block chain;
the encryption module is used for encrypting the key information in the contract corresponding to the participant in the combination by using the combined public key to obtain an encrypted contract;
the second calculation module is used for carrying out hash calculation on the encryption contract to obtain a contract hash value;
and the uploading module is used for uploading the encryption contract and the contract hash value to the block chain.
7. A contract management device based on a block chain and a combined key is applied to a contract verifying end and is characterized by comprising:
the sending module is used for sending the contract obtaining request to the client corresponding to the target party;
a receiving module, configured to receive a partial decryption contract sent by the client and a corresponding target combined hash value, where the partial decryption contract is obtained by decrypting, by the client, a target encryption contract obtained based on the contract acquisition request;
the encryption module is used for obtaining a corresponding target combined public key according to the target combined hash value, and re-encrypting the partial disassembly close agreement by using the target combined public key to obtain a contract to be verified;
the third calculation module is used for carrying out hash calculation on the contract to be verified to obtain a hash value to be verified;
and the verification module is used for verifying the hash value to be verified to obtain a verification result.
8. A contract management device based on a block chain and a combined key is applied to a client and is characterized by comprising:
the acquisition module is used for receiving a contract acquisition request sent by a contract checking end and acquiring a corresponding target encryption contract from a block chain according to the contract acquisition request;
the decryption module is used for decrypting the target encryption contract by using the combined private key of the target party to obtain a partial decryption contract;
the fourth calculation module is used for obtaining a target combined hash value according to the identification information of the participants in the partial decryption contract;
and the sending module is used for sending the partial decryption contract and the target hash value to the contract verification end.
9. A computer device comprising a contractual end, a contract checking end and a client, the contractual end comprising a first memory and a first processor, the first memory having stored therein computer readable instructions, the first processor when executing the computer readable instructions implementing the steps of the block chain and combination key based contract management method according to any one of claims 1 to 2; the contract verifying end comprises a second memory and a second processor, the second memory stores computer readable instructions, the second processor executes the computer readable instructions to realize the steps of the contract management method based on the blockchain and the combined key according to any one of claims 3 to 4; the client includes a third memory having computer readable instructions stored therein which, when executed by the third processor, implement the steps of the blockchain and combination key based contract management method of claim 5.
10. A computer-readable storage medium, having stored thereon computer-readable instructions which, when executed by a processor, carry out the steps of the blockchain and combination key based contract management method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210668866.4A CN115085934A (en) | 2022-06-14 | 2022-06-14 | Contract management method based on block chain and combined key and related equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210668866.4A CN115085934A (en) | 2022-06-14 | 2022-06-14 | Contract management method based on block chain and combined key and related equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115085934A true CN115085934A (en) | 2022-09-20 |
Family
ID=83252176
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210668866.4A Pending CN115085934A (en) | 2022-06-14 | 2022-06-14 | Contract management method based on block chain and combined key and related equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115085934A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115632890A (en) * | 2022-12-23 | 2023-01-20 | 北京锘崴信息科技有限公司 | Secure decryption method and device for private data and financial private data |
CN118171304A (en) * | 2024-05-09 | 2024-06-11 | 江西怡杉科技有限公司 | Intelligent hydraulic engineering management method and system based on ecological monitoring data |
-
2022
- 2022-06-14 CN CN202210668866.4A patent/CN115085934A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115632890A (en) * | 2022-12-23 | 2023-01-20 | 北京锘崴信息科技有限公司 | Secure decryption method and device for private data and financial private data |
CN115632890B (en) * | 2022-12-23 | 2023-04-07 | 北京锘崴信息科技有限公司 | Secure decryption method and device for private data and financial private data |
CN118171304A (en) * | 2024-05-09 | 2024-06-11 | 江西怡杉科技有限公司 | Intelligent hydraulic engineering management method and system based on ecological monitoring data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111080295B (en) | Electronic contract processing method and device based on blockchain | |
US10839070B1 (en) | Securely executing smart contract operations in a trusted execution environment | |
CN110417750B (en) | Block chain technology-based file reading and storing method, terminal device and storage medium | |
CN111835511A (en) | Data security transmission method and device, computer equipment and storage medium | |
CN113364760A (en) | Data encryption processing method and device, computer equipment and storage medium | |
TW201947476A (en) | Blockchain-based logistics information transmission method, system and device | |
CN112215608A (en) | Data processing method and device | |
CN111460525B (en) | Block chain-based data processing method, device and storage medium | |
CN112511514A (en) | HTTP encrypted transmission method and device, computer equipment and storage medium | |
CN115085934A (en) | Contract management method based on block chain and combined key and related equipment | |
CN113438088A (en) | Social network credit monitoring method and device based on block chain distributed identity | |
CN112231284A (en) | Block chain-based big data sharing system, method, device and storage medium | |
CN113302610B (en) | Trusted platform based on blockchain | |
CN115380303A (en) | Trusted platform based on block chain | |
CN113961956B (en) | Method, device, equipment and medium for generating and applying labeled network information service | |
CN116226289A (en) | Electronic certificate management method, device, equipment and storage medium based on blockchain | |
CN110569672A (en) | efficient credible electronic signature system and method based on mobile equipment | |
CN112184444A (en) | Method, apparatus, device and medium for processing information based on information characteristics | |
CN113434882A (en) | Communication protection method and device of application program, computer equipment and storage medium | |
CN111950032A (en) | Block chain-based data storage method, terminal device and storage medium | |
CN113315745A (en) | Data processing method, device, equipment and medium | |
CN115659378A (en) | Case record information evidence storing method and related equipment | |
CN114500093A (en) | Safe interaction method and system for message information | |
CN113783690B (en) | Authentication-based bidding method and device | |
CN113597608B (en) | Trusted platform based on blockchain |
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 |