PDF (Portable Document Format) file signature and tamper-proofing method, device and equipment

By adding signature appearance and locking attributes to PDF files, and calculating hash values ​​for digital signatures, it solves the problem of difficulty in verifying integrity, authenticity and tampering of traditional PDF files, achieving high security and credibility of files.

CN118536170APending Publication Date: 2024-08-23CHINA FINANCIAL CERTIFICATION AUTHORITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410550159.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-06
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Traditional PDF files are difficult to verify file integrity and authenticity during transmission and storage, and are prone to malicious tampering.

Method used

By adding a signature appearance to the PDF file and locking all file content attributes, and calculating the hash value of the overall data for digital signature, generating a signature value and writing it into the reserved space, combining hash value and digital signature technology to ensure the integrity of the file sex and authenticity.

Benefits of technology

Significantly improves the security of PDF files, preventing unauthorized access and tampering, ensuring that the file has not been tampered with during transmission and is indeed sent by the purported sender.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118536170A
    Figure CN118536170A
Patent Text Reader

Abstract

The invention relates to the field of information security, and discloses a PDF (Portable Document Format) file signature and tamper-proof method, device and equipment, and the method comprises the following steps: adding a signature appearance to a specified position of a PDF file; adding and locking all file content attributes into the PDF file, obtaining locking attribute information, and taking the locking attribute information as a part of signature data; calculating the hash value of the whole PDF file data according to the PDF specification, and reserving a signature value space in the calculation process; the overall PDF file data comprises original content of the PDF file, newly added signature appearance and locking attribute information; signing the hash value to obtain a signature value; and writing the signature value into a reserved signature value space. The problems that in traditional file transmission, file integrity and authenticity are difficult to verify, and malicious tampering is likely to happen are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a PDF file signing and tamper-proofing method, device and equipment. Background Art

[0002] As a file format designed specifically for reading, PDF can maintain high compatibility on various platforms and hardware and software environments, and its internal elements can be preserved in their original form. However, with the widespread application of PDF files in various fields, especially in situations involving sensitive information, such as legal documents, financial reports, and commercial contracts, its security issues have become increasingly prominent. Digital signatures and hash technology are important tools in the field of information security. Digital signatures can be used to verify the integrity of information and confirm the source of information, while hash technology can provide a fast verification of data integrity. In this solution, these two technologies are combined to ensure the integrity and authenticity of PDF files.

[0003] Although PDF files themselves have a certain degree of security, under certain high-level security requirements, such as preventing files from being tampered with or ensuring the authenticity of the sender of the file, additional technical means are needed to strengthen protection.

[0004] Therefore, how to ensure the security and integrity of PDF files during transmission and storage has become an urgent problem to be solved. Summary of the invention

[0005] The present invention provides a PDF file signature and anti-tampering method, device and equipment, which solves the problems of difficulty in verifying the integrity and authenticity of files in traditional file transmission and susceptibility to malicious tampering. In order to solve this technical problem, the present invention proposes the following solutions:

[0006] A PDF file signature and tamper-proof method, comprising:

[0007] Add signature appearance to the specified location of the PDF file;

[0008] Adding a lock attribute for all file contents to the PDF file, obtaining lock attribute information, and using the lock attribute information as part of the signature data;

[0009] Calculate the hash value of the entire PDF file data according to the PDF specification, and reserve the signature value space during the calculation process; the entire PDF file data includes the original content of the PDF file, the newly added signature appearance and the locking attribute information;

[0010] Signing the hash value to obtain a signature value;

[0011] The signature value is written into the reserved signature value space.

[0012] In an embodiment of the present invention, adding the signature appearance to the specified position of the PDF file specifically includes: obtaining a preset or user-defined signature appearance; locating the specified position where the signature appearance needs to be added; inserting the signature appearance as a layer or annotation element into the specified position of the PDF file through the function of the PDF processing library; and saving the modified PDF file after adjusting the size and position of the signature appearance.

[0013] In an embodiment of the present invention, adding a lock all file content attribute to the PDF file specifically includes: setting an attribute in the PDF file for locking all the contents of the file; the locking attribute information includes one or more of the following: password protection, digital signature, file locking and editing restriction, watermark and seal, document attributes, metadata locking.

