CN111221569B - Document updating method and server - Google Patents

Document updating method and server Download PDF

Info

Publication number
CN111221569B
CN111221569B CN202010014151.8A CN202010014151A CN111221569B CN 111221569 B CN111221569 B CN 111221569B CN 202010014151 A CN202010014151 A CN 202010014151A CN 111221569 B CN111221569 B CN 111221569B
Authority
CN
China
Prior art keywords
homomorphic
updated
subfiles
node server
split
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010014151.8A
Other languages
Chinese (zh)
Other versions
CN111221569A (en
Inventor
田新雪
肖征荣
马书惠
杨子文
董慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group 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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202010014151.8A priority Critical patent/CN111221569B/en
Publication of CN111221569A publication Critical patent/CN111221569A/en
Application granted granted Critical
Publication of CN111221569B publication Critical patent/CN111221569B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • 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/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2107File encryption
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a document updating method and a server, wherein the method comprises the following steps: generating homomorphic calculation functions and homomorphic parameters according to content information to be updated, wherein the content information to be updated is obtained by comparing an original document with the document to be updated; determining the identification of a sub-file to be updated according to the content information to be updated, wherein the sub-file to be updated is a file to be updated in the divided sub-file, and the divided sub-file is a file obtained by dividing an original document; generating an updated parameter according to a homomorphic calculation function, a parameter encryption result and an identifier and a number corresponding to a sub-file to be updated, wherein the parameter encryption result is obtained by homomorphic encryption of the homomorphic parameter by adopting a homomorphic encryption public key; and sending the update parameters to the blockchain network so that the storage node server updates the split subfiles stored by the storage node server according to the update parameters. The working efficiency is improved, and the waste of resources is avoided.

Description

Document updating method and server
Technical Field
The invention relates to the technical field of computer application, in particular to a document updating method and a server.
Background
A software document or source code document refers to text associated with a software system and its software engineering process. Types of software documents include software requirements documents, design documents, test documents, user manuals, and the like. The requirement document, the design document and the test document are generally written by a developer in the software development process, and the non-process documents such as a user manual and the like are written by special non-technical class writers. The software file can improve the efficiency of software development, ensure the quality of the software, guide and help developers to update the software in the use process of the software, and simultaneously, the corresponding software file needs to be synchronously updated in the process of software updating and testing.
Generally, in the process of updating a software document, the content of the software document needs to be encrypted to ensure the safety of the updated content; when the content of the encrypted software document is updated again, the whole content of the software document is required to be uploaded to the server again, and for the software document only needing to update part of chapters, the operation reduces the working efficiency and also causes the waste of resources.
Disclosure of Invention
Therefore, the invention provides a document updating method and a server, which are used for solving the problems of low working efficiency and resource waste caused by the fact that the whole content of the software document must be uploaded to the server again when the content of the encrypted software document is updated again in the prior art.
To achieve the above object, a first aspect of the present invention provides a document updating method, including: generating homomorphic calculation functions and homomorphic parameters according to content information to be updated, wherein the content information to be updated is obtained by comparing an original document with the document to be updated; determining the identification of a sub-file to be updated according to the content information to be updated, wherein the sub-file to be updated is a file to be updated in the divided sub-file, and the divided sub-file is a file obtained by dividing an original document; generating an updated parameter according to a homomorphic calculation function, a parameter encryption result and an identifier and a number corresponding to a sub-file to be updated, wherein the parameter encryption result is obtained by homomorphic encryption of the homomorphic parameter by adopting a homomorphic encryption public key; and sending the update parameters to the blockchain network so that the storage node server updates the split subfiles stored by the storage node server according to the update parameters.
In some embodiments, before the step of generating the homomorphic calculation function according to the content information to be updated, the method further comprises: dividing an original document to obtain N divided subfiles, and distributing corresponding identifiers and numbers for the divided subfiles, wherein N is an integer greater than or equal to 1; establishing mapping relations between N divided subfiles and all leaf nodes except a root node of a hash tree structure; and homomorphic encryption public keys are adopted to respectively encrypt the N split sub-files in the homomorphic mode, and the obtained N encrypted split sub-files are transmitted to a blockchain network so that a storage node server stores the split sub-files, wherein the homomorphic encryption public keys are keys generated according to a homomorphic key generation algorithm.
In some embodiments, after the step of sending the update parameter to the blockchain network to cause the storage node server to update the split subfile stored by the storage node server according to the update parameter, further comprising: obtaining a split sub-file stored by a storage node server, a number corresponding to the split sub-file and a value of a leaf node of a hash tree corresponding to the split sub-file from a blockchain network; sequentially adding the values of the leaf nodes according to the numbers, so as to obtain an addition result, wherein the numbers are continuous numbers; and homomorphic decryption is carried out on the addition result by using the homomorphic encryption private key, so that an updated document is obtained, wherein the homomorphic encryption private key is a secret key generated according to a homomorphic key generation algorithm.
In some embodiments, the value of the root node of the hash tree is a value obtained by adding values of all leaf nodes included in the hash tree, the value of a leaf node is a value obtained by homomorphic encrypting a split sub-file using a homomorphic encryption public key, and the value of a leaf node is a value obtained by sequentially adding values of all the cotyledon sub-nodes subordinate thereto in the order of numbers.
In some embodiments, the step of generating a homomorphic calculation function according to the content information to be updated includes: and generating homomorphic calculation functions and homomorphic parameters according to the content information to be updated, wherein the homomorphic calculation functions and homomorphic parameters meet the following rules: and calculating the split subfiles and the corresponding homomorphic parameters by using the homomorphic calculation function to obtain subfiles to be updated corresponding to the split subfiles.
In order to achieve the above object, a second aspect of the present invention provides a document updating method, the method comprising: the method comprises the steps that updating parameters sent by a user node server are obtained from a blockchain network, the updating parameters comprise homomorphic calculation functions and parameter encryption results, identifiers and numbers corresponding to subfiles to be updated, the parameter encryption results are obtained by homomorphic encryption of homomorphic parameters corresponding to subfiles to be updated by the user node server through homomorphic encryption public keys, the subfiles to be updated are files to be updated in segmentation subfiles, and the segmentation subfiles are files obtained by segmenting original documents; calculating the update parameters according to the homomorphic encryption calculation function to obtain a subfile to be updated; and updating the locally stored divided subfiles by using the subfiles to be updated according to the identification and the number.
In some embodiments, the step of calculating the update parameter according to the homomorphic encryption calculation function to obtain the subfile to be updated includes: calculating the update parameters according to the homomorphic encryption calculation function to obtain a calculation result; and sampling a homomorphic encryption private key, and homomorphic decrypting the calculation result to obtain the subfiles to be updated, wherein the homomorphic encryption private key is a secret key generated according to a homomorphic key generation algorithm.
In some embodiments, before the step of acquiring the update parameters sent by the user node server from the blockchain network, the method further includes: the method comprises the steps that N encrypted split subfiles sent by a user node server are obtained from a blockchain network, the encrypted split subfiles are files obtained by homomorphic encryption of the split subfiles by the user node server through homomorphic encryption public keys, mapping relations exist between the N split subfiles and all leaf nodes of a hash tree except a root node, and N is an integer larger than or equal to 1; homomorphic decryption is carried out on the N encrypted divided sub-files respectively, and N divided sub-files are correspondingly obtained; and selecting M split subfiles from the N split subfiles according to the capacity of a storage space, wherein the capacity of the storage space is larger than the file storage capacity, the file storage capacity is obtained by adding the file sizes of the M split subfiles, M is an integer larger than or equal to 1, and M is smaller than or equal to N.
To achieve the above object, a third aspect of the present invention provides a user node server, comprising: the function generation module is used for generating homomorphic calculation functions and homomorphic parameters according to the content information to be updated, wherein the content information to be updated is obtained by comparing an original document with the document to be updated; the determining module is used for determining the identification of the subfiles to be updated according to the content information to be updated, wherein the subfiles to be updated are files to be updated in the segmentation subfiles, and the segmentation subfiles are files obtained by segmenting the original document; the updating parameter generation module is used for generating updating parameters according to homomorphic calculation functions, parameter encryption results and identifiers and numbers corresponding to subfiles to be updated, wherein the parameter encryption results are obtained by homomorphic encryption of homomorphic parameters by adopting homomorphic encryption public keys;
and the sending module is used for sending the update parameters to the blockchain network so that the storage node server updates the split subfiles stored by the storage node server according to the update parameters.
In order to achieve the above object, a fourth aspect of the present invention provides a storage node server, comprising: the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring update parameters sent by a user node server from a blockchain network, the update parameters comprise homomorphic calculation functions and parameter encryption results, identifiers and numbers corresponding to subfiles to be updated, the parameter encryption results are obtained by homomorphic encryption of homomorphic parameters corresponding to the subfiles to be updated by the user node server through homomorphic encryption public keys, the subfiles to be updated are files to be updated in segmentation subfiles, and the segmentation subfiles are files obtained by segmenting original documents; the computing module is used for computing the update parameters according to the homomorphic encryption computing function to obtain a sub-file to be updated; and the updating module is used for updating the locally stored divided subfiles by using the subfiles to be updated according to the identification and the number.
The invention has the following advantages: the method comprises the steps of obtaining content information to be updated by comparing an original document with the document to be updated, generating homomorphic calculation functions and homomorphic parameters according to the content information to be updated, determining the identification of a subfile to be updated according to the content information to be updated, sending a parameter encryption result obtained by homomorphic encryption of the homomorphic calculation functions and homomorphic parameters by homomorphic encryption public keys, the identification of the subfile to be updated and corresponding numbers to a blockchain network as update parameters, enabling a storage node server to receive the update parameters, updating the corresponding divided subfiles according to the update parameters, and updating the original document only by updating the subfiles to be updated stored by the storage node server.
Drawings
The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification, illustrate the invention and together with the description serve to explain, without limitation, the invention.
Fig. 1 is a flowchart of a document updating method according to a first embodiment of the present invention.
Fig. 2 is a flowchart of a document updating method according to a second embodiment of the present invention.
FIG. 3 is a flowchart of a method for updating a document according to a third embodiment of the present invention.
FIG. 4 is a flowchart of a method for updating a document based on a blockchain technique according to a fourth embodiment of the present invention.
Fig. 5 is a flowchart of a document updating method using a Markle hash tree according to a fifth embodiment of the present invention.
Fig. 6 is a branching structure diagram of a Markle hash tree according to a fifth embodiment of the present invention.
Fig. 7 is a block diagram showing a configuration of a user node server according to a sixth embodiment of the present invention.
Fig. 8 is a block diagram showing a storage node server according to a seventh embodiment of the present invention.
In the drawings:
4010: the user node server 4020: storage node server
4021: storage node server a 4022: storage node server B
701: the generating module 702: determination module
703: the sending module 801: acquisition module
802: calculation module 803: update module
Detailed Description
The following describes specific embodiments of the present invention in detail with reference to the drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the invention, are not intended to limit the invention.
The first embodiment of the present invention relates to a document updating method. The method is used for improving the efficiency of document updating and avoiding the waste of resources.
The following details of the implementation of the document updating method in this embodiment are described specifically, and the following is only for facilitating understanding of the implementation details of this embodiment, and is not necessary for implementing this embodiment.
Fig. 1 is a flowchart of a document updating method in this embodiment, which can be used for a user node server. The method may include the following steps.
In step 101, homomorphic calculation functions and homomorphic parameters are generated according to the content information to be updated.
The content information to be updated is information obtained by comparing the original document with the document to be updated.
For example, when the original document c needs to be updated to the document c+ to be updated, comparing the original document c with the document c+ to be updated, and knowing that the information of the content to be updated includes the contents of the first chapter and the fourth chapter of the original document c, the homomorphism calculation function f and the homomorphism parameter ca are generated according to the contents of the first chapter and the fourth chapter. In specific implementation, the homomorphic calculation function f and the homomorphic parameter ca satisfy the following relationship: f (c, ca) =c+. That is, the homomorphism calculation function f is used to calculate the original document c and the corresponding homomorphism parameter ca, so that the document c+ to be updated corresponding to the original document c can be obtained.
In step 102, the identity of the subfile to be updated is determined according to the content information to be updated.
The sub-files to be updated are files to be updated in the divided sub-files, and the divided sub-files are files obtained by dividing the original document. For example, the original document a is divided into 5 copies, and 5 divided subfiles can be obtained: a1, A2, A3, A4 and A5. If it is determined that the divided sub-file A2 and the divided sub-file A3 need to be updated according to the content information to be updated, the sub-files to be updated are the divided sub-file A2 and the divided sub-file A3, and the identifiers of the corresponding sub-files to be updated are the A2 and the A3.
In step 103, update parameters are generated according to the homomorphic calculation function, the parameter encryption result, and the identification and number corresponding to the sub-file to be updated.
It should be noted that, the parameter encryption result is a result obtained by homomorphic encrypting the homomorphic parameter by using a homomorphic encryption public key, where the homomorphic encryption public key is a key generated according to a homomorphic key generation algorithm.
In step 104, update parameters are sent to the blockchain network.
When the storage node server in the blockchain network acquires the updating parameters sent by the user node server through the blockchain network, the split subfiles stored by the storage node server are updated according to the updating parameters. The split subfiles stored on the storage node server are the latest subfiles, so that the latest subfiles can be conveniently acquired by the subsequent user nodes.
In some embodiments, homomorphic calculation functions and homomorphic parameters are generated according to the content information to be updated, and the homomorphic calculation functions and homomorphic parameters meet the following rules: and calculating the split subfiles and the corresponding homomorphic parameters by using the homomorphic calculation function to obtain subfiles to be updated corresponding to the split subfiles.
For example, if the homomorphism parameter corresponding to the split sub-file A1 is ca1 and the homomorphism parameter corresponding to the split sub-file A2 is ca2, the homomorphism parameter corresponding to the split sub-file A1 is ca1 by using the homomorphism calculation function f, so as to obtain the sub-file a1+ to be updated, namely, the following relationship is satisfied: f (A1, ca 1) =a1+; similarly, the homomorphism parameter corresponding to the split subfile A2 by using the homomorphism calculation function f is ca2, and the following relationship needs to be satisfied to obtain the subfile a2+ to be updated: f (A2, ca 2) =a2+.
In this embodiment, the content information to be updated is obtained by comparing the original document with the document to be updated, so that a homomorphic calculation function and homomorphic parameters can be generated according to the content information to be updated, then the identity of the subfiles to be updated is determined according to the content information to be updated, the homomorphic calculation function, the parameter encryption result obtained by homomorphic encrypting the homomorphic parameters by adopting the homomorphic encryption public key, the identity of the subfiles to be updated and the corresponding number are sent to the blockchain network as update parameters, so that the storage node server can receive the update parameters, update the corresponding split subfiles according to the update parameters, the update of the original document only by updating the subfiles to be updated stored by the storage node server is avoided, the work efficiency is improved, and the waste of resources is avoided.
A second embodiment of the present invention relates to a document updating method. The second embodiment is substantially the same as the first embodiment, and differs mainly in that: and establishing a Markle hash tree to form a mapping relation with each divided sub-document, so as to improve the updating efficiency of the updated document.
Fig. 2 is a flowchart of a method for updating files in the present embodiment, which can be used for the user node server. The method may include the following steps.
In step 201, an original document is segmented to obtain N segmented subfiles, and corresponding identifiers and numbers are assigned to the segmented subfiles.
Wherein N is an integer greater than or equal to 1. For example, the original document C is divided into n divided subfiles, and the identification and the division number of each divided subfile are obtained correspondingly: c1, C2, C3, … …, cn, and c=c1+c2+c3+ … +cn.
In step 202, a mapping relationship between the N split subfiles and all leaf nodes of the hash tree structure except the root node is established.
It should be noted that, the mapping relationship includes: the value of the root node of the hash tree is a value obtained by adding the values of all leaf nodes included in the hash tree, the value of the leaf node is a value obtained by homomorphic encrypting a split file using a homomorphic encryption public key, and the value of the leaf node is a value obtained by sequentially adding the values of all cotyledon child nodes subordinate thereto in the order of numbers.
For example, the original document C is divided into n divided subfiles, and an identification and a division number of each divided subfile are obtained correspondingly: c1, C2, C3, … …, cn, and c=c1+c2+c3+ … +cn. In the Markle hash tree, the value of each leaf node of the Markle hash tree is a value obtained by homomorphically encrypting the corresponding split sub-file using the homomorphic encryption public key, for example, each leaf node is respectively and correspondingly recorded with Enc (C1), enc (C2), enc (C3) … Enc (Cn), wherein Enc (C1) represents a value obtained by homomorphically encrypting the split sub-file C1 using the homomorphic encryption public key by the user node server 4010, enc (C2) represents a value obtained by homomorphically encrypting the split sub-file C2 using the homomorphic encryption public key by the user node server 4010, enc (C3) represents a value obtained by homomorphically encrypting the split sub-file C3 using the homomorphic encryption public key by the user node server 4010, … …, enc (Cn) represents a value obtained by homomorphically encrypting the split sub-file Cn using the homomorphism encryption public key by the user node server 4010. The root node value of the Markle hash tree is obtained by adding values of all leaf nodes included in the Markle hash tree (that is, enc (C1), enc (C2), enc (C3) … Enc (Cn)), and the value of any one leaf node is obtained by sequentially adding values of all cotyledon child nodes subordinate thereto in the division number order.
In step 203, homomorphic encryption public keys are used to encrypt the N split subfiles in homomorphic mode, and the obtained N encrypted split subfiles are transmitted to the blockchain network.
When the N encrypted split subfiles sent by the user node server are obtained from the blockchain network by the storage node server connected with the blockchain network, one or more split subfiles are selected for storage according to the local storage space of the user node server.
For example, when N is equal to 7, i.e., the user node server splits the original document C into 7 different split subfiles, B1, B2, B3, B4, B5, B6, and B7, respectively: the first storage node server may select split subfiles B1, B2, and B3 for storage; the second storage node server may choose to split subfiles B4, B5, B6, and B7 for storage.
In step 204, homomorphic calculation functions and homomorphic parameters are generated according to the content information to be updated.
In step 205, the identity of the subfile to be updated is determined according to the content information to be updated.
In step 206, update parameters are generated according to the homomorphic calculation function, the parameter encryption result, and the identification and number corresponding to the sub-file to be updated.
In step 207, update parameters are sent to the blockchain network.
Note that, steps 204 to 207 in this embodiment are the same as steps 101 to 104 in the first embodiment, and are not described here again.
In one specific implementation, after step 207, the method may further include: obtaining a split sub-file stored by a storage node server, a number corresponding to the split sub-file and a value of a leaf node of a hash tree corresponding to the split sub-file from a blockchain network; sequentially adding the values of the leaf nodes according to the numbers, so as to obtain an addition result, wherein the numbers are continuous numbers; and homomorphic decryption is carried out on the addition result by using the homomorphic encryption private key, so that an updated document is obtained, wherein the homomorphic encryption private key is a secret key generated according to a homomorphic key generation algorithm.
When the user node server finishes updating one or more documents and hopes to acquire the latest document, the number corresponding to the latest segmented sub-file and the value of the leaf node of the hash tree corresponding to the segmented sub-file stored by each storage node server are downloaded from each storage node server in the blockchain network according to the mapping relation between the segmented sub-file and the hash tree; and adding all the serial numbers once to obtain the value of the root node of the hash tree, wherein the value of the root node corresponds to the latest document, and the latest document can be obtained by processing the value of the root node, for example, homomorphic decrypting the value of the root node by using a homomorphic encryption private key.
When the updated document is specifically acquired, only the most updated chapters of the original document or the corresponding chapters required by the user can be acquired. For example, if chapter 1 and chapter 8 of the original document need to be updated, the split subfiles corresponding to chapter 1 are C3, C4, and C5, and the split subfiles corresponding to chapter 8 are C26 and C27, then the user node server 4010 needs to process the two chapters separately, each chapter forms an independent small mark hash tree, the root node values of the two mark hash trees are Enc (c3+) +enc (c4+) +enc (c5+) and Enc (c26+) +enc (c27+), respectively, and then the user node server 4010 uses its homomorphic encryption private key to calculate to obtain Dec (Enc (c3+) +enc (c4+) +enc (c5+)), so as to obtain the latest document of chapter 1. Similarly, the user node server 4010 calculates using its own homomorphic encryption private key to obtain Dec (Enc (c26+) + Enc (c27+)), and then obtains the latest document of chapter 8.
In the embodiment, the mapping relation is established between the split subfiles and all leaf nodes except the root node in the hash tree according to the structure of the hash tree, so that the user node server can more quickly find the subfiles to be updated according to the hash tree, the document updating speed is increased, the working efficiency is improved, and the waste of resources is avoided. The method and the device enable the user to be more rapid and convenient when acquiring the latest document, and improve the user experience.
A third embodiment of the present invention relates to a document updating method. Fig. 3 is a flowchart of a file updating method in the present embodiment, which can be used for the storage node server. The method may include the following steps.
In step 301, update parameters sent by a user node server are obtained from a blockchain network.
The updating parameters comprise homomorphic calculation functions and parameter encryption results, wherein the identifiers and numbers corresponding to the subfiles to be updated are obtained by homomorphic encryption of homomorphic parameters corresponding to the subfiles to be updated by a user node server through homomorphic encryption public keys, the subfiles to be updated are files to be updated in the segmentation subfiles, and the segmentation subfiles are files obtained by segmenting original documents.
In step 302, the update parameters are calculated according to the homomorphic encryption calculation function, and the subfiles to be updated are obtained.
In some embodiments, the update parameters are calculated according to the homomorphic encryption calculation function, and a calculation result is obtained; and sampling a homomorphic encryption private key, and homomorphic decrypting the calculation result to obtain the subfiles to be updated, wherein the homomorphic encryption private key is a secret key generated according to a homomorphic key generation algorithm.
It should be noted that, the homomorphic encryption private key used by the storage node server corresponds to the homomorphic encryption public key used by the user node server, and only the corresponding storage node server can acquire the update parameters sent by the user node server, so as to obtain the sub-file to be updated, thereby improving the security of the file information in the transmission process.
In step 303, the locally stored split subfiles are updated with subfiles to be updated according to the identification and number.
It should be noted that, each storage node server only obtains the sub-file to be updated consistent with the identification and the number of the locally stored divided sub-file, so that the sub-file to be updated can be updated on the storage node server, and the user node server can conveniently and quickly obtain the latest divided sub-file. For example, according to the identification and the division number of the division sub-file C3, the storage node server searches the locally stored division sub-file to obtain the division sub-file consistent with the identification and the division number, and updates the locally stored division sub-file C3 of the storage node server to be the sub-file c3+ to be updated.
In this embodiment, the storage node server obtains the update parameters sent by the user node server from the blockchain network, calculates the update parameters by using the homomorphic encryption calculation function to obtain the sub-file to be updated, searches the locally stored divided sub-file according to the identifier and the number corresponding to the sub-file to be updated, and updates the locally stored divided sub-file by using the sub-file to be updated, so that the stored divided sub-file is ensured to be the latest, the user node server can quickly obtain the latest document when updating the document, the working efficiency is improved, and the user experience is improved.
In some embodiments, before step 301, the following steps may be further included:
in step 3011, N encrypted split subfiles sent by the user node server are obtained from the blockchain network.
The encrypted split sub-files are files obtained by homomorphic encryption of the split sub-files by a user node server through homomorphic encryption public keys, mapping relations exist between N split sub-files and all leaf nodes of the hash tree except the root node, and N is an integer greater than or equal to 1;
in step 3012, homomorphic decryption is performed on the N encrypted split subfiles, so as to obtain N split subfiles correspondingly.
In step 3013, M split subfiles are selected from the N split subfiles according to the capacity of the storage space and stored locally,
the capacity of the storage space is larger than the file storage capacity, the file storage capacity is obtained by adding the file sizes of M divided subfiles, M is an integer greater than or equal to 1, and M is less than or equal to N. For example, when the storage space of a storage node server is 30M, and the storage node server acquires a plurality of split subfiles from the blockchain network, it is possible to acquire split subfiles of the sizes of 5M split subfiles C1, 15M split subfiles C2, 10M split subfiles C3, 20M split subfiles C4, etc., but the storage node server can only store a file of 30M at most, and therefore, the storage node server selects the split subfiles C1, C2, and C3 for storage, and discards other split subfiles such as the split subfiles C4.
In this embodiment, N encrypted split sub-files are decrypted homomorphically, so that N split sub-files are obtained correspondingly, and then, according to the capacity of the storage space of the storage node server, an appropriate split sub-file is selected for storage, so that the integrity of the split sub-file is ensured, the user node server can obtain the corresponding split sub-file flexibly, the speed of updating the document is improved, and the working efficiency is improved.
A fourth embodiment of the present invention relates to a document updating method. FIG. 4 is a flowchart of a method for updating a document based on a blockchain technique in this embodiment. When the size of the document does not exceed the preset threshold, the document is not segmented, i.e., the number of segmented subfiles is 1. Specifically, a document update system is constituted by the user node server 4010 and the storage node server 4020, and communicates through a blockchain network. The document update steps are as follows.
In step 401, the user node server 4010 generates a homomorphic encryption public key and a homomorphic encryption private key according to a homomorphic key generation algorithm. For example, assume that the document is c. After the user node server 4010 prepares the document c, homomorphic encryption is performed on the document c to obtain a homomorphic encryption result Enc (c) of the document c.
In step 402, the user node server 4010 signs Enc (c) using its own blockchain private key and broadcasts the signed Enc (c) into the blockchain network.
In step 403, when the user node server 4010 needs to update the document c to the document c+, the document c+ and the document c+ are compared to obtain content information to be updated, and then a homomorphic calculation function f and a homomorphic parameter ca are generated according to the content information to be updated, where the generated homomorphic calculation function f and homomorphic parameter ca satisfy the following relationship: f (c, ca) =c+. Namely, the homomorphism calculation function f is used for calculating the original document c and the corresponding homomorphism parameter ca, so that an updated document c+ can be obtained.
In step 404, the user node server 4010 generates an update parameter based on the identification of the document c, the homomorphic calculation function f, and the homomorphic encryption result Enc (ca). The update parameters are then signed using the blockchain private key of the user node server 4010 and the signed update parameters are sent to the blockchain network.
The homomorphic encryption result Enc (ca) is obtained by the user node server 4010 homomorphic encrypting the homomorphic parameter ca.
In step 405, after receiving the signed update parameter sent in step 404, the storage node server 4020 stores the document c, verifies the private key of the signature, and after the verification is passed, the storage node server 4020 processes the update parameter by using the homomorphic encryption calculation function to obtain and store the calculation result to the local, that is, stores the document c++ to the local.
Wherein, the homomorphic encryption calculation function may be expressed as c++ =evaluation (f, enc (c), enc (ca), where f represents the homomorphic calculation function, enc (c) represents a result obtained by homomorphic encrypting the document c, enc (ca) represents a result obtained by homomorphic encrypting the homomorphic parameter ca, ca represents the homomorphic parameter, and c++ represents the updated document stored on the storage node server 4020.
In step 406, when the user node server 4010 wants to obtain the updated document from the blockchain network, the document c++ can be downloaded from the storage node server 4020 to the user node server 4010, and then the document c++ is calculated by using the homomorphic decryption algorithm function to obtain Dec (c++), and due to the homomorphic encryption characteristic, c++ should be equal to Enc (c+), and Dec (c++) should be equal to c+); the updated document c+ can be obtained.
In this embodiment, the content information to be updated is obtained by comparing the original document with the document to be updated, so that a homomorphic calculation function and homomorphic parameters can be generated according to the content information to be updated, then the identity of the subfiles to be updated is determined according to the content information to be updated, the homomorphic calculation function, the parameter encryption result obtained by homomorphic encrypting the homomorphic parameters by adopting the homomorphic encryption public key, the identity of the subfiles to be updated and the corresponding number are sent to the blockchain network as update parameters, so that the storage node server can receive the update parameters, update the corresponding split subfiles according to the update parameters, the update of the original document only by updating the subfiles to be updated stored by the storage node server is avoided, the work efficiency is improved, and the waste of resources is avoided.
A fifth embodiment of the present invention relates to a document updating method. FIG. 5 is a flow chart of a method for updating a document using a Markle hash tree. When the size of the document exceeds a preset threshold, the document is segmented to obtain N segmented subfiles, a mapping relation between a Markle hash tree and the N segmented subfiles is established, and the document updating efficiency is improved. Specifically, a document updating system is constituted by a plurality of storage node servers such as the user node server 4010, the storage node server a4021, and the storage node server B4022, and the document updating system communicates through a blockchain network. The document update steps are as follows.
In step 501, the user node server 4010 generates a homomorphic encryption public key and a homomorphic encryption private key according to a homomorphic key generation algorithm, for example, assuming that the document is C, the user node server 4010 fragments the document C through a Markle hash tree to obtain N split subfiles.
For example, fig. 6 is a branching structure diagram of a Markle hash tree, in which a document C is divided into n divided subfiles, and an identification and a division number of each divided subfile are obtained correspondingly: c1, C2, C3, … …, cn, and c=c1+c2+c3+ … +cn. In the Markle hash tree, the value of each leaf node of the Markle hash tree is a value obtained by homomorphically encrypting the corresponding split sub-file using the homomorphic encryption public key, for example, each leaf node is respectively and correspondingly recorded with Enc (C1), enc (C2), enc (C3) … Enc (Cn), wherein Enc (C1) represents a value obtained by homomorphically encrypting the split sub-file C1 using the homomorphic encryption public key by the user node server 4010, enc (C2) represents a value obtained by homomorphically encrypting the split sub-file C2 using the homomorphic encryption public key by the user node server 4010, enc (C3) represents a value obtained by homomorphically encrypting the split sub-file C3 using the homomorphic encryption public key by the user node server 4010, … …, enc (Cn) represents a value obtained by homomorphically encrypting the split sub-file Cn using the homomorphism encryption public key by the user node server 4010. The root node value of the Markle hash tree is obtained by adding values of all leaf nodes included in the Markle hash tree (that is, enc (C1), enc (C2), enc (C3) … Enc (Cn)), and the value of any one leaf node is obtained by sequentially adding values of all cotyledon child nodes subordinate thereto in the division number order.
In step 502, the user node server 4010 signs Enc (C1), enc (C2), enc (C3) … Enc (Cn) using its own blockchain private key, respectively, and obtains and transmits the signed Enc (C1), signed Enc (C2), signed Enc (C3), … … signed Enc (Cn) into the blockchain network.
In step 503, the storage node server a4021 and the storage node server B4022 respectively receive the split subfiles C1, C2, C3, … …, cn signed and homomorphically encrypted in step 502, and then verify private key signatures of the signed Enc (C1), the signed Enc (C2), the signed Enc (C3), and the … … signed Enc (Cn), and if the verification is passed, select one or more split subfiles according to the local storage space of the split subfiles for storage.
For example, n is equal to 7, and the storage node server a4021 selects the split subfiles C1, C2, C3 to store; the storage node server B4022 selects the split subfiles C4, C5, C6, and C7 to store.
In step 504, when the user node server 4010 needs to update the document C to the document c+, the document c+ is compared with the split subfiles C1, C2, C3, … …, cn in step 501, and it is known that the updated portion only relates to the split subfiles C3 and C6, and only needs to update the split subfile C3 to the subfile c3+ to be updated and update the split subfile C6 to the subfile c6+ to be updated. The user node server 4010 generates a homomorphic calculation function f and a homomorphic parameter ca according to the difference between the split subfile C3 and the subfile c3+ to be updated and the difference between the split subfile C6 and the subfile c6+ to be updated, and the homomorphic calculation function f and the homomorphic parameter ca satisfy the following relationship: f (C3, ca 3) =c3+; f (C6, ca 6) =c6+.
In step 505, the user node server 4010 performs homomorphic encryption on the homomorphic parameter ca3 and the homomorphic parameter ca6 respectively to obtain homomorphic encryption results Enc (ca 3) and Enc (ca 6), generates a first update parameter according to the homomorphic calculation functions f, enc (ca 3) and the identification and the division number of the document division sub-file C3, signs the first update parameter by using the blockchain private key of the user node server 4010, and sends the signed first update parameter to the blockchain network; meanwhile, a second update parameter is generated according to homomorphism calculation functions f and Enc (ca 6), the identification of the split subfile C6 and the split number of the split subfile, then the second update parameter is signed by using the private key of the blockchain of the user node server 4010, and the signed second update parameter is sent to the blockchain network. So that the storage node server storing the split subfile C3 and the split subfile C6 can acquire the first update parameter and the second update parameter, respectively.
In step 506, the storage node server a4021 obtains the first update parameter signed by the private key of the user node server 4010 from the blockchain network, and first verifies the private key signature of the first update parameter. When verification passes, obtaining first updated parameters, namely homomorphic calculation functions f and Enc (ca 3), and identification and division number of a division sub-file C3; then, a homomorphic encryption computing function C3++ = evaluation (f, enc (C3) is operated, the Enc (ca 3) is computed to obtain a to-be-updated subfile C3++, then, a homomorphic decryption algorithm function is used to compute the to-be-updated subfile C3++ to obtain Dec (C3++), and due to the characteristic of homomorphic encryption, the C3++ is equal to the Enc (C3+), the Dec (C3++) is equal to the C3+), the updated to-be-updated subfile C3+ can be obtained, and the locally stored split subfile C3 is updated to the to-be-updated subfile C3+ according to the identification and the splitting number of the split subfile C3.
Meanwhile, the storage node server B4022 obtains the second update parameter after the private key signature of the user node server 4010 from the blockchain network, and first verifies the private key signature of the second update parameter. When the verification is passed, obtaining second updated parameters, namely identification and division numbers of homomorphic calculation functions f and Enc (ca 6) and a division sub-file C6; then, a homomorphic encryption computing function C6++ = evaluation (f, enc (C6) is operated, the Enc (ca 6) is computed to obtain a to-be-updated subfile C6++, then, a homomorphic decryption algorithm function is used to compute the to-be-updated subfile C6++ to obtain Dec (C6++), and due to the characteristic of homomorphic encryption, the C6++ is equal to the Enc (C6+), the Dec (C6++) is equal to the C6+), the updated to-be-updated subfile C6+ can be obtained, and the locally stored split subfile C6 is updated to the to-be-updated subfile C6+ according to the identification and the splitting number of the split subfile C6.
In step 507, when the user node server 4010 wants to obtain updated documents from the blockchain network, the user node server 4010 may obtain homomorphically encrypted stored values of all the split subfiles from different storage node servers. Then, arranging the stored values according to the rule of leaf nodes of the Markle hash tree, and sequentially adding the stored values to obtain the value of the root node of the whole Markle hash tree; the user node server 4010 uses its own homomorphic encryption private key to homomorphic decrypt the value of the root node, and obtains the latest document.
Similarly, if the user node server 4010 only needs to update several chapters of the original document (for example, the first 100 pages of the original document, or update the third chapter and the sixth chapter, etc.), then only needs to download the document part to be updated from each storage node server in the blockchain network according to the identification and the division number of the divided subfiles, and then combines the subfiles to be updated according to the combination mode of the Markle tree, so as to obtain the document chapter to be updated.
For example, the third chapter of the updated document is stored on the storage node server a4021, that is, the divided subfile c3+; the sixth chapter of the updated document is stored on the storage node server B4022, that is, the divided subfile c6+; the user node server 4010 only needs to download the split subfile c3+ from the storage node server a 4021; the split subfile c6+ is downloaded from the storage node server B4022. And then according to the identification and the division number of the division sub-file, correspondingly updating the chapter of the original document.
It should be noted that if the division number is not a continuous number, the homomorphic encryption results of the respective divided subfiles cannot be directly added and need to be processed separately. For example, if chapter 1 and chapter 12 of the original document need to be updated, the split subfiles corresponding to chapter 1 are C3, C4, and C5, and the split subfiles corresponding to chapter 12 are C26 and C27, then the user node server 4010 needs to process the two chapters separately, each chapter forms an independent small Markle hash tree, the root node values of the two Markle hash trees are Enc (c3+) +enc (c4+) +enc (c5+) and Enc (c26+) +enc (c27+), respectively, and then the user node server 4010 uses its own homomorphic encryption private key to calculate, so as to obtain DeC (Enc (c3+) +enc (c4+) +enc (c5+)), and obtain the latest document of chapter 1. Similarly, the user node server 4010 calculates using its own homomorphic encryption private key to obtain Dec (Enc (c26+) + Enc (c27+)), and then obtains the latest document of chapter 12.
In this embodiment, according to the structure of the hash tree, a mapping relationship is established between the split subfiles and all leaf nodes except the root node in the hash tree, so that the user node server can more quickly find the subfiles to be updated according to the hash tree, thereby accelerating the document updating speed, improving the working efficiency and avoiding the waste of resources. The method and the device enable the user to be more rapid and convenient when acquiring the latest document, and improve the user experience.
The above steps of the methods are divided, for clarity of description, and may be combined into one step or split into multiple steps when implemented, so long as they include the same logic relationship, and they are all within the protection scope of this patent; it is within the scope of this patent to add insignificant modifications to the algorithm or flow or introduce insignificant designs, but not to alter the core design of its algorithm and flow.
A sixth embodiment of the present invention relates to a user node server, and the specific implementation of the server may refer to the description related to the first embodiment, and the repetition is not repeated. It should be noted that, the specific implementation of the server in this embodiment may also refer to the related description of the second embodiment, and may also refer to the related description of the fourth embodiment, but the embodiment is not limited to the above three embodiments, and other non-illustrated embodiments are also within the protection scope of the server.
As shown in fig. 7, the user node server mainly includes: the function generating module 701 is configured to generate homomorphic calculation functions and homomorphic parameters according to content information to be updated, where the content information to be updated is information obtained by comparing an original document with the document to be updated; the determining module 702 is configured to determine, according to the content information to be updated, an identifier of a sub-file to be updated, where the sub-file to be updated is a file to be updated in a split sub-file, and the split sub-file is a file obtained by splitting an original document; the update parameter generation module 703 is configured to generate an update parameter according to a homomorphic calculation function, a parameter encryption result, and an identifier and a number corresponding to a sub-file to be updated, where the parameter encryption result is a result obtained by homomorphic encrypting the homomorphic parameter with a homomorphic encryption public key; the sending module 704 is configured to send the update parameter to the blockchain network, so that the storage node server updates the split subfiles stored by the storage node server according to the update parameter.
A seventh embodiment of the present invention relates to a storage node server, and the specific implementation of the server may refer to the description related to the third embodiment, and the repetition is not repeated. It should be noted that, the specific implementation of the server in the present embodiment may also be referred to the related description in the fourth embodiment, but the embodiment is not limited to the above two embodiments, and other non-illustrated embodiments are also within the scope of protection of the server.
As shown in fig. 8, the storage node server mainly includes: the obtaining module 801 is configured to obtain, from the blockchain network, an update parameter sent by a user node server, where the update parameter includes a homomorphic calculation function, a parameter encryption result, and an identifier and a number corresponding to a sub-file to be updated, where the parameter encryption result is a result obtained by homomorphic encryption of the sub-file to be updated by the user node server with a homomorphic encryption public key, the sub-file to be updated is a file to be updated in a split sub-file, and the split sub-file is a file obtained by splitting an original document; the calculation module 802 is configured to calculate a parameter encryption result according to a homomorphic calculation function, so as to obtain a subfile to be updated; the updating module 803 is configured to update the locally stored split subfile with the subfile to be updated according to the identification and the number.
It should be noted that each module in this embodiment is a logic module, and in practical application, one logic unit may be one physical unit, or may be a part of one physical unit, or may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, units that are not so close to solving the technical problem presented by the present invention are not introduced in the present embodiment, but this does not indicate that other units are not present in the present embodiment.
It is to be understood that the above embodiments are merely illustrative of the application of the principles of the present invention, but not in limitation thereof. Various modifications and improvements may be made by those skilled in the art without departing from the spirit and substance of the invention, and are also considered to be within the scope of the invention.

Claims (9)

1. A method of document updating, the method comprising:
generating homomorphic calculation functions and homomorphic parameters according to content information to be updated, wherein the content information to be updated is obtained by comparing an original document with the document to be updated;
determining the identification of a sub-file to be updated according to the content information to be updated, wherein the sub-file to be updated is a file to be updated in a divided sub-file, and the divided sub-file is a file obtained by dividing an original document;
generating an update parameter according to the homomorphic calculation function, a parameter encryption result and the identifier and the number corresponding to the sub-file to be updated, wherein the parameter encryption result is obtained by homomorphic encryption of the homomorphic parameter by adopting a homomorphic encryption public key;
transmitting the update parameters to a blockchain network so that a storage node server updates the split subfiles stored by the storage node server according to the update parameters;
Before the step of generating the homomorphic calculation function according to the content information to be updated, the method further comprises the following steps:
dividing the original document to obtain N divided subfiles, and distributing corresponding identifiers and numbers for the divided subfiles, wherein N is an integer greater than or equal to 1;
establishing mapping relations between the N divided subfiles and all leaf nodes except a root node of the hash tree structure;
and carrying out homomorphic encryption on the N split sub-files respectively by adopting homomorphic encryption public keys, and transmitting the obtained N encrypted split sub-files to a blockchain network so as to enable a storage node server to store the split sub-files, wherein the homomorphic encryption public keys are secret keys generated according to a homomorphic key generation algorithm.
2. The method of claim 1, further comprising, after the step of sending update parameters to a blockchain network to cause a storage node server to update split subfiles stored by the storage node server according to the update parameters:
obtaining the split sub-file, the number corresponding to the split sub-file and the value of the leaf node of the hash tree corresponding to the split sub-file stored by a storage node server from a blockchain network;
Sequentially adding the values of the leaf nodes according to the numbers, and obtaining an addition result, wherein the numbers are continuous numbers;
and homomorphic decryption is carried out on the addition result by using a homomorphic encryption private key, so that an updated document is obtained, wherein the homomorphic encryption private key is a secret key generated according to a homomorphic key generation algorithm.
3. The method according to claim 2, wherein the value of the root node of the hash tree is a value obtained by adding values of all leaf nodes included in the hash tree, the value of the leaf node is a value obtained by homomorphic encrypting the split subfile using a homomorphic encryption public key, and the value of the leaf node is a value obtained by sequentially adding values of all cotyledon child nodes subordinate thereto in the order of numbers.
4. The method of claim 1, wherein the step of generating a homomorphic calculation function from the content information to be updated comprises:
generating homomorphic calculation functions and homomorphic parameters according to the content information to be updated, wherein the homomorphic calculation functions and the homomorphic parameters meet the following rules:
and calculating the split subfiles and the corresponding homomorphic parameters by using the homomorphic calculation function to obtain subfiles to be updated corresponding to the split subfiles.
5. A method of document updating, the method comprising:
the method comprises the steps that updating parameters sent by a user node server are obtained from a blockchain network, the updating parameters comprise homomorphic calculation functions and parameter encryption results, identifiers and numbers corresponding to subfiles to be updated, the parameter encryption results are obtained by homomorphic encryption of homomorphic parameters corresponding to subfiles to be updated by the user node server through homomorphic encryption public keys, the subfiles to be updated are files to be updated in segmentation subfiles, and the segmentation subfiles are files obtained by segmenting original documents;
calculating the update parameters according to homomorphic encryption calculation functions to obtain the subfiles to be updated;
updating the locally stored divided subfiles by using the subfiles to be updated according to the identification and the number;
wherein, before the step of generating the homomorphic calculation function, the method further comprises:
dividing the original document to obtain N divided subfiles, and distributing corresponding identifiers and numbers for the divided subfiles, wherein N is an integer greater than or equal to 1;
establishing mapping relations between the N divided subfiles and all leaf nodes except a root node of the hash tree structure;
And carrying out homomorphic encryption on the N split sub-files respectively by adopting homomorphic encryption public keys, and transmitting the obtained N encrypted split sub-files to a blockchain network so as to enable a storage node server to store the split sub-files, wherein the homomorphic encryption public keys are secret keys generated according to a homomorphic key generation algorithm.
6. The method according to claim 5, wherein the step of calculating the update parameter according to a homomorphic encryption calculation function to obtain the subfile to be updated comprises:
calculating the update parameters according to the homomorphic encryption calculation function to obtain a calculation result;
and sampling a homomorphic encryption private key, and homomorphic decrypting the calculation result to obtain the subfiles to be updated, wherein the homomorphic encryption private key is a secret key generated according to a homomorphic key generation algorithm.
7. The method according to claim 5 or 6, further comprising, prior to the step of obtaining the update parameters sent by the user node server from the blockchain network:
obtaining N encrypted split subfiles sent by the user node server from a blockchain network, wherein the encrypted split subfiles are files obtained by homomorphic encryption of the split subfiles by the user node server through homomorphic encryption public keys, and mapping relations exist between the N split subfiles and all leaf nodes of a hash tree except a root node, and N is an integer greater than or equal to 1;
Homomorphic decryption is carried out on the N encrypted divided sub-files respectively, and N divided sub-files are correspondingly obtained;
and selecting M divided subfiles from the N divided subfiles according to the capacity of a storage space, wherein the capacity of the storage space is larger than the file storage capacity, the file storage capacity is obtained by adding the file sizes of the M divided subfiles, M is an integer greater than or equal to 1, and M is smaller than or equal to N.
8. A user node server, comprising:
the function generation module is used for generating homomorphic calculation functions and homomorphic parameters according to content information to be updated, wherein the content information to be updated is obtained by comparing an original document with the document to be updated;
the determining module is used for determining the identification of the subfiles to be updated according to the content information to be updated, wherein the subfiles to be updated are files to be updated in the segmentation subfiles, and the segmentation subfiles are files obtained by segmenting the original document;
the updating parameter generating module is used for generating updating parameters according to the homomorphic calculation function, the parameter encryption result and the identifier and the number corresponding to the sub-file to be updated, wherein the parameter encryption result is obtained by homomorphic encrypting the homomorphic parameters by adopting a homomorphic encryption public key
The sending module is used for sending the update parameters to the blockchain network so that the storage node server updates the split subfiles stored by the storage node server according to the update parameters;
before the step of generating the homomorphic calculation function according to the content information to be updated, the method further comprises the following steps:
dividing the original document to obtain N divided subfiles, and distributing corresponding identifiers and numbers for the divided subfiles, wherein N is an integer greater than or equal to 1;
establishing mapping relations between the N divided subfiles and all leaf nodes except a root node of the hash tree structure;
and carrying out homomorphic encryption on the N split sub-files respectively by adopting homomorphic encryption public keys, and transmitting the obtained N encrypted split sub-files to a blockchain network so as to enable a storage node server to store the split sub-files, wherein the homomorphic encryption public keys are secret keys generated according to a homomorphic key generation algorithm.
9. A storage node server, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring update parameters sent by a user node server from a blockchain network, the update parameters comprise homomorphic calculation functions, parameter encryption results, identifiers and numbers corresponding to subfiles to be updated, the parameter encryption results are obtained by homomorphic encryption of homomorphic parameters corresponding to the subfiles to be updated by the user node server through homomorphic encryption public keys, the subfiles to be updated are files to be updated in segmentation subfiles, and the segmentation subfiles are files obtained by segmenting original documents;
The computing module is used for computing the updating parameters according to the homomorphic encryption computing function to obtain the subfiles to be updated;
the updating module is used for updating the locally stored divided subfiles by using the subfiles to be updated according to the identification and the number;
wherein, before the step of generating the homomorphic calculation function, the method further comprises:
dividing the original document to obtain N divided subfiles, and distributing corresponding identifiers and numbers for the divided subfiles, wherein N is an integer greater than or equal to 1;
establishing mapping relations between the N divided subfiles and all leaf nodes except a root node of the hash tree structure;
and carrying out homomorphic encryption on the N split sub-files respectively by adopting homomorphic encryption public keys, and transmitting the obtained N encrypted split sub-files to a blockchain network so as to enable a storage node server to store the split sub-files, wherein the homomorphic encryption public keys are secret keys generated according to a homomorphic key generation algorithm.
CN202010014151.8A 2020-01-07 2020-01-07 Document updating method and server Active CN111221569B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010014151.8A CN111221569B (en) 2020-01-07 2020-01-07 Document updating method and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010014151.8A CN111221569B (en) 2020-01-07 2020-01-07 Document updating method and server

Publications (2)

Publication Number Publication Date
CN111221569A CN111221569A (en) 2020-06-02
CN111221569B true CN111221569B (en) 2023-07-25

Family

ID=70831030

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010014151.8A Active CN111221569B (en) 2020-01-07 2020-01-07 Document updating method and server

Country Status (1)

Country Link
CN (1) CN111221569B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112686004B (en) * 2020-12-30 2023-04-11 海南大学 Block chain-based single-document multi-interface editing method
CN112929464B (en) * 2021-02-22 2022-06-24 中国电子信息产业集团有限公司第六研究所 Identification analysis method, device, system, dynamic adapter and readable storage medium
CN115470506B (en) * 2022-10-28 2023-03-10 山东华翼微电子技术股份有限公司 Homomorphic mapping-based secure file system implementation method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417781A (en) * 2019-07-30 2019-11-05 中国工商银行股份有限公司 File encryption management method, client and server based on block chain

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102196429B (en) * 2011-04-27 2014-08-06 暨南大学 Encrypted data fusion method for wireless sensor network
US8635465B1 (en) * 2012-03-28 2014-01-21 Emc Corporation Counter-based encryption of stored data blocks
CN105320899B (en) * 2014-07-22 2018-01-09 北京大学 A kind of user oriented cloud storage data completeness protection method
US9729312B2 (en) * 2015-04-28 2017-08-08 The United States Of America As Represented By The Secretary Of The Navy System and method for high-assurance data storage and processing based on homomorphic encryption
US10554385B2 (en) * 2015-09-04 2020-02-04 Nec Corporation Method for providing encrypted data in a database and method for searching on encrypted data
CN107770154B (en) * 2017-09-22 2019-08-27 中国科学院信息工程研究所 Block chain reliable data storage method, terminal and system based on cloud storage
CN108777613A (en) * 2018-06-01 2018-11-09 杭州电子科技大学 The deblocking method for secure storing of heat transfer agent Virtual Service in Internet of Things
CN109615378B (en) * 2019-01-24 2021-06-15 上海点融信息科技有限责任公司 Block chain-based secure multi-party computing method and device and readable storage medium
CN109861829B (en) * 2019-03-15 2021-10-26 上海海事大学 Cloud data justice auditing system supporting dynamic updating and auditing method thereof
CN110276684B (en) * 2019-05-20 2021-04-23 创新先进技术有限公司 Receipt storage method and node combining transaction type and event function type
CN110390212B (en) * 2019-07-31 2021-09-24 中国工商银行股份有限公司 Supply monitoring method based on block chain and node device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417781A (en) * 2019-07-30 2019-11-05 中国工商银行股份有限公司 File encryption management method, client and server based on block chain

Also Published As

Publication number Publication date
CN111221569A (en) 2020-06-02

Similar Documents

Publication Publication Date Title
CN111221569B (en) Document updating method and server
US10439804B2 (en) Data encrypting system with encryption service module and supporting infrastructure for transparently providing encryption services to encryption service consumer processes across encryption service state changes
US9800416B2 (en) Distributed validation of digitally signed electronic documents
JP6048414B2 (en) Database apparatus, method and program
US10484170B2 (en) Custom encryption function for communications between a client device and a server device
US9501646B2 (en) Program verification apparatus, program verification method, and computer readable medium
JP6120961B2 (en) Generation and verification of alternative data with a specific format
US20180241747A1 (en) Information processing apparatus, authentication method, and recording medium for recording computer program
CN115225409B (en) Cloud data safety duplicate removal method based on multi-backup joint verification
JP6451938B2 (en) Ciphertext verification system, method, and program
WO2017122393A1 (en) Confidential search system, confidential search method and confidential search program
CN114756895B (en) Hidden trace data verification method and system based on homomorphic encryption
CN112800445A (en) Boolean query method for forward and backward security and verifiability of ciphertext data
EP2286610B1 (en) Techniques for peforming symmetric cryptography
CN110830261B (en) Encryption method, encryption device, computer equipment and storage medium
KR102132685B1 (en) Apparatus and method for order-revealing encryption
JP5970193B2 (en) SEARCH SYSTEM, SEARCH METHOD, AND SEARCH PROGRAM
KR102284877B1 (en) Efficient functional encryption for set intersection
CN110611674B (en) Protocol interaction method, system and storage medium between different computer systems
KR102192594B1 (en) Apparatus and method for order-revealing encryption in multi-client environment without trusted authority
CN114143098A (en) Data storage method and data storage device
Athavale et al. One-way cryptographic hash function securing networks
WO2015107561A1 (en) Search system, search method, and search program
Shen et al. Improved collision detection of MD5 using sufficient condition combination
TW202119229A (en) Data management method and system capable of safely accessing and deleting data wherein operations are performed by using a management server

Legal Events

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