CN117077172A - Bid file encryption and decryption method and system based on block chain technology - Google Patents

Bid file encryption and decryption method and system based on block chain technology Download PDF

Info

Publication number
CN117077172A
CN117077172A CN202311068741.9A CN202311068741A CN117077172A CN 117077172 A CN117077172 A CN 117077172A CN 202311068741 A CN202311068741 A CN 202311068741A CN 117077172 A CN117077172 A CN 117077172A
Authority
CN
China
Prior art keywords
key
algorithm
hash value
file
encryption
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
Application number
CN202311068741.9A
Other languages
Chinese (zh)
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.)
Cmcc United Information Co ltd
Original Assignee
Cmcc United Information Co ltd
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 Cmcc United Information Co ltd filed Critical Cmcc United Information Co ltd
Priority to CN202311068741.9A priority Critical patent/CN117077172A/en
Publication of CN117077172A publication Critical patent/CN117077172A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/602Providing cryptographic facilities or services
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use

Abstract

The application discloses a bidding document encryption method based on a blockchain technology, which comprises the following steps: splitting the bidding document to be encrypted into a plurality of subfiles according to a preset bidding document splitting rule; generating an encryption algorithm and an algorithm identification for each subfile according to the encryption algorithm generation strategy; generating a key and a key identifier for each sub-file according to the key generation strategy; encrypting each sub-file by using an encryption algorithm and a secret key corresponding to the sub-file; constructing a block for each encrypted sub-file; sorting all the blocks, and calculating a second hash value for all the sorted blocks; and transmitting all the key identifications, all the algorithm identifications, the second hash value and all the blocks to a data receiving end. According to the method, the bidding documents are split, and the split documents are transmitted in the form of the blockchain for the data receiving end to store in a distributed mode, so that the safety of the prior art can be effectively improved.

Description