[0014] In one embodiment of the present invention, the calculating of the hash value of the overall PDF file data according to the PDF specification specifically includes: according to the PDF specification, using one or more hash algorithms to process the overall data including the original PDF file content, the newly added signature appearance and the locked attribute information to generate a hash value.

[0015] In one embodiment of the present invention, signing the hash value specifically includes: obtaining the signer's private key and importing the private key into a signature system; in the signature system, digitally signing the hash value according to the private key and a selected digital signature algorithm.

[0016] In an embodiment of the present invention, when the signed PDF file is tampered with, the method further comprises: explicitly prompting the user that the signature is invalid through a reader.

[0017] A PDF document signature and anti-tampering device, comprising:

[0018] Signature appearance adding module, used to add signature appearance to the specified position of the PDF file;

[0019] A content locking module, used for adding a lock attribute for all file contents to the PDF file, obtaining lock attribute information, and using the lock attribute information as part of the signature data;

[0020] A hash calculation module, used to calculate the hash value of the entire PDF file data according to the PDF specification, and reserve a signature value space during the calculation process; the entire PDF file data includes the original content of the PDF file, the newly added signature appearance and the locked attribute information;

[0021] A signature module, used to sign the hash value to obtain a signature value;

[0022] The signature value writing module is used to write the signature value into the reserved signature value space.

[0023] In an embodiment of the present invention, the device further comprises: a tampering detection module, which is used to explicitly prompt the user through the reader that the signature is invalid when the signed PDF file is tampered with.

[0024] A PDF document signature and anti-tampering device, comprising:

[0025] at least one processor; and,

[0026] A memory connected to the at least one processor via a bus; wherein,

[0027] The memory stores instructions executable by the at least one processor, and the instructions are executed to implement the method described in any one of the above embodiments.

[0028] A non-volatile storage medium stores computer executable instructions, wherein the computer executable instructions are executed by a processor to implement the method described in any one of the above embodiments.

[0029] The present invention provides a PDF file signature and anti-tampering method, device and equipment, which at least include the following beneficial effects: by adding a signature appearance to a PDF file, adding an attribute to lock all file contents in the file, and signing the overall data hash value, the method significantly improves the security of the PDF file and prevents unauthorized access and tampering. By using hash value and digital signature technology, the recipient can verify the integrity and authenticity of the file, ensuring that the file has not been tampered with during transmission and is indeed sent by the claimed sender. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0031] Figure 1 A schematic diagram of a PDF file provided in an embodiment of the present invention in which modifications to a text field cannot be discovered when the file is signed but not locked;

[0032] Figure 2 A schematic diagram of the steps of a PDF file signing and tamper-proofing method provided by an embodiment of the present invention;

[0033] Figure 3 A schematic diagram of a reader prompting that a signature is invalid after adding content filled after locking a signature provided by an embodiment of the present invention;

[0034] Figure 4 A schematic diagram of a PDF file signing and anti-tampering device provided by an embodiment of the present invention;

[0035] Figure 5 A schematic diagram of a PDF file signing and tamper-proofing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be described clearly and completely in conjunction with the specific embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0037] It should be noted that it is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in the present invention can be combined with other embodiments without conflict. Unless otherwise defined, the technical terms or scientific terms involved in the present invention should be the usual meanings understood by people with ordinary skills in the technical field to which the present invention belongs. The words "one", "a", "a", "the" and the like involved in the present invention do not indicate a quantitative limitation and may represent the singular or plural. The terms "including", "comprising", "having" and any of their variations involved in the present invention are intended to cover non-exclusive inclusions; the terms "first", "second", "third", etc. involved in the present invention are merely to distinguish similar objects and do not represent a specific ordering of objects.

[0038] like Figure 1 As shown, if the client synthesizes data based on a template file, the text field can still be edited after the signature. If someone else changes the information in the text field, the edited content will be appended to the back of the PDF file. According to the processing rules of the layout file reader, the rear object will replace the same object in the front, so the content seen by the user may be tampered with. And the reader cannot prompt that the signature is invalid, but only gives a prompt. The existing technical solution is to add locking information after the signature, which will cause the document verification to fail.

