File encryption method based on block chain bidding systemTechnical Field
The invention relates to the field of block chains, in particular to a file encryption method based on a block chain bidding system.
Background
The electronic bidding is a bidding activity completed in a data telegraph text form. Generally speaking, paper documents are partially or completely abandoned, and bidding activities are completed by means of computers and networks. Electronic bidding brings convenience, quickness and cost reduction benefits, and meanwhile, has a plurality of problems. The main problem is network information security, and network security problems may occur in many links in the whole process of electronic bidding, such as identity authentication of electronic buyers and sellers, host and object of data communication, and secure transmission of information data. At present, in electronic bidding activities, the security of electronic file data is not high enough, and the electronic file data is easy to be tampered.
The randow provides a block chain-based bid inviting and bidding processing method and system, processing steps of bid inviting, bidding, bid opening, bid evaluation, bid winning and the like are stored in each block and a private chain for solving, the openness and fairness of each link are guaranteed, the time sequence of data is guaranteed, and the data can be traced. However, only for the encryption of the bidding document, a symmetric encryption method is used as a main method, and the encryption algorithm is single, so that the absolute security of the bidding document cannot be guaranteed, and therefore, an encryption mode capable of guaranteeing higher security of bidding document information needs to be designed, so that the tenderer and the bidder can complete fair and fair bidding activities on line.
The full-state star proposes encryption distribution based on block chain sensitive information, and introduces how to encrypt and decrypt bidding information by using a secure hash algorithm, an RSA algorithm and the like. The full-armor star uses SHA-256 algorithm to encrypt the single notice attachment information in the notice attachment information to prevent the notice attachment information from being falsified. And adding RSA signature algorithm to carry out signature verification on the notice information. In the public platform for bidding of the block chain, the public platform for bidding indicates that the public platform for bidding of the block chain adjusts the advertisement information field of the block, adds the sensitive information field and encrypts the sensitive field. Although the full-bore star optimizes the encryption and decryption method of the bidding and bidding announcement information, the RSA algorithm key is lower than 1024 bits in the decryption process, and the decomposition of RSA-512 is relatively simple for individual users, so that potential safety hazards exist. In addition, the encryption method only encrypts a single link of the issued announcement in the bidding process, and does not relate to links such as bidding, bid evaluation, bid opening, scaling and the like, so that a block chain technology and a safe encryption algorithm are required to be designed to be applied to more links in the bidding process, and the whole bidding process is more standard and safe.
Plum proposes a block chain technology-based encryption algorithm application study for Liu Shi cloud, points out that the realization of the function of the block chain needs to solve the security problem, and further leads out an RSA encryption algorithm. The method adopts an RSA encryption algorithm to ensure the security of data in a block chain technology network, and obtains the process of RSA encryption and decryption through simulation. However, only the encryption algorithm combined with the block chain technology is proposed, and is not applied to the bidding environment, so that a block chain encryption algorithm adapted to the bidding environment needs to be designed to combine the algorithm with the actual application.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide a file encryption method based on a block chaining bidding system.
A file encryption method based on a block chaining bidding system comprises the following steps:
1-1) a bidder imports a bid file F at a client, the client randomly generates an AES key (the key is only held by the bidder), and the F is encrypted by using an AES algorithm to generate F';
1-2) uploading F ' to an IPFS (distributed file storage system) by a client, obtaining Hf by the client by taking a hash value of F ', adding a random number uuid behind the Hf to obtain m, and blinding m by using a blind signature algorithm to obtain m ';
1-3) the client sends m ' to the server for signature, and the server signs m ' by using a private key to obtain s ';
1-4) the client sends s 'to the intelligent contract, the validity of the signature of the tenderer is verified by the intelligent contract, if the signature is valid, the client removes blindness from s' to obtain s, and if the signature is invalid, the client goes to 1-3);
1-5) the client sends s and m to the intelligent contract for verification, and if the verification is successful, m is stored in the block chain.
In the steps 1-5), the implementation process is as follows:
2-1) the client of the tenderer generates a random account number, and s and m are sent to the intelligent contract through the random account number for verification;
2-2) if m is obtained after s is successfully signed, resolving m to obtain Hf and uuid, then checking is successful, and the client side of the tenderer stores m to the block chain; otherwise, the check fails and an error is returned.
The invention has the following beneficial effects:
1. the method and the system realize the complete unknown guarantee between the bidder and the tenderer, and the tenderer can guarantee the validity and the authentication operation of the file under the condition of guaranteeing the complete anonymity of the process file before the tendering.
2. Any link of the bidding document file before the opening of the bidding document is in an anonymous and encrypted state, so that the possibility of tampering and stealing the bidding document is almost zero.
3. The intelligent contract has zero knowledge proof characteristic, each step of operation of the intelligent contract leaves a record on the chain, and both sides can self-prove and clear due to the non-tamper property of the block chain, so that the trust cost between the bidder and the tenderer is reduced.
Detailed Description
The invention will be further illustrated and described with reference to the following examples. The technical features of the embodiments of the present invention can be combined correspondingly without mutual conflict.
A file encryption method based on a block chaining bidding system comprises the following steps:
1-1) a bidder imports a bid file F at a client, the client randomly generates an AES key (the key is only held by the bidder), and the F is encrypted by using an AES algorithm to generate F';
1-2) uploading F ' to an IPFS (distributed file storage system) by a client, obtaining Hf by the client by taking a hash value of F ', adding a random number uuid behind the Hf to obtain m, and blinding m by using a blind signature algorithm to obtain m ';
1-3) the client sends m ' to the server for signature, and the server signs m ' by using a private key to obtain s ';
1-4) the client sends s 'to the intelligent contract, the validity of the signature of the tenderer is verified by the intelligent contract, if the signature is valid, the client removes blindness from s' to obtain s, and if the signature is invalid, the client goes to 1-3);
1-5) the client sends s and m to the intelligent contract for verification, and if the verification is successful, m is stored in the block chain.
A file encryption method based on a block chaining bidding system is characterized in that in the step 1-5), the implementation process is as follows:
2-1) the client of the tenderer generates a random account number, and s and m are sent to the intelligent contract through the random account number for verification;
2-2) if m is obtained after s is successfully signed, resolving m to obtain Hf and uuid, then checking is successful, and the client side of the tenderer stores m to the block chain; otherwise, the check fails and an error is returned.
Examples
To facilitate the understanding and practice of the present invention by those of ordinary skill in the art, a specific embodiment of the method of the present invention will now be presented. The file encryption method based on the block chain bidding system fully utilizes the characteristics and advantages of the block chain, the RSA algorithm, the Hash algorithm and the blind signature algorithm, solves the problem of safety of current bidding data, and provides a more safe and transparent file encryption method.
In this embodiment, a company A intends to purchase a collection of displays by tender. Company a uses the system to issue a bidding announcement. The specific requirements are shown in table 1.
Bidding project name: display procurement
The item guarantee amount: 2000
Item bidding start time: 2018-05-15
Ciphertext submission end time: 2018-05-25
Item bidding end time: 2018-06-10
Minimum bid number for project: 2
TABLE 1 display requirements of company A
The three companies A, B and C know the specific requirements of the company A on bid by inquiring the bid-inviting announcement and successively and online propose bid applications to the company A. After obtaining the application, three companies A, B and C upload bid documents F1, F2 and F3 respectively on the client. The client randomly generates three pairs of AES keys, and F1, F2 and F3 are encrypted respectively by using an AES algorithm to obtain F1 ', F2 ' and F3 '.
TABLE 2 Bidding of three companies
| Company A | Company B | C Corp Ltd |
| F1 | F2 | F3 |
TABLE 3 company Bid content
| Detailed description of the invention | Size of | Resolution ratio | Degree of refresh | Brightness of light | Unit price of |
| Bidding content | 24 | 1K | 60 | 250 | 1199 |
TABLE 4 Bid Contents
| Detailed description of the invention | Size of | Resolution ratio | Degree of refresh | Brightness of light | Unit price of |
| Bidding content | 27 | 4K | 60 | 350 | 3299 |
TABLE 5C Bidding content
| Detailed description of the invention | Size of | Resolution ratio | Degree of refresh | Brightness of light | Unit price of |
| Bidding content | 24 | 1K | 60 | 250 | 789 |
TABLE 6A company Biddings encryption
| AES key | bj3kHJI2jh41jur93FH |
| F1’ | jnpTfJHH+SCtaTgqxpN9fHx/r0BVyzQlx8LD9KFRpkE= |
TABLE 7B company Biddings encryption
| AES key | ihurfqw6574ddw652ed |
| F2’ | qTke3/QXjSu1CUZw3DeuUtBt4PdfHHT54f0NDlwwWM8= |
TABLE 8C company Biddings encryption
| AES key | kdsfbjw872kwi8w2jwwe2e2k |
| F3’ | sseMtT4PZw80aDHMnMlTn8eCHTuZRkKjuls36mtg2L0= |
The client uploads the encrypted files F1 ', F2' and F3 'to the IPFS respectively, and takes hash values of F1', F2 'and F3' to obtain Hf1, Hf2 and Hf3 respectively.
Table 9 encryption Bidding hash value
| Hf1 | a5080104a6d50c8a85262d36cbf74eab9a3eb4a66d56fdd4f7ded44334b7b802 |
| Hf2 | 06a8fae940ccabecc6646cd9698358965f47383051d20d77eeef1ddbfd3f7f6d |
| Hf3 | 46415f99320a989325ed063a3aff0d74a4bdc6888d9957c2ed6e2ac23a0de0 |
The client adds random numbers uuid1, uuid2 and uuid3 after the hash values Hf1, Hf2 and Hf3 respectively to obtain m1, m2 and m 3.
TABLE 10A Cryptographic addition random number
| Hf1 | a5080104a6d50c8a85262d36cbf74eab9a3eb4a66d56fdd4f7ded44334b7b80 |
| uuid1 | uuid{qvxcewptvotwjbve} |
| m1 | a5080104a6d50c8a85262d36cbf74eab9a3eb4a66d56fdd4f7ded44334b7b802uuid{qvxcewptvotwjbve} |
TABLE 11B company ciphertext appending random number
| Hf2 | 06a8fae940ccabecc6646cd9698358965f47383051d20d77eeef1ddbfd3f7f6d |
| uuid2 | uuid{edzydbfwpqpqlmfy} |
| m2 | 06a8fae940ccabecc6646cd9698358965f47383051d20d77eeef1ddbfd3f7f6duuid{edzydbfwpqpqlmfy |
TABLE 12C ciphertext ADDING RANDOM NUMBER
| Hf3 | 46415f99320a989e25ed063a3aff0d74a4bdc6888d9957c2ed6e5e2ac23a0de0 |
| uuid3 | uuid{qasaorhiaomnsfto} |
| m3 | 46415f99320a989e25ed063a3aff0d74a4bdc6888d9957c2ed6e5e2ac23a0de0uuid{qasaorhiaomnsfto} |
The client side respectively blinds m1, m2 and m3 by using a blind signature algorithm to obtain m1 ', m2 ' and m3 '; the client side sends m1 ', m2 ' and m3 ' to the server for signature, and the server side signs m1 ', m2 ' and m3 ' by using a private key to obtain s1 ', s2 ' and s3 '.
Watch 13 blinding
TABLE 14 private Key of Bidding
| Company(s) | Signature private key |
| A | 353543768370652810909875977996662029267676041776692723383222626168573263872 |
| B | 52659416512935271099904227995352748058050342166457930265410964719284359528448 |
| C | 21395183056351271679224886452430563801672963618705005228507133440019639828480 |
TABLE 15A company signs each blind label
| Company(s) | Signature ciphertext |
| s1’ | 417813214086051801172299761555683317985574960277767116656822037758556214292 |
| s2’ | 997499559078896871756544784060543197596631915054786463217910134590883458540 |
| s3’ | 1134042982415102019994507682132730044542351236954908744302469034432436245225 |
The client side sends s1 ', s 2' and s3 'to the intelligent contract respectively to check the validity of the signature of the company A, if the signature is valid, s 1', s2 'and s 3' are blinded to obtain s1, s2 and s 3; if not, the signature is reinitiated.
TABLE 16 Blind removal
| s1 | 407843721258687185499632414649544394783569158755562858739605128194653842074 |
| s2 | 29379553922896757776509293233661646443670127839201157116641156056003689919188 |
| s3 | 20885760979870704405422622932318070471408154373845334373482441288410748560662 |
The client generates random account numbers r1, r2 and r3, and s and m are sent to the intelligent contract through the random account numbers (consisting of Address and Privkey) to be verified; if m is obtained after s is successfully signed, resolving m to obtain Hf and uuid, then checking successfully, and storing m to the block chain by the client; otherwise, the check fails and an error is returned.
TABLE 17 random Account number
| Address | Privkey |
| r1 | 1865395204908298151104826047228711880633095784713438137095874058349859949023331937192502391188129495230680634168192693719340908986744844498786077051644773 | 3316221033886075137115213077544289300213993542200343317624474881563696219610941719786993381968380995749843630419082151202556972248661512362529547489259757 |
| r2 | 120214962853234525524124259732258382874402916893583701009502862527439196821048615056121266288776939857550830527819565503129214056563680863532236827725085 | 518691876112864156952680718827884935279352084844592986151063567955295729390047829346022837346003287955557103541065256669735430964275772388758916699167105 |
| r3 | 5868269337901128562453582804290730466313974800597077295121672900713008097703077051619178455234916256971259029192545301095775577440860294469517764601721 | 3736318219887411804028413902041868898687001383016830816875798234444210401003724847723680361187591792788685496643646180064106083597234616741968690735045 |
TABLE 18 De-signature s
| m1 | a5080104a6d50c8a85262d36cbf74eab9a3eb4a66d56fdd4f7ded44334b7b802uuid{qvxcewptvotwjbve} |
| m2 | 06a8fae940ccabecc6646cd9698358965f47383051d20d77eeef1ddbfd3f7f6duuid{edzydbfwpqpqlmfy |
| m3 | 46415f99320a989e25ed063a3aff0d74a4bdc6888d9957c2ed6e5e2ac23a0de0uuid{qasaorhiaomnsfto} |
TABLE 19 m analysis
| Hf1 | a5080104a6d50c8a85262d36cbf74eab9a3eb4a66d56fdd4f7ded44334b7b80 |
| uuid1 | uuid{qvxcewptvotwjbve} |
| Hf2 | 06a8fae940ccabecc6646cd9698358965f47383051d20d77eeef1ddbfd3f7f6d |
| uuid2 | uuid{edzydbfwpqpqlmfy} |
| Hf3 | 46415f99320a989e25ed063a3aff0d74a4bdc6888d9957c2ed6e5e2ac23a0de0 |
| uuid3 | uuid{qasaorhiaomnsfto} |