Bid file encryption and decryption method and system based on block chain technology
Technical Field
The application relates to the technical field of data processing, in particular to a bidding document encryption and decryption method and system based on a blockchain technology.
Background
With the rapid development of information technology, data security in the transmission process is very important, and if necessary encryption measures are not taken, the data in the transmission process is easily intercepted or tampered by adopting a plaintext transmission mode. The conventional method is to encrypt the plaintext directly by using the existing encryption and decryption algorithm, store and transmit the ciphertext according to the established storage and transmission protocol, and ensure the safety of data transmission to a certain extent.
Disclosure of Invention
The application aims to provide a bidding document encryption and decryption method and system based on a blockchain technology, which solve the problem of low encryption strength in the prior art.
In order to solve the above problems, a first aspect of the present application provides a bid file encryption method based on a blockchain technique, which is applied to a data transmitting end, and includes:
splitting the bidding document to be encrypted into a plurality of subfiles according to a preset bidding document splitting rule;
generating an encryption algorithm and an algorithm identification for each subfile according to the encryption algorithm generation strategy;
generating a key and a key identifier for each sub-file according to the key generation strategy;
encrypting each sub-file by using an encryption algorithm and a secret key corresponding to the sub-file;
constructing a block for each encrypted sub-file;
sorting all the blocks, and calculating a second hash value for all the sorted blocks;
and transmitting all the key identifications, all the algorithm identifications, the second hash value and all the blocks to a data receiving end.
Optionally, generating an encryption algorithm for each subfile according to the encryption algorithm generation policy includes:
acquiring a preset encryption algorithm database, wherein the encryption algorithm database comprises a plurality of encryption algorithms and a plurality of algorithm identifications, and the encryption algorithms correspond to the algorithm identifications one by one;
randomly generating an algorithm identifier for each subfile in the plurality of algorithm identifiers using a random number generator;
and adopting the encryption algorithm corresponding to the algorithm identification in the encryption algorithm database as the encryption algorithm of the subfile.
Optionally, generating a key and a key identification for each subfile according to the key generation policy includes:
acquiring a preset secret key generation rule base, wherein the secret key generation rule base comprises a plurality of secret key generation rules and a plurality of secret key identifications, and the secret key generation rules are in one-to-one correspondence with the secret key identifications;
randomly generating key identifications, which are the same as the plurality of subfiles, in the plurality of key identifications by using a random number generator;
and generating a key by adopting a key generation rule corresponding to the key identification in the key generation rule base.
Optionally, each key generation rule includes N hash algorithms arranged in sequence, where N is an integer greater than 1;
the key generation rule base comprises a basic key;
the key generation rule generation key corresponding to the key identification in the key generation rule base comprises the following steps:
the following steps are performed for the ith hash algorithm, where 1 < i.ltoreq.N,
when i=1, calculating the basic key by adopting a current hash algorithm to obtain a 1 st hash value;
when i is more than 1 and less than N, calculating the i-1 hash value by adopting a current hash algorithm to obtain an i hash value;
when i=n, the key is obtained by calculating N-1 hash values using the current hash algorithm.
Optionally, constructing a block from each encrypted subfile includes:
the following steps are performed for each encrypted subfile:
calculating a first hash value for the encrypted subfile;
generating block header data according to the first hash value of the current encrypted sub-file and the first hash value of the last encrypted sub-file of the current encrypted sub-file, and splicing the block header data and the encrypted sub-file into a block.
Optionally, sending all the key identifiers, all the algorithm identifiers, the second hash value, and all the chunks to the data receiving end includes:
ordering the key identifiers according to the same sequence as the block ordering to form a key identifier list;
sorting the algorithm identifications according to the same sequence as the block sorting to form an algorithm identification list;
and ordering the key identification list, the algorithm identification list, the second hash value and all the blocks according to a preset rule, and sending the ordered blocks to a data receiving end.
Another aspect of the present application provides a bid document decryption method based on a blockchain technique, applied to a data receiving terminal, including:
receiving all key identifications, all algorithm identifications, second hash values and all blocks sent by a data sending end;
calculating a third hash value for all received blocks;
if the third hash value is the same as the second hash value, then
Ordering all the blocks;
generating a key for each block according to the key identification and the key generation strategy;
generating an encryption algorithm for each block according to the algorithm identification and the encryption algorithm generation strategy;
decrypting each block by using a secret key to obtain each subfile;
and splicing all the subfiles according to the bidding document splicing rules to obtain the bidding document to be decrypted.
Another aspect of the present application provides a bid file encryption apparatus based on a blockchain technique, applied to a data transmitting terminal, including:
the splitting module splits the bidding document to be encrypted into a plurality of subfiles according to preset bidding document splitting rules;
the first encryption algorithm generation module generates an encryption algorithm and an algorithm identifier for each sub-file according to an encryption algorithm generation strategy;
the first key generation module generates a key and a key identifier for each sub-file according to the key generation strategy;
the encryption module encrypts each sub-file by using an encryption algorithm and a secret key corresponding to the sub-file;
the block construction module constructs a block from each encrypted sub-file;
the second hash value calculation module sorts all the blocks and calculates a second hash value for all the sorted blocks;
and the sending module is used for sending all the key identifications, all the algorithm identifications, the second hash value and all the blocks to a data receiving end.
Another aspect of the present application provides a bid document decryption apparatus based on a blockchain technique, applied to a data receiving terminal, including:
the receiving module is used for receiving all key identifications, all algorithm identifications, second hash values and all blocks sent by the data sending end;
a third hash value calculation module for calculating a third hash value for all received blocks;
the sorting module is used for sorting the second hash value if the third hash value is the same as the second hash value
Ordering all the blocks;
the second key generation module generates a key for each block according to the key identification and the key generation strategy;
the second encryption algorithm generation module generates an encryption algorithm for each block according to the algorithm identification and the encryption algorithm generation strategy;
the decryption module decrypts each block by using the secret key to obtain each subfile;
and the splicing module splices all the subfiles according to the bidding document splicing rule to obtain the bidding document to be decrypted.
The application also provides a bidding document encryption and decryption system based on the blockchain technology, which is characterized by comprising the following steps: the bid file encryption device based on the blockchain technology and the bid file decryption device based on the blockchain technology.
The technical scheme of the application has the following beneficial technical effects:
according to the bidding document encryption method based on the blockchain technology, bidding documents are split, and the split documents are transmitted in the blockchain mode to be stored in a distributed mode by a data receiving end, so that the safety of the prior art can be effectively improved, and particularly, the parts with different confidentiality requirements are respectively stored by the method, so that the safety is higher.
The method adopts a random generation encryption algorithm, the algorithms are different in each file transmission, the security is better, and the file is not easy to crack.
The method adopts the random generation secret keys, the secret keys are different in each file transmission, the security is better, and the method is not easy to crack. The cracking difficulty is increased through the cooperation with an encryption algorithm.
Drawings
FIG. 1 is a flowchart of a bid file encryption method based on a blockchain technique in accordance with a first embodiment of the present application;
fig. 2 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The objects, technical solutions and advantages of the present application will become more apparent by the following detailed description of the present application with reference to the accompanying drawings. It should be understood that the description is only illustrative and is not intended to limit the scope of the application. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the present application.
Referring to fig. 1, in one embodiment of the present application, there is provided a bid file encryption method based on a blockchain technique, applied to a data transmitting terminal, including:
splitting the bidding document to be encrypted into a plurality of subfiles according to a preset bidding document splitting rule;
generating an encryption algorithm and an algorithm identification for each subfile according to the encryption algorithm generation strategy;
generating a key and a key identifier for each sub-file according to the key generation strategy;
encrypting each sub-file by using an encryption algorithm and a secret key corresponding to the sub-file;
constructing a block for each encrypted sub-file;
sorting all the blocks, and calculating a second hash value for all the sorted blocks;
and transmitting all the key identifications, all the algorithm identifications, the second hash value and all the blocks to a data receiving end.
According to the bidding document encryption method based on the blockchain technology, bidding documents are split, and the split documents are transmitted in the blockchain mode to be stored in a distributed mode by a data receiving end, so that the safety of the prior art can be effectively improved, and particularly, the parts with different confidentiality requirements are respectively stored by the method, so that the safety is higher.
It can be known that the bidding document generally comprises a plurality of parts such as company introduction, implementation scheme, price, team introduction and the like, and the plurality of parts can be stored separately by adopting the method, so that the security is higher.
In one embodiment, generating an encryption algorithm for each subfile based on the encryption algorithm generation policy includes:
acquiring a preset encryption algorithm database, wherein the encryption algorithm database comprises a plurality of encryption algorithms and a plurality of algorithm identifications, and the encryption algorithms correspond to the algorithm identifications one by one;
randomly generating an algorithm identifier for each subfile in a plurality of algorithm identifiers using a random number generator;
and adopting an algorithm identification corresponding to the algorithm in the encryption algorithm database as the encryption algorithm of the subfile.
The method adopts a random generation encryption algorithm, the algorithms are different in each file transmission, the security is better, and the file is not easy to crack.
In one embodiment, generating a key and key identification for each subfile according to the key generation policy includes:
acquiring a preset key generation rule base, wherein the key generation rule base comprises a plurality of key generation rules and a plurality of key identifiers, and the key generation rules are in one-to-one correspondence with the key identifiers;
randomly generating key identifications with the same number as the plurality of subfiles in the plurality of key identifications by using a random number generator;
and generating a key by adopting a key generation rule corresponding to the key identification in the key generation rule base.
The method adopts the random generation secret keys, the secret keys are different in each file transmission, the security is better, and the method is not easy to crack. The cracking difficulty is increased through the cooperation with an encryption algorithm.
In one embodiment, each key generation rule includes N hash algorithms arranged in a sequence, where N is an integer greater than 1;
the key generation rule base comprises a basic key;
the key generation rule generation key corresponding to the key identification in the key generation rule base is adopted and comprises the following steps:
the following steps are performed for the ith hash algorithm, where 1 < i.ltoreq.N,
when i=1, calculating the basic key by adopting a current hash algorithm to obtain a 1 st hash value;
when i is more than 1 and less than N, calculating the i-1 hash value by adopting a current hash algorithm to obtain an i hash value;
when i=n, the key is obtained by calculating N-1 hash values using the current hash algorithm.
In one embodiment, constructing a block from each encrypted subfile includes:
the following steps are performed for each encrypted subfile:
calculating a first hash value for the encrypted subfile;
generating block header data according to the first hash value of the current encrypted sub-file and the first hash value of the last encrypted sub-file of the current encrypted sub-file, and splicing the block header data and the encrypted sub-file into a block.
In one embodiment, transmitting all key identifiers, all algorithm identifiers, the second hash value, and all chunks to the data receiving end includes:
ordering the key identifiers in the same order as the block ordering to form a key identifier list;
sorting the algorithm identifications according to the same sequence as the block sorting to form an algorithm identification list;
and ordering the key identification list, the algorithm identification list, the second hash value and all the blocks according to a preset rule, and sending the ordered blocks to a data receiving end.
Another aspect of the present application provides a bid document decryption method based on a blockchain technique, applied to a data receiving terminal, including:
receiving all key identifications, all algorithm identifications, second hash values and all blocks sent by a data sending end;
calculating a third hash value for all received blocks;
if the third hash value is the same as the second hash value, then
Ordering all the blocks;
generating a secret key for each block according to the secret key identification and the secret key generation strategy, wherein the method and the data adopted by the data transmitting end are completely the same, and are not excessively introduced;
generating an encryption algorithm for each block according to the algorithm identification and the encryption algorithm generation strategy, wherein the method and the data adopted by the data transmitting end are completely the same, and are not excessively introduced;
decrypting each block by using a secret key to obtain each subfile;
and splicing all the subfiles according to the bidding document splicing rules to obtain the bidding document to be decrypted.
Another aspect of the present application provides a bid file encryption apparatus based on a blockchain technique, applied to a data transmitting terminal, including:
the splitting module splits the bidding document to be encrypted into a plurality of subfiles according to preset bidding document splitting rules;
the first encryption algorithm generation module generates an encryption algorithm and an algorithm identifier for each sub-file according to an encryption algorithm generation strategy;
the first key generation module generates a key and a key identifier for each sub-file according to the key generation strategy;
the encryption module encrypts each sub-file by using an encryption algorithm and a secret key corresponding to the sub-file;
the block construction module constructs a block from each encrypted sub-file;
the second hash value calculation module sorts all the blocks and calculates a second hash value for all the sorted blocks;
and the sending module is used for sending all the key identifications, all the algorithm identifications, the second hash value and all the blocks to the data receiving end.
Another aspect of the present application provides a bid document decryption apparatus based on a blockchain technique, applied to a data receiving terminal, including:
the receiving module is used for receiving all key identifications, all algorithm identifications, second hash values and all blocks sent by the data sending end;
a third hash value calculation module for calculating a third hash value for all received blocks;
the sorting module is used for sorting the second hash value if the third hash value is the same as the second hash value
Ordering all the blocks;
the second key generation module generates a key for each block according to the key identification and the key generation strategy;
the second encryption algorithm generation module generates an encryption algorithm for each block according to the algorithm identification and the encryption algorithm generation strategy;
the decryption module decrypts each block by using the secret key to obtain each subfile;
and the splicing module splices all the subfiles according to the bidding document splicing rule to obtain the bidding document to be decrypted.
Another aspect of the present application provides a bid document encryption and decryption system based on a blockchain technique, comprising: the bid file encryption device based on the block chain technology and the bid file decryption device based on the block chain technology.
The above description of the method also applies to the description of the device.
The application also provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the bidding file encryption method based on the blockchain technology or the bidding file decryption method based on the blockchain technology when executing the computer program.
The present application also provides a computer-readable storage medium storing a computer program which, when executed by a processor, is capable of implementing the bid file encryption method based on the blockchain technique or the bid file decryption method based on the blockchain technique as described above.
Fig. 2 is an exemplary structural diagram of an electronic device capable of implementing a bid file encryption method based on a blockchain technique or a bid file decryption method based on a blockchain technique provided in accordance with an embodiment of the present application.
As shown in fig. 2, the electronic device includes an input device 501, an input interface 502, a central processor 503, a memory 504, an output interface 505, and an output device 506. The input interface 502, the central processing unit 503, the memory 504, and the output interface 505 are connected to each other through a bus 507, and the input device 501 and the output device 506 are connected to the bus 507 through the input interface 502 and the output interface 505, respectively, and further connected to other components of the electronic device. Specifically, the input device 501 receives input information from the outside, and transmits the input information to the central processor 503 through the input interface 502; the central processor 503 processes the input information based on computer executable instructions stored in the memory 504 to generate output information, temporarily or permanently stores the output information in the memory 504, and then transmits the output information to the output device 506 through the output interface 505; the output device 506 outputs the output information to the outside of the electronic device for use by the user.
That is, the electronic device shown in fig. 2 may also be implemented to include: a memory storing computer-executable instructions; and one or more processors that, when executing the computer-executable instructions, can implement the blockchain technology-based bid file encryption method or the blockchain technology-based bid file decryption method described in connection with fig. 1.
In one embodiment, the electronic device shown in FIG. 2 may be implemented to include: a memory 504 configured to store executable program code; the one or more processors 503 are configured to execute the executable program code stored in the memory 504 to perform the blockchain technology-based bid file encryption method or the blockchain technology-based bid file decryption method in the above embodiments.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer-readable media include both permanent and non-permanent, removable and non-removable media, and the media may be implemented in any method or technology for storage of information. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps. A plurality of units, modules or means recited in the apparatus claims can also be implemented by means of software or hardware by means of one unit or total means. The terms first, second, etc. are used to identify names, and not any particular order.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The processor referred to in this embodiment may be a central processing unit (Central Processing Unit, CPU), or other general purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may be used to store computer programs and/or modules, and the processor may perform various functions of the apparatus/terminal device by executing or executing the computer programs and/or modules stored in the memory, and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
In this embodiment, the modules/units of the apparatus/terminal device integration may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as a separate product. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by hardware related to the instructions of a computer program, where the computer program may be stored in a computer readable storage medium, and when executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, executable files or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth.
It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the legislation and the practice of the patent in the jurisdiction. While the application has been described in terms of preferred embodiments, it is not intended to limit the application thereto, and any person skilled in the art can make variations and modifications without departing from the spirit and scope of the present application, and therefore the scope of the application is to be determined from the appended claims.
While the application has been described in detail in the foregoing general description and with reference to specific embodiments thereof, it will be apparent to one skilled in the art that modifications and improvements can be made thereto. Accordingly, such modifications or improvements may be made without departing from the spirit of the application and are intended to be within the scope of the application as claimed.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs. The modules in the device of the embodiment of the application can be combined, divided and deleted according to actual needs.

