Tamper-proof signature verification method and device for electronic document and electronic equipment
By constructing an electronic document template and configuring the template identification logo, the document records are added as blocks to the blockchain, and the integrity of the document records is verified using hash value verification codes, which solves the authenticity and security of signed documents in the existing electronic signature system, and realizes the authenticity verification and tamper-proofness of signed documents.
Patent Information
- Application Number
- CN202510865093.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-07-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing electronic signature system cannot effectively verify the authenticity and integrity of the signed documents, and is vulnerable to the risks of cyber attacks and server leakage, and cannot guarantee the security and legal effect of electronic signatures.
Build an electronic document template and configure the template identification logo, generate target document records and add them to the blockchain as a block, verify the integrity of the document records through a hash value verification code, and ensure the authenticity and immutability of signed documents.
It realizes the authenticity verification of signed documents, prevents the document content from being modified at will after signing, effectively prevents the risks of network attacks and network transmission, and ensures the security and legal effect of electronic signatures.
Smart Images

Figure CN120372703A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of encryption verification, and more particularly, to an anti-tampering signature verification method, apparatus, and electronic device for electronic documents. Background Art
[0002] With the rapid development of computer and Internet technologies, more and more business activities, document transmissions, contract or document signings, etc. have started to move towards digitalization. Taking the signing of electronic documents as an example, the traditional method is to print paper documents and have both parties confirm and sign on the paper documents simultaneously. However, this method can no longer meet the efficient and convenient digitalization requirements. By digitizing documents, the business processing speed can be greatly accelerated, the customer experience can be improved, and the operating costs can be reduced. Therefore, electronic signatures came into being.
[0003] Compared with traditional paper signatures, the paper signature process is time-consuming, laborious, costly, and there is a risk of forgery, and it is not convenient for storage and archiving. Electronic signatures can greatly improve the signing efficiency, reduce costs, and ensure the authenticity and non-tamperability of contracts and documents through digital certificates and encryption technologies. To ensure the security and legal effect of electronic signatures, a reliable method is needed to verify the authenticity of the signed documents and electronic signatures of both parties to a transaction, that is, to prove that the signature in the document is the user's approval of the document content and is the signature of the user himself. Electronic signatures require verification and anti-tampering technologies.
[0004] Most of the existing technologies verify the authenticity of the signature itself, but cannot verify the correspondence between the signed document, data, and signature one by one. Even if it is stated that the signature is the user's true signature, the authenticity of the snapshot of the document at the time of signing cannot be guaranteed. In addition, most of the existing electronic signature systems directly store the file data and signature information on online servers and databases. If the servers and databases are attacked or the permissions are leaked, the file content and signature information can be directly modified, and the goal of verifying the authenticity of the signature cannot be achieved. The existing electronic signature verification methods are also verified based on online servers in the cloud, which have relatively high requirements for network and server performance and have certain deficiencies. Summary of the Invention
[0005] Embodiments of the present disclosure at least provide an anti-tampering signature verification method, apparatus, and electronic device for electronic documents, which can realize the authenticity verification of signed documents, prevent the content of the document from being randomly modified after signing, and effectively prevent the risks of network attacks and network transmissions.
[0006] Embodiments of the present disclosure provide an anti-tampering signature verification method for electronic documents, including: Construct an electronic document template and configure a corresponding template identification identifier; In response to the data filling operation of the service provider for the selected target electronic document template, fill the document data input by the service provider into the corresponding positions of the target electronic document template to generate a target electronic document; In response to the verification operation of the customer for the target electronic document, add an electronic signature to the target electronic document to generate a target document record, and add the target document record as a block to a blockchain with historical document records as blocks and arranged in the order of document record generation; Generate a hash value of the target document record as a verification code, and determine whether the verification code matches the hash value corresponding to the previous historical document record in the blockchain. If it matches, it is determined that the target document record and the historical document record have not been tampered with.
[0007] In an optional implementation manner, constructing an electronic document template and configuring a corresponding template identification identifier specifically includes: Construct the electronic document template and configure corresponding template attribute information; Add service item information to the electronic document template, and set a corresponding blank data filling area for each service item information; Store the electronic document template in the main server and synchronize it to the sub-server corresponding to the main server in a read-only state; Process the template file corresponding to the electronic document template using the MD5 digest algorithm to generate a message digest corresponding to the template file, and determine the message digest as the template identification identifier.
[0008] In an optional implementation manner, in response to the data filling operation of the service provider for the selected target electronic document template, filling the document data input by the service provider into the corresponding positions of the target electronic document template to generate a target electronic document specifically includes: Determine the target electronic document template selected by the service provider according to the template identification identifier; In response to the data filling operation of the service provider for the target electronic document template, obtain the document data input by the service provider; According to the data type corresponding to the document data, fill the document data into the corresponding blank data filling area to generate the target electronic document.
[0009] In an optional implementation manner, construct the blockchain based on the following steps: After each generation of the target document record, use the data content corresponding to the target document record as the block body; Obtain the hash value corresponding to the previous historical document record; Use the hash value corresponding to the previous historical document record and the hash value corresponding to the current target document as the block header corresponding to the block body; Concatenate the block body and the block header to form the block, and sequentially concatenate the blocks according to the generation order of the blocks to form the blockchain.
[0010] In an optional implementation, in response to a customer's verification operation on the target electronic document, add an electronic signature to the target electronic document to generate a target document record, specifically including: In response to a customer's verification operation on the target electronic document, determine whether the service item information and the document data are correct; If the customer verifies the service item information and the document data correctly, obtain the electronic signature submitted by the user; Add the electronic signature to the corresponding position of the target electronic document to generate the target document record.
[0011] In an optional implementation, determine whether the verification code matches the hash value corresponding to the previous historical document record in the blockchain. If they match, it is determined that the target document record and the historical document record have not been tampered with. Specifically including: Compare the verification code with the hash value corresponding to the historical document record to determine whether the verification code matches the hash value corresponding to the historical document record, so as to verify whether the historical document record has been tampered with; Or compare the hash value corresponding to the historical document record with the verification code to determine whether the hash value corresponding to the historical document record matches the verification code, so as to verify whether the target document record has been tampered with.
[0012] The embodiments of the present disclosure also provide an anti-tampering signature verification device for electronic documents, including: A template construction module for constructing an electronic document template and configuring a corresponding template identification identifier; A data filling module for, in response to a service provider's data filling operation on a selected target electronic document template, filling the document data input by the service provider into the corresponding position of the target electronic document template to generate a target electronic document; A document verification module for, in response to a customer's verification operation on the target electronic document, adding an electronic signature to the target electronic document to generate a target document record, and adding the target document record as a block to a blockchain with historical document records as blocks and arranged in the order of document record generation; A record verification module is used to generate a hash value of the target document record as a verification code, and determine whether the verification code matches the hash value corresponding to the previous historical document record in the blockchain. If they match, it is determined that the target document record and the historical document record have not been tampered with.
[0013] In an optional implementation, the template construction module is specifically configured to: Construct the electronic document template and configure the corresponding template attribute information; Add service item information to the electronic document template and set a corresponding blank data filling area for each service item information; Store the electronic document template in the main server and synchronize it to the sub-server corresponding to the main server in a read-only state; Process the template file corresponding to the electronic document template using the MD5 digest algorithm to generate a message digest corresponding to the template file, and determine the message digest as the template identification identifier.
[0014] An embodiment of the present disclosure further provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, they execute the above anti-tampering signature verification method for electronic documents, or the steps in any possible implementation of the above anti-tampering signature verification method for electronic documents.
[0015] An embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the above anti-tampering signature verification method for electronic documents, or the steps in any possible implementation of the above anti-tampering signature verification method for electronic documents.
[0016] An embodiment of the present disclosure further provides a computer program product, including a computer program / instructions. When the computer program and instructions are executed by a processor, they implement the above anti-tampering signature verification method for electronic documents, or the steps in any possible implementation of the above anti-tampering signature verification method for electronic documents.
[0017] An anti-tampering signature verification method, device, and electronic device for electronic documents provided by an embodiment of the present disclosure. By constructing an electronic document template and configuring a corresponding template identification identifier; in response to a data filling operation of a service provider for a selected target electronic document template, filling the document data input by the service provider into the corresponding position of the target electronic document template to generate a target electronic document; in response to a verification operation of a customer for the target electronic document, adding an electronic signature to the target electronic document to generate a target document record, and adding the target document record as a block to a blockchain in which historical document records are used as blocks and arranged in the order of document record generation; generating a hash value of the target document record as a verification code, and determining whether the verification code matches the hash value corresponding to the previous historical document record in the blockchain. If they match, it is determined that the target document record and the historical document record have not been tampered with. It can achieve the authenticity verification of signed documents, prevent the content of the document from being randomly modified after signing, and effectively prevent the risks of network attacks and network transmissions.
[0018] To make the above objects, features, and advantages of the present disclosure more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, provides a detailed description as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required to be used in the embodiments. The accompanying drawings herein are incorporated into the specification and constitute a part of this specification. These drawings illustrate embodiments that conform to the present disclosure and, together with the specification, are used to explain the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0020] Figure 1 Shows a flowchart of an anti-tampering signature verification method for an electronic document provided by an embodiment of the present disclosure; Figure 2 Shows a flowchart of another anti-tampering signature verification method for an electronic document provided by an embodiment of the present disclosure; Figure 3 Shows a schematic diagram of an anti-tampering signature verification device for an electronic document provided by an embodiment of the present disclosure; Figure 4 Shows a schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are only a part rather than all of the embodiments of the present disclosure. Components of the embodiments of the present disclosure generally described and illustrated in the accompanying drawings herein may be arranged and designed in a variety of different configurations. Therefore, the detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed present disclosure, but merely represents selected embodiments of the present disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of the present disclosure without creative efforts fall within the scope of protection of the present disclosure.
[0022] It should be noted that like reference numerals and letters denote like items in the following drawings. Therefore, once an item is defined in one drawing, it does not require further definition and explanation in subsequent drawings.
[0023] As used herein, the term "and / or" merely describes an association relationship and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" as used herein means any one of a plurality or any combination of at least two of a plurality. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set composed of A, B, and C.
[0024] Through research, it is found that most of the existing technologies verify the authenticity of the signature itself, but cannot verify the one-to-one correspondence between the signed document, data, and signature. Even if it is stated that the signature is the authentic signature of the person, the authenticity of the snapshot of the document at the time of signing cannot be guaranteed. In addition, most of the existing electronic signature systems directly store the file data and signature information on online servers and databases. If the servers and databases are attacked or their permissions are leaked, the file content and signature information can be directly modified, and the goal of verifying the authenticity of the signature cannot be achieved. The existing electronic signature verification methods also verify based on online servers in the cloud, which have relatively high requirements for network and server performance and have certain deficiencies.
[0025] Based on the above research, the present disclosure provides a method, apparatus, and electronic device for anti-tampering signature verification of electronic documents. By constructing an electronic document template and configuring a corresponding template identification identifier; in response to a data filling operation of the service provider for the selected target electronic document template, filling the document data input by the service provider into the corresponding position of the target electronic document template to generate a target electronic document; in response to a verification operation of the customer for the target electronic document, adding an electronic signature to the target electronic document to generate a target document record, and adding the target document record as a block to a blockchain in which historical document records are used as blocks and arranged in the order of document record generation; generating a hash value of the target document record as a verification code, and determining whether the verification code matches the hash value corresponding to the previous historical document record in the blockchain. If they match, it is determined that the target document record and the historical document record have not been tampered with. It can realize the authenticity verification of signed documents, prevent the content of the document from being randomly modified after signing, and effectively prevent the risks of network attacks and network transmissions.
[0026] To facilitate the understanding of this embodiment, first, a method for anti-tampering signature verification of an electronic document disclosed in the embodiments of the present disclosure will be introduced in detail. The execution subject of the method for anti-tampering signature verification of the electronic document provided in the embodiments of the present disclosure is generally a computer device with certain computing capabilities. Such a computer device includes, for example: a terminal device, a server, or other processing devices. The terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementation manners, the method for anti-tampering signature verification of the electronic document may be implemented by a processor invoking computer-readable instructions stored in a memory.
[0027] See Figure 1 As shown, it is a flowchart of a method for anti-tampering signature verification of an electronic document provided in the embodiments of the present disclosure. The method includes steps S101 to S104, where: S101. Construct an electronic document template and configure a corresponding template identification identifier.
[0028] In a specific implementation, the service provider designs and creates an electronic document template in advance according to business requirements. Each template contains the following content: The basic document information includes: The template name, which is a name describing the purpose of the document (such as "service agreement document", "repair record form"); The template number is a code that uniquely identifies the template, usually an automatically generated UUID or other unique identifier; The creation date is the timestamp when the template is created, used to record the template creation time; The usage permission specifies which users or system roles can access or use the template.
[0029] Here, the template content contains structured fields that define various types of information that the service provider and the customer need to fill in. For example: Service item fields: Project name, service content description, measurement unit (such as hours, times, pieces), billing standard (such as charge per hour, charge per piece), minimum settlement quantity, unit price. Signing fields: Customer signature area, service provider signature area, signing date.
[0030] Among them, the template file is saved in a structured file format (such as JSON, XML, or other custom formats) to the template library of the central server. After the template is established, each terminal (Slave slave library) synchronizes the latest template from the central server and at the same time sets it to read-only mode (read_only) to prevent the template from being tampered with or deleted.
[0031] Specifically, in order to ensure the uniqueness, integrity, and non-tamperability of the template, each template needs to generate a template identification identifier, and encode the content of the template file. The encoded data is usually standard text or binary data. Use the MD5 digest algorithm to perform a digest operation on the template file to generate a message digest, which is the unique identification identifier of the template.
[0032] Here, MD5 is a commonly used hash algorithm that can convert an input of any length (such as the content of the template file) into a fixed-length 128-bit hash value. First, read the content of the template file, input the content into the MD5 algorithm, and output a 32-character hexadecimal string as the template identification code. During the document generation process, the current version of the template used can be verified through the template identification code. The service provider and the customer can use the template identification code to verify whether the template file has been modified during transmission or storage.
[0033] As a possible implementation, refer to Figure 1 As shown, it is a flowchart of another method for verifying the anti-tampering signature of an electronic document provided by an embodiment of the present disclosure. The method includes steps S1011 to S1014, where: S1011. Construct the electronic document template and configure the corresponding template attribute information.
[0034] S1012. Add service item information to the electronic document template and set a corresponding blank data filling area for each piece of service item information.
[0035] S1013. Store the electronic document template in the main server and synchronize it to the sub-server corresponding to the main server in a read-only state.
[0036] S1014. Process the template file corresponding to the electronic document template using the MD5 digest algorithm to generate a message digest corresponding to the template file, and determine the message digest as the template identification identifier.
[0037] In a specific implementation, the service provider creates an electronic document template through a template management system according to business requirements. The basic attribute configuration includes a template name used to describe the purpose and function of the electronic document. For example, "repair service document", "contract agreement form", etc. The template number is a unique identifier automatically generated by the system (UUID or custom code) used to uniquely identify the template. The validity period specifies the effective usage time of the template, such as one year or a specific time range, and the template becomes invalid after the expiration date. The usage permission scope defines which users, roles, or system modules can access, view, or use the template to ensure data security. The creation time records the creation time of the template, facilitating subsequent version management and traceability.
[0038] Here, the service item information is the core content in the electronic document template, used to describe the specific services provided by the service provider. In the electronic document template, corresponding fields and their blank data filling areas are added for each piece of service item information. Common fields include: The service item name is used to describe the specific service item, such as "equipment repair", "maintenance service". The measurement unit describes the measurement unit of the service item, such as "hour", "piece", "time", etc. The unit price represents the unit price or rate of the service item. The minimum settlement quantity is the minimum settlement unit of the service item, such as 0.5 hours, 1 piece, etc. And the total amount automatically calculated based on the service quantity and the unit price.
[0039] Among them, a blank area is set at the corresponding field position of the template for users to input specific service quantity, amount, and other data when filling out the document. The created electronic document template file is stored in the main server in a structured file format (such as JSON, XML, or database table) for centralized management and maintenance.
[0040] Here, through the distributed synchronization mechanism, the template file is synchronized from the master server to the slave servers. The template files in the slave servers are stored in read - only mode (read_only) to prevent the template files from being tampered with or deleted, ensuring the integrity and consistency of the templates. After the master server completes the template update, a change record is generated. Each slave server pulls the latest template file from the master server at regular intervals or in real - time, and the slave servers set read - only permissions for the template files to ensure data security.
[0041] Furthermore, to ensure the uniqueness, integrity, and anti - tampering property of the templates, a unique identification identifier needs to be generated for each electronic document template. Read all the content of the electronic document template file from the master server, and use the MD5 digest algorithm to perform a digest operation on the content of the template file. The input is the content of the template file (such as in JSON or XML format), and the output is a 128 - bit hash value of a fixed length (usually represented as a 32 - character hexadecimal string).
[0042] Here, each template file content uniquely corresponds to an MD5 digest. Any modification of the template file (including minor changes) will cause a significant change in the MD5 digest. The generated message digest is used as the unique identification identifier of the template, stored in the template management system, and used for subsequent integrity verification.
[0043] Among them, the master server synchronizes the template to multiple slave servers and sets read - only permissions to ensure that the template cannot be tampered with.
[0044] S102. In response to the data filling operation of the service provider for the selected target electronic document template, fill the document data input by the service provider into the corresponding positions of the target electronic document template to generate a target electronic document.
[0045] In specific implementation, determine the target electronic document template selected by the service provider according to the template identification identifier; in response to the data filling operation of the service provider for the target electronic document template, obtain the document data input by the service provider; according to the data type corresponding to the document data, fill the document data into the corresponding blank data filling area to generate a target electronic document.
[0046] Here, the service provider selects a predefined target electronic document template through the front - end interface. When selecting the template, the system receives the template identifier (template ID) or template name. The system loads the template structure corresponding to the selected template ID from the database or cache, including field layouts (such as service items, quantity, unit price, total price, etc.) and the preset placeholder positions.
[0047] Among them, according to the interface prompts, the service provider fills in the content of the electronic document item by item. The data types for filling in the content of the electronic document include text data (such as customer name, service item description); numerical data (such as service quantity, unit price); date and time (such as service date).
[0048] It should be noted that when the service provider submits data, the system verifies the input content in real time to ensure the legality of the data format and content. The mandatory field verification checks whether all mandatory fields are filled, and the data type verification checks whether the format of the input data is correct (for example, a numeric field should not contain non-numeric characters).
[0049] Furthermore, according to the field layout in the template structure, the data input by the service provider is filled into the corresponding positions in the template. The service item information is filled into the service item field, the quantity and unit price are filled into the corresponding numeric fields, and the customer name is filled into the customer name field.
[0050] Here, according to the placeholder structure of the template, the predefined placeholders are replaced and the target electronic document is generated. For fields that rely on calculations such as the total amount, the system automatically calculates according to the formula when filling in the data.
[0051] Among them, the generated target electronic document file is stored in the database or file storage system, and the following metadata is associated: document number (a unique number automatically generated), service provider information, and creation time and last modification time.
[0052] Optionally, the system returns the generated target electronic document to the service provider and displays the complete content of the electronic document in the interface.
[0053] Exemplarily, a new document template is created, and the name, validity period, scope of use permissions, etc. of the document are configured. The document information is saved in the document template table; in the document template, the name and content of the service items to be provided, the measurement unit of the service items, the calculation method, the minimum settlement quantity, the item unit price, etc. are added. The service item information is saved in the service item template table; when providing services, the corresponding document template is selected, and according to the current date, a new document record is automatically created, and the content in the document template is automatically filled into the document record, and the service items corresponding to the template are automatically filled into the service item record; according to the actual situation of the service, the implementation situation of the service items is filled in. After filling in, the background calculates the total amount of each service item and the total amount of the entire document according to the data.
[0054] S103. In response to the customer's verification operation on the target electronic document, add an electronic signature to the target electronic document to generate a target document record, and add the target document record as a block to a blockchain with historical document records as blocks and arranged in the order of document record generation.
[0055] In a specific implementation, in response to a customer's verification operation on a target electronic document, determine whether the service item information and document data are correct; if the customer verifies the service item information and document data correctly, obtain the electronic signature submitted by the user; add the electronic signature to the corresponding position of the target electronic document to generate a target document record. To ensure the authenticity, immutability, and traceability of the electronic document, it is necessary to generate a target document record containing the electronic signature after the customer verifies and confirms the electronic document, and store this record as a block in the blockchain.
[0056] Here, the customer opens and verifies the content of the target electronic document through the front-end interface of the electronic document system. The verification content includes but is not limited to service items, quantity, unit price, total amount, customer name and contact information, service date, and remarks, etc. After the customer verifies and finds no errors, they can click the "Confirm and Sign" button, and the system receives the verification confirmation request.
[0057] Among them, if the customer checks that the data content of the electronic document is correct, they perform an electronic signature on the electronic document record on the terminal and submit the signature. The generated electronic signature is embedded into the target electronic document together with the verification confirmation time to form a target document record.
[0058] Furthermore, construct the target document record as a new block. After each target document record is generated, use the corresponding data content of the target document record as the block body; obtain the hash value corresponding to the previous historical document record; use the hash value corresponding to the previous historical document record and the hash value corresponding to the current target document as the block header corresponding to the block body; splice the block body and the block header into a block, and splice them in sequence according to the generation order of the blocks to form a blockchain.
[0059] Here, the block includes the following structure: a block header and a block body. The block header includes the hash value of the previous block, the timestamp of the current block, and the hash value of the current block. The block body includes the complete content of the target document record, including service item information and electronic signature, etc.
[0060] Among them, add the generated block to the blockchain structure with historical document records as blocks. Each block is linked to the previous block in sequence to form an immutable chain structure, and store the updated blockchain in a distributed storage system to ensure data security, traceability, and distributed consensus.
[0061] In a specific implementation, the server automatically generates a block for this document record based on all the content of the document (document record number, template identification code, service information, electronic signature picture, etc.) and data such as the hash value of the previous block, and uses the last six characters of the hash value as the verification code.
[0062] Here, the hash value of the block is generated using the SHA256 algorithm. The SHA256 algorithm (Secure Hash Algorithm 256) is a deterministic one-way hash function. The generated hash value is usually represented by a hexadecimal string with a length of 64, consisting of random letters and numbers, which is equivalent to an array with a length of 32 bytes. Regardless of the size of the plaintext, the hash value is always 256 bits. Making a small change to the content of the document will result in a huge change in the generated Hash, which is completely different from the original value and also different from the last 6 characters of the original value. Naturally, the verification code will also change.
[0063] Among them, the role of the SHA 256 algorithm in the whole process is to ensure the integrity of the electronic document and the electronic signature. Each block records the fingerprint of the previous block. In this way, the blockchain can be traced back continuously and is not easily tampered with. If you want to tamper with the blockchain, you need to tamper with all blocks at the same time, which will affect everyone who has signed an electronic document with the service provider. The blockchain realizes the anti-tampering property of electronic documents. Each electronic document has its own fingerprint, and these fingerprints are connected into a chain, just like an evidence chain that cannot be tampered with.
[0064] S104. Generate the hash value of the target document record as the verification code, and determine whether the verification code matches the hash value corresponding to the previous historical document record in the blockchain. If they match, it is determined that the target document record and the historical document record have not been tampered with.
[0065] In a specific implementation, compare the verification code with the hash value corresponding to the historical document record to determine whether the verification code matches the hash value corresponding to the historical document record, so as to verify whether the historical document record has been tampered with; or compare the hash value corresponding to the historical document record with the verification code to determine whether the hash value corresponding to the historical document record matches the verification code, so as to verify whether the target document record has been tampered with.
[0066] Here, after the document record is signed, use the SHA256 algorithm to generate the hash value of this block for the content of the document record, service information, signature picture, and the hash value of the previous block. The customer obtains the verification code composed of the last 6 characters of the hash value of this block. At the same time, add the information of the block of the latest signed electronic document to the previous blockchain and merge it into the latest chain. At any time, the customer can use the verification code formed by the latest signed document to verify the legality of all previous electronic documents (whether they have been modified and whether they are signed by the person himself). Or use the verification code of the historical document to verify the legality of the currently signed electronic document and the previous electronic documents.
[0067] Among them, any customer who has signed an electronic document can use the verification code to verify historical documents. If any part of the data changes, even the slightest change, the hash value will change completely. The customer checks the verification code obtained and compares it with the hash value on the blockchain. If they match, the data is authentic and has not been tampered with; if the hash value has changed, it means the data has been tampered with during transmission or storage.
[0068] A method for verifying anti-tampering signatures of electronic documents provided by an embodiment of the present disclosure includes constructing an electronic document template and configuring a corresponding template identification identifier; in response to a data filling operation of a service provider for a selected target electronic document template, filling the document data input by the service provider into the corresponding position of the target electronic document template to generate a target electronic document; in response to a verification operation of a customer for the target electronic document, adding an electronic signature to the target electronic document to generate a target document record, and adding the target document record as a block to a blockchain with historical document records as blocks and arranged in the order of document record generation; generating a hash value of the target document record as a verification code, and determining whether the verification code matches the hash value corresponding to the previous historical document record in the blockchain. If they match, it is determined that the target document record and the historical document record have not been tampered with. It can realize the authenticity verification of signed documents, prevent the content of the document from being randomly modified after signing, and effectively prevent the risks of network attacks and network transmissions.
[0069] Those skilled in the art can understand that in the above method of the specific embodiment, the writing order of each step does not mean a strict execution order that constitutes any limitation on the implementation process, and the specific execution order of each step should be determined according to its function and possible internal logic.
[0070] Based on the same inventive concept, an embodiment of the present disclosure also provides an anti-tampering signature verification device for electronic documents corresponding to the anti-tampering signature verification method of electronic documents. Since the principle of solving problems by the device in the embodiment of the present disclosure is similar to the above anti-tampering signature verification method of electronic documents in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0071] Please refer to Figure 3 , Figure 3 which is a schematic diagram of an anti-tampering signature verification device for electronic documents provided by an embodiment of the present disclosure. As shown in Figure 3 , the anti-tampering signature verification device 300 for electronic documents provided by an embodiment of the present disclosure includes: A template construction module 310, configured to construct an electronic document template and configure a corresponding template identification identifier.
[0072] A data filling module 320, configured to fill the bill data input by the service provider into corresponding positions of the target electronic bill template to generate a target electronic bill in response to a data filling operation of the service provider for the selected target electronic bill template.
[0073] A bill checking module 330, configured to add an electronic signature to the target electronic bill to generate a target bill record in response to a checking operation of a customer for the target electronic bill, and add the target bill record as a block to a blockchain in which historical bill records are used as blocks and are arranged in the order of bill record generation.
[0074] A record verification module 340, configured to generate a hash value of the target bill record as a verification code, and determine whether the verification code matches a hash value corresponding to the previous historical bill record in the blockchain. If they match, it is determined that the target bill record and the historical bill record have not been tampered with.
[0075] For the processing flow of each module in the device and the interaction flow between modules, reference can be made to the relevant descriptions in the above method embodiments, which will not be elaborated here.
[0076] An anti-tampering signature verification device for electronic bills provided by an embodiment of the present disclosure constructs an electronic bill template and configures a corresponding template identification identifier; fills the bill data input by the service provider into corresponding positions of the target electronic bill template to generate a target electronic bill in response to a data filling operation of the service provider for the selected target electronic bill template; adds an electronic signature to the target electronic bill to generate a target bill record in response to a checking operation of a customer for the target electronic bill, and adds the target bill record as a block to a blockchain in which historical bill records are used as blocks and are arranged in the order of bill record generation; generates a hash value of the target bill record as a verification code, and determines whether the verification code matches a hash value corresponding to the previous historical bill record in the blockchain. If they match, it is determined that the target bill record and the historical bill record have not been tampered with. It can realize the authenticity verification of signed bills, prevent the content of the bill from being randomly modified after signing, and effectively prevent the risks of network attacks and network transmissions.
[0077] Corresponding to Figure 1 the anti-tampering signature verification method for electronic bills in, an embodiment of the present disclosure further provides an electronic device 400, as Figure 4 shown, which is a schematic structural diagram of the electronic device 400 provided by an embodiment of the present disclosure, including: A processor 41, a memory 42, and a bus 43; the memory 42 is used to store execution instructions, including an internal memory 421 and an external memory 422; the internal memory 421 here is also called the main memory, which is used to temporarily store the operation data in the processor 41 and the data exchanged with the external memory 422 such as a hard disk. The processor 41 exchanges data with the external memory 422 through the internal memory 421. When the electronic device 400 runs, the processor 41 communicates with the memory 42 through the bus 43, so that the processor 41 executes Figure 1 the Figure 2 steps of the method for verifying the anti-tampering signature of the electronic document in
[0078] Embodiments of the present disclosure also provide a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, it executes the steps of the method for verifying the anti-tampering signature of the electronic document described in the above method embodiments. Among them, the storage medium may be a volatile or non-volatile computer-readable storage medium.
[0079] Embodiments of the present disclosure also provide a computer program product. The computer program product includes computer instructions. When the computer instructions are executed by a processor, they can execute the steps of the method for verifying the anti-tampering signature of the electronic document described in the above method embodiments. For details, please refer to the above method embodiments and will not be elaborated here.
[0080] Among them, the above computer program product can be specifically implemented in a way of hardware, software or a combination thereof. In an optional embodiment, the computer program product is specifically embodied as a computer storage medium. In another optional embodiment, the computer program product is specifically embodied as a software product, such as a Software Development Kit (SDK), etc.
[0081] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described device can refer to the corresponding process in the foregoing method embodiments and will not be elaborated here. In several embodiments provided by the present disclosure, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces, and the indirect coupling or communication connection of the device or unit may be in an electrical, mechanical or other form.
[0082] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0083] In addition, in each embodiment of the present disclosure, each functional unit may be integrated in a processing unit, may exist separately as individual physical units, or two or more units may be integrated in one unit.
[0084] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present disclosure, in essence, or the part that contributes to the prior art or part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0085] Finally, it should be noted that: the above-described embodiments are only specific implementation manners of the present disclosure, used to illustrate the technical solutions of the present disclosure, rather than limiting it. The protection scope of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed by the present disclosure can still modify the technical solutions recorded in the foregoing embodiments, or can easily think of changes, or make equivalent replacements for some of the technical features; and these modifications, changes, or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should all be covered by the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. An anti-tampering signature verification method for electronic documents, characterized in that Including: Construct an electronic document template and configure a corresponding template recognition identifier; In response to the data filling operation of the service provider for the selected target electronic document template, fill the document data input by the service provider into the corresponding position of the target electronic document template to generate a target electronic document; In response to the verification operation of the customer for the target electronic document, add an electronic signature to the target electronic document to generate a target document record, and add the target document record as a block to a blockchain with historical document records as blocks and arranged in the order of document record generation; Generate a hash value of the target document record as a verification code, and determine whether the verification code matches the hash value corresponding to the previous historical document record in the blockchain. If it matches, it is determined that the target document record and the historical document record have not been tampered with.
2. The method according to claim 1, characterized in that Construct an electronic document template and configure a corresponding template recognition identifier, specifically including: Construct the electronic document template and configure the corresponding template attribute information; Add service item information to the electronic document template, and set a corresponding blank data filling area for each service item information; Store the electronic document template in the main server and synchronize it to the corresponding sub-server of the main server in a read-only state; Process the template file corresponding to the electronic document template using the MD5 digest algorithm to generate a message digest corresponding to the template file, and determine the message digest as the template recognition identifier.
3. The method according to claim 2, wherein In response to the data filling operation of the service provider for the selected target electronic document template, fill the document data input by the service provider into the corresponding position of the target electronic document template to generate a target electronic document, specifically including: Determine the target electronic document template selected by the service provider according to the template recognition identifier; In response to the data filling operation of the service provider for the target electronic document template, obtain the document data input by the service provider; According to the data type corresponding to the document data, fill the document data into the corresponding blank data filling area to generate the target electronic document.
4. The method according to claim 1, wherein Construct the blockchain based on the following steps: After each target document record is generated, use the data content corresponding to the target document record as the block body; Obtain the hash value corresponding to the previous historical document record; Use the hash value corresponding to the previous historical document record and the hash value corresponding to the current target document as the block header corresponding to the block body; Concatenate the block body and the block header into the block, and sequentially concatenate the blocks according to the generation order of the blocks to form the blockchain.
5. The method according to claim 2, wherein In response to the verification operation of the customer for the target electronic document, add an electronic signature to the target electronic document to generate a target document record, specifically including: In response to the verification operation of the customer for the target electronic document, determine whether the service item information and the document data are correct; If the customer verifies the service item information and the document data correctly, obtain the electronic signature submitted by the user; Add the electronic signature to the corresponding position of the target electronic document to generate the target document record.
6. The method according to claim 1, wherein Determine whether the verification code matches the hash value corresponding to the previous historical document record in the blockchain. If they match, it is determined that the target document record and the historical document record have not been tampered with. Specifically, it includes: Compare the verification code with the hash value corresponding to the historical document record to determine whether the verification code matches the hash value corresponding to the historical document record, so as to verify whether the historical document record has been tampered with; Or compare the hash value corresponding to the historical document record with the verification code to determine whether the hash value corresponding to the historical document record matches the verification code, so as to verify whether the target document record has been tampered with.
7. An anti-tampering signature verification device for electronic documents, characterized in that, It includes: A template construction module for constructing an electronic document template and configuring a corresponding template identification identifier; A data filling module for, in response to the data filling operation of the service provider for the selected target electronic document template, filling the document data input by the service provider into the corresponding position of the target electronic document template to generate a target electronic document; A document verification module for, in response to the verification operation of the customer for the target electronic document, adding an electronic signature to the target electronic document to generate a target document record, and adding the target document record as a block to a blockchain with historical document records as blocks and arranged in the order of document record generation; A record verification module for generating the hash value of the target document record as a verification code, and determining whether the verification code matches the hash value corresponding to the previous historical document record in the blockchain. If they match, it is determined that the target document record and the historical document record have not been tampered with.
8. The device according to claim 7, characterized in that The template construction module is specifically used for: Constructing the electronic document template and configuring corresponding template attribute information; Adding service item information to the electronic document template and setting a corresponding blank data filling area for each service item information; Storing the electronic document template in the main server and synchronizing it to the corresponding sub-server of the main server in a read-only state; Processing the template file corresponding to the electronic document template using the MD5 digest algorithm to generate the message digest corresponding to the template file, and determining the message digest as the template identification identifier.
9. An electronic device, characterized in that, It includes: A processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, the steps of the anti-tampering signature verification method for an electronic document according to any one of claims 1 to 6 are executed.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is run by the processor, the steps of the anti-tampering signature verification method for an electronic document according to any one of claims 1 to 6 are executed.
Citation Information
Patent Citations
Tourism electronic contract digital certificate storage system and certificate storage method based on regional chain
CN109064120A
Electronic document signing and checking method and system for preventing tampering based on block chain
CN115396117A
Electronic signature method based on block chain technology
CN117094036A