[0039] In the scenario where data is tampered after being signed based on a template file, by adding a signature to lock the data, users can promptly discover problems with the document.

[0040] The present invention proposes a PDF file signature and tamper-proof method, device and equipment, which are described in detail below.

[0041] Figure 2 A schematic diagram of the steps of a PDF file signing and tamper-proofing method provided by an embodiment of the present invention, Figure 2 The PDF file signing and anti-tampering method shown can be executed by a PDF file signing and anti-tampering device, and the PDF file signing and anti-tampering device can be set on a server. For example, the server can be a physical server including an independent host, a virtual server carried by a host cluster, a cloud server, etc., and the embodiment of the present invention is not limited to this. The PDF file signing and anti-tampering method may include the following steps:

[0042] S210: Adding the signature appearance to a specified position of the PDF file.

[0043] In one embodiment of the present invention, adding a signature appearance to a specified position of a PDF file specifically includes: obtaining a preset or user-defined signature appearance; locating the specified position where the signature appearance needs to be added; inserting the signature appearance as a layer or annotation element into the specified position of the PDF file through the function of the PDF processing library; and saving the modified PDF file after adjusting the size and position of the signature appearance.

[0044] Signature appearance refers to the visual representation of a signature, which involves the visual elements and presentation of the signature. Specifically, signature appearance may include: the shape and handwriting of the signature (such as the writing style and handwriting characteristics of the signer), the layout and arrangement of the signature (for example, the signature may be located at the bottom, right side or a specific area of ​​the document, and may be presented at different angles or sizes), the color of the signature, the thickness of the handwriting, and the writing tools used, etc.

[0045] As a visual expression of the signer's personality and identity, the signature appearance not only has a legal authentication function, but also carries the signer's personal style. In a digital environment, the signature appearance can be customized through electronic signature software or tools to meet the image and aesthetic requirements of an individual or organization.

[0046] Specifically, first, a preset signature appearance needs to be obtained or the user needs to be allowed to customize the signature appearance. This can be achieved by providing a preset signature appearance library, which contains signature appearances of various design styles for users to choose from. At the same time, a user customization interface can also be provided to allow users to create a unique signature appearance according to their preferences, such as selecting a specific color, font, size, and position.

[0047] Once the signature appearance is obtained, the next step is to add it to the specified location of the PDF file. You can use a specialized PDF processing library or tool to operate PDF files. Specifically, you can do this by following the steps below:

[0048] 1. Open the target PDF file and locate the page and position where you need to add the signature appearance.

[0049] 2. Use the functions of the PDF processing library to insert the acquired signature appearance as a layer or annotation element into the specified position of the PDF file.

[0050] 3. Adjust the size and position of the signature appearance to ensure it coordinates with the other content of the PDF page.

[0051] 4. Save the modified PDF file to ensure that the signature appearance is permanently embedded in the file.

[0052] By adding a signature appearance to a PDF file, the professionalism and credibility of the document are improved. By adding a personalized signature appearance, the PDF file can look more formal and official, thereby increasing readers' trust in the document content. Adding a signature appearance to a PDF file facilitates identification and verification. The signature appearance can be used as an identity identifier for the document issuer or approver, helping to quickly identify the person responsible for the document and verify its authenticity. Combined with digital signature technology, the signature appearance can serve as a visual security mark to indicate that the document has not been tampered with, further protecting the integrity and authenticity of the document content.

[0053] S220: adding a lock attribute for all file contents to the PDF file, obtaining lock attribute information, and using the lock attribute information as part of the signature data.

[0054] In one embodiment of the present invention, adding a lock all file content attribute to a PDF file specifically includes: setting an attribute in the PDF file for locking all the file contents; the locking attribute information includes one or more of the following: password protection, digital signature, file locking and editing restriction, watermark and seal, document attributes, metadata locking.

[0055] Specifically, when adding a solution to lock all file content attributes to a PDF file, the first thing to do is to make sure that the content of the PDF file is not tampered with after signing. To achieve this goal, you can perform one or more of the following steps:

[0056] 1. Set lock attribute: Through PDF processing tools or libraries, you can set a special attribute in the PDF file, which will be used to lock all the contents of the file. Once this attribute is set, any attempt to modify the file content will be blocked.