Claims (10)

1. A bidding document encryption method based on a blockchain technology is characterized by being applied to a data transmitting end and comprising the following steps:
splitting the bidding document to be encrypted into a plurality of subfiles according to a preset bidding document splitting rule;
generating an encryption algorithm and an algorithm identification for each subfile according to the encryption algorithm generation strategy;
generating a key and a key identifier for each sub-file according to the key generation strategy;
encrypting each sub-file by using an encryption algorithm and a secret key corresponding to the sub-file;
constructing a block for each encrypted sub-file;
sorting all the blocks, and calculating a second hash value for all the sorted blocks;
and transmitting all the key identifications, all the algorithm identifications, the second hash value and all the blocks to a data receiving end.
2. The method of claim 1, wherein generating an encryption algorithm for each subfile based on the encryption algorithm generation policy comprises:
acquiring a preset encryption algorithm database, wherein the encryption algorithm database comprises a plurality of encryption algorithms and a plurality of algorithm identifications, and the encryption algorithms correspond to the algorithm identifications one by one;
randomly generating an algorithm identifier for each subfile in the plurality of algorithm identifiers using a random number generator;
and adopting the encryption algorithm corresponding to the algorithm identification in the encryption algorithm database as the encryption algorithm of the subfile.
3. The method of claim 2, wherein generating a key and key identification for each subfile according to the key generation policy comprises:
acquiring a preset secret key generation rule base, wherein the secret key generation rule base comprises a plurality of secret key generation rules and a plurality of secret key identifications, and the secret key generation rules are in one-to-one correspondence with the secret key identifications;
randomly generating key identifications, which are the same as the plurality of subfiles, in the plurality of key identifications by using a random number generator;
and generating a key by adopting a key generation rule corresponding to the key identification in the key generation rule base.
4. The method of claim 3, wherein the step of,
each key generation rule comprises N hash algorithms which are arranged in sequence, wherein N is an integer greater than 1;
the key generation rule base comprises a basic key;
the key generation rule generation key corresponding to the key identification in the key generation rule base comprises the following steps:
the following steps are performed for the ith hash algorithm, where 1 < i.ltoreq.N,
when i=1, calculating the basic key by adopting a current hash algorithm to obtain a 1 st hash value;
when i is more than 1 and less than N, calculating the i-1 hash value by adopting a current hash algorithm to obtain an i hash value;
when i=n, the key is obtained by calculating N-1 hash values using the current hash algorithm.
5. The method of claim 4, wherein the step of determining the position of the first electrode is performed,
constructing a block from each encrypted subfile includes:
the following steps are performed for each encrypted subfile:
calculating a first hash value for the encrypted subfile;
generating block header data according to the first hash value of the current encrypted sub-file and the first hash value of the last encrypted sub-file of the current encrypted sub-file, and splicing the block header data and the encrypted sub-file into a block.
6. The method of claim 5, wherein transmitting all the key identifications, all the algorithm identifications, the second hash values, and all the chunks to a data receiving end comprises:
ordering the key identifiers according to the same sequence as the block ordering to form a key identifier list;
sorting the algorithm identifications according to the same sequence as the block sorting to form an algorithm identification list;
and ordering the key identification list, the algorithm identification list, the second hash value and all the blocks according to a preset rule, and sending the ordered blocks to a data receiving end.
7. A bid file decryption method based on a block chain technology is characterized by being applied to a data receiving end and comprising the following steps:
receiving all key identifications, all algorithm identifications, second hash values and all blocks sent by a data sending end;
calculating a third hash value for all received blocks;
if the third hash value is the same as the second hash value, then
Ordering all the blocks;
generating a key for each block according to the key identification and the key generation strategy;
generating an encryption algorithm for each block according to the algorithm identification and the encryption algorithm generation strategy;
decrypting each block by using a secret key to obtain each subfile;
and splicing all the subfiles according to the bidding document splicing rules to obtain the bidding document to be decrypted.
8. The utility model provides a bid file encryption device based on blockchain technique which characterized in that is applied to the data transmitting end, includes:
the splitting module splits the bidding document to be encrypted into a plurality of subfiles according to preset bidding document splitting rules;
the first encryption algorithm generation module generates an encryption algorithm and an algorithm identifier for each sub-file according to an encryption algorithm generation strategy;
the first key generation module generates a key and a key identifier for each sub-file according to the key generation strategy;
the encryption module encrypts each sub-file by using an encryption algorithm and a secret key corresponding to the sub-file;
the block construction module constructs a block from each encrypted sub-file;
the second hash value calculation module sorts all the blocks and calculates a second hash value for all the sorted blocks;
and the sending module is used for sending all the key identifications, all the algorithm identifications, the second hash value and all the blocks to a data receiving end.
9. A bid document decryption device based on a blockchain technology, which is applied to a data receiving end, comprising:
the receiving module is used for receiving all key identifications, all algorithm identifications, second hash values and all blocks sent by the data sending end;
a third hash value calculation module for calculating a third hash value for all received blocks;
the sorting module is used for sorting the second hash value if the third hash value is the same as the second hash value
Ordering all the blocks;
the second key generation module generates a key for each block according to the key identification and the key generation strategy;
the second encryption algorithm generation module generates an encryption algorithm for each block according to the algorithm identification and the encryption algorithm generation strategy;
the decryption module decrypts each block by using the secret key to obtain each subfile;
and the splicing module splices all the subfiles according to the bidding document splicing rule to obtain the bidding document to be decrypted.
10. A bid document encryption and decryption system based on a blockchain technique, comprising: the bidding document encryption apparatus based on blockchain technique of claim 8 and the bidding document decryption apparatus based on blockchain technique of claim 9.
CN202311068741.9A 2023-08-24 2023-08-24 Bid file encryption and decryption method and system based on block chain technology Pending CN117077172A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311068741.9A CN117077172A (en) 2023-08-24 2023-08-24 Bid file encryption and decryption method and system based on block chain technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311068741.9A CN117077172A (en) 2023-08-24 2023-08-24 Bid file encryption and decryption method and system based on block chain technology