[0057] 2. Apply password protection: Set a strong password for the PDF file to ensure that only users who know the password can open and edit the file. This is the first line of defense against unauthorized access.

[0058] 3. Add digital signature: Use digital signature technology to sign PDF files to ensure the integrity and source of the file. Any subsequent modification to the file will invalidate the digital signature, thus alerting the user that the file may have been tampered with.

[0059] 4. Implement file locking and editing restrictions: Through the PDF permission settings, you can restrict the editing, printing, copying and other operations of the file. In this way, even if the file is opened, it cannot be modified without the corresponding permissions.

[0060] 5. Add watermarks and stamps: Add transparent watermarks or stamps to PDF files to identify the status or ownership of the file. This feature not only helps prevent theft, but also visually reminds users of the confidentiality of the file.

[0061] 6. Lock document properties and metadata: Ensure that key metadata such as the title, author, creation date, etc. of the PDF file are not changed to maintain the authenticity and traceability of the file.

[0062] After completing the above steps, all the locked attribute information will be collected, including the set password, digital signature details, specific settings for editing restrictions, added watermark and seal information, and locked document properties and metadata, etc. This information will be saved and transmitted together with the PDF file as part of the signature data.

[0063] In order to prevent the situation where the previous signature becomes invalid after some manufacturers add the locking attribute, sufficient testing should be carried out before applying the locking mechanism in the formal environment to ensure the compatibility of the signature and the lock. Therefore, multiple signatures signed according to the method of this application are supported, and each signature will not become invalid due to the addition of the locking attribute.

[0064] By implementing the above solution, the security and credibility of PDF files can be significantly improved. Locking all file content attributes effectively prevents the file from being illegally modified after signing, protecting the integrity and authenticity of the file. At the same time, the detailed locking attribute information as part of the signature data provides strong support for the verification and traceability of the file, further enhancing the credibility of the file.

[0065] S230: Calculate the hash value of the entire PDF file data according to the PDF specification, and reserve a signature value space during the calculation process; the entire PDF file data includes the original content of the PDF file, the newly added signature appearance and the locked attribute information.

[0066] In one embodiment of the present invention, a hash value of the entire PDF file data is calculated according to the PDF specification, specifically including: according to the PDF specification, one or more hash algorithms are used to process the entire data including the original PDF file content, the newly added signature appearance and the locked attribute information to generate a hash value.

[0067] Specifically, first, the data to be processed needs to be prepared, which includes the original content of the PDF file, the newly added signature appearance, and the locked attribute information added to the file. The hash calculation will be performed as a whole data.

[0068] According to the PDF specification and actual needs, one or more suitable hash algorithms will be selected, such as MD5, SHA-1, SHA-256, etc. These algorithms can convert data of any length into a hash value of fixed length and are highly resistant to collision.

[0069] Before calculating the hash value, you need to reserve space in the PDF file to store the signature value. This is because the signature value will be generated after the hash calculation and needs to be embedded in the PDF file, and the reserved space can ensure that the signature value is added smoothly without affecting the previously calculated hash value.

[0070] Next, the prepared overall data is processed using the selected hash algorithm. This process converts the data into a fixed-length hash value H, which will serve as the digital fingerprint of the PDF file to verify the integrity of the file and that it has not been tampered with.

[0071] After the hash calculation is completed, you need to verify that the generated hash value is correct and record it in a safe location for subsequent digital signature and file verification.

[0072] By implementing the above solution, the integrity and security of PDF files can be ensured. The calculation of the hash value can provide a unique digital fingerprint for the PDF file. Any change to the file content will cause the hash value to change, thereby effectively detecting the tampering of the file. At the same time, the reserved signature value space facilitates the subsequent digital signature, further enhancing the credibility and legal effect of the file. Overall, this step improves the security and credibility of PDF files during transmission and storage.

[0073] S240: Sign the hash value to obtain a signature value.

[0074] In one embodiment of the present invention, signing a hash value specifically includes: obtaining a signer's private key, and importing the private key into a signature system; in the signature system, digitally signing the hash value according to the private key and a selected digital signature algorithm.

[0075] Specifically, first, ensure the security of the signing environment, including the use of secure signing equipment and software to prevent malicious attacks or tampering during the signing process.

[0076] The signer needs to provide his / her private key, which is usually kept by the signer and known only to the signer. Before signing, the signer needs to import his / her private key into the signature system in a secure way.

[0077] According to actual needs and security requirements, select a suitable digital signature algorithm, such as RSA, ECDSA, etc. These algorithms can ensure the unforgeability of the signature and the integrity of the data.

[0078] Use the signer's private key and the selected signature algorithm to digitally sign the previously calculated hash value of the PDF file data. During the signing process, the private key will encrypt the hash value to generate a unique signature value, which will serve as an important basis for verifying the integrity of the file and the identity of the signer.

[0079] Once the signature is complete, the validity of the signature can be verified using the signer's public key. If the file content has been tampered with after signing, the recalculated hash value will not match the original signature, thus detecting the file change.

[0080] By digitally signing the hash value, the authenticity and integrity of the PDF file can be ensured. The digital signature provides verifiable evidence that the file content has not been tampered with, enhancing the credibility of the file. At the same time, the signer's private key ensures that the signature cannot be forged, further improving the security of the file. This solution not only protects the original content of the file, but also provides the recipient of the file with an effective means to verify the authenticity of the file, promoting the reliable transmission and storage of information.

[0081] S250: Write the signature value into the reserved signature value space.

[0082] Specifically, first, it is necessary to locate the signature value space reserved in step S230. This space is specially reserved in the PDF file structure for storing the signature value.

[0083] Next, the signature value obtained in step S240 is written into the reserved signature value space M according to the format requirements of the PDF specification. This requires ensuring that the signature value is completely integrated with other parts of the PDF file and does not affect the readability and integrity of the file.

[0084] After writing the signature value, a verification is required to ensure that the signature value has been correctly embedded in the PDF file and can be read and verified normally.

[0085] At this point, the security signature of the PDF file is completed. At this point, the PDF file has the characteristics of being tamper-proof and verifiable.

[0086] In one embodiment of the present invention, when a signed PDF file is tampered with, the reader explicitly prompts the user that the signature is invalid.

[0087] Specifically, during the use of a signed PDF file, if the file content is tampered with, the reader can explicitly prompt the user that the signature is invalid. Figure 3 As shown in the figure, when you open a signed PDF file, the reader will automatically verify the validity of the signature value. If it is found that the file content does not match the signature value, that is, the file has been tampered with, the reader will immediately pop up a prompt window to clearly inform the user that "at least one signature is invalid" and other prompts.

[0088] By writing the signature value into the reserved space, the PDF file is securely signed, ensuring the integrity and authenticity of the file. At the same time, the explicit prompt function of the reader can promptly warn the user when the file is tampered with, effectively preventing the misuse of invalid or forged signature files, and improving the security and reliability of file use.

[0089] The above is a PDF file signature and anti-tampering method provided by an embodiment of the present invention. Based on the same inventive idea, an embodiment of the present invention also provides a corresponding PDF file signature and anti-tampering device, such as Figure 4 As shown, including:

[0090] The signature appearance adding module 410 is used to add the signature appearance to a specified position of the PDF file;

[0091] The content locking module 420 is used to add a lock attribute to all file contents in the PDF file, obtain the lock attribute information, and use the lock attribute information as part of the signature data;

[0092] The hash calculation module 430 is used to calculate the hash value of the entire PDF file data according to the PDF specification and reserve the signature value space during the calculation process; the entire PDF file data includes the original content of the PDF file, the newly added signature appearance and the locked attribute information;

[0093] The signature module 440 is used to sign the hash value to obtain a signature value;

[0094] The signature value writing module 450 is used to write the signature value into the reserved signature value space.

[0095] In one embodiment of the present invention, the tampering detection module 460 is used to explicitly prompt the user through the reader that the signature is invalid when the signed PDF file is tampered with.

[0096] The embodiment of the present invention also provides a corresponding PDF file signature and anti-tampering device, such as Figure 5 As shown, including:

[0097] At least one processor 502 (processor), a communication interface 504 (Communications Interface), a memory 506 (memory) and a communication bus 508; wherein the processor 502, the communication interface 504, and the memory 506 communicate with each other via the communication bus 508; the processor 502 can call the logic instructions stored in the memory 506 to enable at least one processor 502 to execute the steps of the above-mentioned embodiments.

[0098] Based on the same idea, some embodiments of the present invention also provide a medium corresponding to the above method.

[0099] Some embodiments of the present invention provide a storage medium storing computer executable instructions, and the computer executable instructions are executed by a processor to implement the steps of the above embodiments.

[0100] On the other hand, an embodiment of the present application also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the steps of a PDF file signing and anti-tampering method provided in the above embodiments.

[0101] Each embodiment of the present invention is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, medium and program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0102] The devices, media, and program products provided in the embodiments of the present invention correspond one-to-one to the methods. Therefore, the devices, media, and program products also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices, media, and program products will not be repeated here.

[0103] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or method. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or method including the elements.

[0104] The above are only embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail above with general descriptions and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made on the basis of the present invention. Therefore, these modifications or improvements made on the basis of not departing from the spirit of the present invention all belong to the scope of protection claimed in the present invention.

Claims

1. A PDF file signature and tamper-proof method, It is characterized in that include: Add signature appearance to the specified location of the PDF file; Adding a lock attribute for all file contents to the PDF file, obtaining lock attribute information, and using the lock attribute information as part of the signature data; Calculate the hash value of the entire PDF file data according to the PDF specification, and reserve the signature value space during the calculation process; the entire PDF file data includes the original content of the PDF file, the newly added signature appearance and the locking attribute information; Signing the hash value to obtain a signature value; The signature value is written into the reserved signature value space.

2. The method according to claim 1, It is characterized in that Adding the signature appearance to the specified position of the PDF file specifically includes: Get a preset or user-defined signature appearance; Locate the designated location where the signature appearance needs to be added; Based on the function of the PDF processing library, insert the signature appearance as a layer or an annotation element into a specified position of the PDF file; After resizing the said signature appearance, save the modified PDF file.

3. The method according to claim 1, It is characterized in that The adding of locking all file content attributes to the PDF file specifically includes: Set a property in the PDF file to lock all the contents of the file; The locking attribute information includes one or more of the following: password protection, digital signature, file locking and editing restriction, watermark and seal, document attribute, metadata locking.

4. The method according to claim 1, It is characterized in that The step of calculating the hash value of the entire PDF file data according to the PDF specification specifically includes: According to the PDF specification, one or more hash algorithms are used to process the overall data including the original PDF file content, the newly added signature appearance, and the locked attribute information to generate a hash value.

5. The method according to claim 1, It is characterized in that The signing of the hash value specifically includes: Obtain the signer's private key and import the private key into the signature system; In the signature system, the hash value is digitally signed according to the private key and a selected digital signature algorithm.

6. The method according to claim 1, It is characterized in that When the signed PDF file is tampered with, the method further includes: The reader explicitly prompts the user that the signature is invalid.

7. A PDF document signature and anti-tampering device, It is characterized in that include: Signature appearance adding module, used to add signature appearance to the specified position of the PDF file; A content locking module, used for adding a lock attribute for all file contents to the PDF file, obtaining lock attribute information, and using the lock attribute information as part of the signature data; A hash calculation module, used to calculate the hash value of the entire PDF file data according to the PDF specification, and reserve a signature value space during the calculation process; the entire PDF file data includes the original content of the PDF file, the newly added signature appearance and the locked attribute information; A signature module, used to sign the hash value to obtain a signature value; The signature value writing module is used to write the signature value into the reserved signature value space.

8. The device according to claim 7, It is characterized in that The device also includes: The tampering detection module is used to explicitly prompt the user through the reader that the signature is invalid when the signed PDF file is tampered with.

9. A PDF document signature and anti-tampering device, It is characterized in that include: at least one processor; as well as, A memory connected to the at least one processor via a bus; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed to implement the method according to any one of claims 1 to 6.

10. A non-volatile storage medium storing computer executable instructions, It is characterized in that The computer executable instructions are executed by a processor to implement the method according to any one of claims 1 to 6.