Publications (1)

Publication Number Publication Date
CN117077172A true CN117077172A (en) 2023-11-17

Family

ID=88714918

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311068741.9A Pending CN117077172A (en) 2023-08-24 2023-08-24 Bid file encryption and decryption method and system based on block chain technology

Country Status (1)

Country Link
CN (1) CN117077172A (en)

Similar Documents

Publication Publication Date Title
CN110391900B (en) Private key processing method based on SM2 algorithm, terminal and key center
Shankar et al. An efficient image encryption technique based on optimized key generation in ECC using genetic algorithm
CN111800257A (en) 3D model encryption transmission method and decryption method
CN109800588B (en) Dynamic bar code encryption method and device and dynamic bar code decryption method and device
US7894608B2 (en) Secure approach to send data from one system to another
US8422673B2 (en) Method and system for protecting against unity keys
CN109005184A (en) File encrypting method and device, storage medium, terminal
CN115203749A (en) Data transaction method and system based on block chain
US20190081790A1 (en) Authenticated broadcast encryption
JP5511803B2 (en) Techniques for performing symmetric cryptography
CN112948867A (en) Method and device for generating and decrypting encrypted message and electronic equipment
CN112398655B (en) File transmission method, server and computer storage medium
CN114374518B (en) PSI (program specific information) intersection information acquisition method and device with intersection counting function and storage medium
CN114143098B (en) Data storage method and data storage device
US20220345292A1 (en) Method and device for encryption of video stream, communication equipment, and storage medium
CN115408435A (en) Data query method and device
CN117077172A (en) Bid file encryption and decryption method and system based on block chain technology
CN116743461B (en) Commodity data encryption method and device based on time stamp
CN112713989B (en) Decryption method and device
CN116132159B (en) Data encryption method, device, electronic equipment and storage medium
CN117040913B (en) Cloud resource sharing data security transmission method and system
CN115361237B (en) Data encryption transmission method and system for cloud terminal interaction
CN115276961B (en) Data processing method and device based on OT protocol
CN117176351B (en) Data transmission processing method, system, computer equipment and storage medium
Karani et al. Secure File Storage Using Hybrid Cryptography

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