A method for downloading a traceable tamper-proof file, a storage medium and an equipment

By generating electronic watermarks and anti-counterfeiting QR codes in files, and combining them with dark textured QR code rotation and LSB algorithm encryption, the problem of tampering during file transmission is solved, achieving high concealment and traceability of files, and ensuring file security and integrity.

CN119814762BActive Publication Date: 2026-03-27JIANGSU HONGXIN SYST INTEGRATION
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies are insufficient to effectively trace and prevent files from being tampered with during transmission, and existing anti-tampering methods are easily identified and removed by attackers, thus failing to ensure the security and integrity of files.

Method used

The method combines overt and covert approaches. It generates electronic watermarks and anti-counterfeiting QR codes in the file, rotates and segments the covert QR code image, hides it in the data image using the LSB algorithm, and encrypts it using the XXTEA encryption algorithm. It also generates a supplementary carrier to increase concealment and complexity.

Benefits of technology

It achieves high concealment and tamper resistance of files, effectively traces the file download process, prevents leaks and traces the source, and improves the security and traceability of file transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814762B_ABST
    Figure CN119814762B_ABST
Patent Text Reader

Abstract

The application discloses a kind of traceability tamper-proof file downloading method, storage medium and equipment, comprising: in the process of file downloading, electronic watermark and anti-fake two-dimensional code are generated in different positions of each data picture, and the offset information of the offset of the several characters on the data picture is recorded;For each data picture, encrypt in combination with user information, generate dark pattern two-dimensional code picture;Each dark pattern two-dimensional code picture is divided into fragments, rotated according to the specified order, converted into a binary image, written into the data picture, the data picture is segmented, and the rotated fragments are filled into the data picture according to the clockwise natural number sequence spiral, to obtain a watermark picture as an original carrier, and generate a complementary carrier with the same size as the original carrier and all black, change the original carrier and the complementary carrier based on the improved LBS algorithm, and synthesize a new data picture, all the synthesized new data pictures are spliced into PDF and provided for user to download.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data security, in particular to a traceable tamper-proof file downloading method, a storage medium and equipment. BACKGROUND

[0002] With the rise of network platforms in the electronic information era, information systems have gradually become an important platform for enterprise, government office and management, helping enterprises improve service quality and reduce operating costs. Network office has become an important environment and means for daily work of enterprise administrative organs, and almost all of them involve enterprise internal information, which is often an important content related to the security of enterprise interests and internal stability. Therefore, from the perspective of security work, while building office automation, effective security measures should be used to effectively strengthen information security.

[0003] Under normal circumstances, the path of file transmission is exposed to the outside world, and attackers can take measures to intercept and destroy the normal information transmission path. In order to protect private data from being stolen or tampered with, information hiding technology has emerged, which protects the secret information embedded in the carrier file from being detected by attackers, thereby protecting the security of file data transmission.

[0004] File protection currently mainly uses complex algorithms to encrypt files, and it is difficult to further protect and trace the source of the files after successful decryption. After the same file is downloaded by multiple people, it is impossible to determine the leakage time, the leakage personnel of the file, and whether the file has been tampered with.

[0005] There are two common file tamper-proofing and tracing methods: one is file watermarking, which cannot guarantee that the file will not be edited again, and the generated watermark can be easily modified or removed through AI technology; the second is to asymmetrically encrypt the file stream, and determine whether the file has been modified by comparing the encrypted values. When the file is transmitted in the network or the user uses screenshot and other methods, it is impossible to verify whether the file has been tampered with, and it is impossible to trace the source. SUMMARY

[0006] In view of the problems in the prior art, the present application provides a traceable tamper-proof file downloading method, a storage medium and equipment, which adopts a combination of light and dark to ensure the traceability and tamper-proofing of the downloaded file.

[0007] To achieve the above technical purpose, the present application adopts the following technical scheme: a traceable tamper-proof file downloading method, specifically comprising the following steps:

[0008] Step S1, when a user downloads a file on a shared platform, identity verification is performed, and if the identity verification is passed, the file is downloaded;

[0009] Step S2, record the log information when downloading the file, save it to the structured database library table, and generate a complementary carrier file storage folder on the server side;

[0010] Step S3, generate a temporary file according to the content of the downloaded file, convert the temporary file into a PDF file, and convert the data of each page in the PDF file into a data picture in sequence;

[0011] Step S4, generate electronic watermark and anti-fake two-dimensional code at different positions of each data picture, and display the anti-fake two-dimensional code on the corresponding data picture;

[0012] Step S5, recognize the text content in each data picture through OCR, randomly extract some text for position and angle offset, and record the offset information;

[0013] Step S6, encrypt each data picture in combination with user information to generate a dark pattern two-dimensional code picture;

[0014] Step S7, divide each dark pattern two-dimensional code picture into fragments, rotate them in a specified order, convert them into binary images, write them into data pictures, split the data pictures, and fill the rotated fragments into the data pictures in a clockwise natural number sequence spiral to obtain a watermark picture as an original carrier, and generate a complementary carrier with the same size as the original carrier and all black;

[0015] Step S8, if the least significant bits of the original carrier and the complementary carrier are different, change the embedding method, if the embedding method is changed to generate a random number of 1, change the original carrier, otherwise, change the complementary carrier;

[0016] Step S9, combine the changed original carrier and the complementary carrier into a new data picture, hide the changed original carrier in the picture layer, and sequentially splice the changed complementary carrier into a picture file and store it in the complementary carrier folder;

[0017] Step S10, splice all the new data pictures into a PDF and provide it for the user to download.

[0018] Further, the log information in step S2 includes: file name, file content, download time, user ID, user name, user IP, and randomly generated UUID32-bit download log ID.

[0019] Further, the specific process of randomly extracting some text for position and angle offset in step S5 is: randomly offset the position of the extracted text horizontally or vertically by 5 pixels, and randomly offset the angle of the extracted text within the range of [-10°, 10°].

[0020] Further, the recording offset information in step S5 includes: file name, file page number, offset text, and corresponding offset angle and offset position.

[0021] Further, step S6 includes the following sub-steps:

[0022] Step S6.1, the user ID, download time and download file name are spliced in order by underscore to obtain a string, MD5 encryption is performed, and the encrypted string is used as the key of the XXTEA encryption algorithm;

[0023] Step S6.2, the user name, download time and download file name are spliced by @ symbol as plaintext, the plaintext is encrypted using the XXTEA encryption algorithm and the key in step S6.1, an encrypted string is obtained, and the encrypted string is used to generate a dark pattern two-dimensional code picture.

[0024] Further, step S7 includes the following sub-steps:

[0025] Step S7.1, each dark pattern two-dimensional code picture is equally divided into 4096 ordered fragments in the form of a 64x64 grid;

[0026] Step S7.2, a fragment sequence number modulo rule is set, which is used as the reverse offset rotation angle of each fragment, and the position of each fragment is updated;

[0027] Step S7.3, the position-updated fragment is converted into a binary image, and the binary image is written into a data picture;

[0028] Step S7.4, the data picture is equally divided into 64x64 parts, the top left corner is taken as the first loading position point, the rotated fragments are filled into the data picture in a clockwise natural number sequence spiral, a watermark picture is obtained as the original carrier, and a complementary carrier with the same size as the original carrier and all black is generated.

[0029] Further, the fragment sequence number modulo rule in step S7.2 is that the fragment sequence number is divided by 360 to obtain a remainder.

[0030] Further, the specific process of tracing and tamper-proofing verification of the downloaded PDF file is as follows:

[0031] A, find the original carrier and the complementary carrier of the corresponding file through the record of the downloaded PDF file, extract the encrypted watermark picture with the lowest significant bit, and merge the watermark picture with the complementary carrier to generate the original watermark picture;

[0032] B, the watermark picture is divided into 64x64 parts, and the center point position fragment is extracted in reverse by the spiral algorithm rule;

[0033] C, according to the order of the broken map, the corresponding angle is reset by rotating forward;

[0034] D, 4096 broken maps are combined into a dark pattern two-dimensional code picture in the form of 64x64 grid;

[0035] F, scan the dark pattern two-dimensional code picture, extract the encrypted two-dimensional code content;

[0036] G, according to the file download log table, the key is generated, the two-dimensional code content is decrypted by using XXTEA algorithm, and the tampering comparison is carried out;

[0037] H, the offset information of the extracted data picture is compared with the recorded offset information, and the source is traced.

[0038] Further, the present application also provides a computer readable storage medium, which stores a computer program, the computer program enables a computer to execute the downloading method of the traceable anti-tampered file.

[0039] Further, the present application also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, when the processor executes the computer program, the downloading method of the traceable anti-tampered file is realized.

[0040] Compared with the prior art, the present application has the following beneficial effects:

[0041] (1) the downloading method of the traceable anti-tampered file generates electronic watermark and anti-fake two-dimensional code on each data picture of the downloaded file, which plays a confusing role, so that the actual dark pattern two-dimensional code picture is better hidden;

[0042] (2) the downloading method of the traceable anti-tampered file rotates the dark pattern two-dimensional code picture, and compares the least significant bit of the original carrier with the complementary carrier, hides the dark pattern two-dimensional code picture in different positions of the data picture, so that the attacker is difficult to predict the position of the watermark picture, increases the concealment of the watermark picture, greatly improves the tampering difficulty and complexity; and the dark pattern two-dimensional code picture is encrypted, further improving the concealment;

[0043] (3) the downloading method of the traceable anti-tampered file extracts a plurality of characters randomly to offset the position and angle, and records the offset information, so as to trace the file source, avoid the attacker to steal the secret data by taking pictures. BRIEF DESCRIPTION OF DRAWINGS

[0044] Figure 1 the flow chart of the downloading method of the traceable anti-tampered file;

[0045] Figure 2The regular schematic diagram for filling the data picture in a clockwise natural number sequence spiral according to the rotated broken graph. DETAILED DESCRIPTION

[0046] The technical solutions of the present application will be further explained in combination with the drawings.

[0047] As Figure 1 The flow chart of the downloading method of the traceable anti-tampering file of the present application, which specifically comprises the following steps:

[0048] Step S1, when downloading the file on the sharing platform, the user performs identity verification, such as verifying whether the user is logged in, whether the IP information and the permission information meet the file downloading permission, and if the identity verification is passed, downloading the file.

[0049] Step S2, record the log information when downloading the file, save it to the structured database library table, and generate a complementary carrier file storage folder on the server; in the present application, the log information includes: file name, file content, download time, user ID, user name, user IP, and randomly generated UUID32-bit download log ID.

[0050] Step S3, according to the content of the downloaded file, generate a temporary file, convert the temporary file into a PDF file, and convert the data of each page in the PDF file into a data picture in order;

[0051] Step S4, generate electronic watermark and anti-fake two-dimensional code at different positions of each data picture, and display the anti-fake two-dimensional code on the corresponding data picture, the electronic watermark and the anti-fake two-dimensional code are displayed in plaintext in the present application, on the one hand, it informs the user to properly keep the downloaded file to prevent leakage, because the downloaded file information has been recorded and archived; on the other hand, it plays a confusing role, because the plaintext electronic watermark and anti-fake two-dimensional code can be removed by existing AI technology, and the attacker thinks that the electronic watermark and anti-fake two-dimensional code are removed after changing the plaintext, so as to better hide the actual function of the hidden line two-dimensional code picture, which can be traced through the hidden line two-dimensional code picture; wherein, the electronic watermark includes: file name, user name and download time, the anti-fake two-dimensional code includes: user name, download time, file name, IP address. The intention of plaintext is mainly to inform the downloader to properly keep the downloaded file to prevent leakage, and the information of browsing the file has been recorded and archived. The intention of the hidden text is to prevent the removal of the watermark and two-dimensional code information on the surface of the picture through AI software, and the traceability can still be performed through the hidden watermark carrier in the layer.

[0052] Step S5, recognize the text content in each data picture by OCR, randomly extract a number of texts for position and angle offset, specifically, randomly offset the position of the extracted text by 5 pixels horizontally or vertically, and randomly offset the angle of the extracted text by any value within the range of [-10°, 10°]; and record the offset information, including: file name, file page number, offset text, and corresponding offset angle and offset position. Through the recorded offset information, it is convenient for subsequent comparison of the source, and avoids attackers from stealing classified data through photographing.

[0053] Step S6, for each data picture, encrypt it in combination with user information to generate a dark pattern two-dimensional code picture; specifically including the following sub-steps:

[0054] Step S6.1, concatenate the user ID encoded by 32-bit UUID string, the download time encoded by 8-digit number in the format of YYYYMMDD, and the download file name in order by underscore to obtain a string, perform MD5 encryption on the string, and use the encrypted string as the key of the XXTEA encryption algorithm;

[0055] Step S6.2, concatenate the user name, download time, and download file name with the @ symbol as plaintext, use the XXTEA encryption algorithm, and encrypt the plaintext using the key in step S6.1 to obtain an encrypted string, and generate a 4cm×4cm dark pattern two-dimensional code picture. Since the dark pattern two-dimensional code picture is encrypted, only a string of random codes is obtained when scanning the code alone, and the specific content cannot be obtained from the random codes, which can improve the concealment of the dark pattern two-dimensional code picture.

[0056] Step S7, divide each dark pattern two-dimensional code picture into fragments, rotate them in a specified order, convert them into binary images, write them into the data picture, split the data picture, and fill the rotated fragments into the data picture in a clockwise numerical spiral to obtain a watermark picture as the original carrier, and generate a complementary carrier with the same size as the original carrier and all black. The watermark picture formed by the clockwise spiral filling method can well hide the information in the dark pattern two-dimensional code picture, making it difficult for attackers to detect and remove the watermark, thereby greatly increasing the concealment of the watermark picture. Specifically including the following sub-steps:

[0057] Step S7.1, divide each dark pattern two-dimensional code picture into 4096 ordered fragments in the form of 64×64 grid;

[0058] Step S7.2, set the modulo rule for the sequence number of the fragments, that is, the remainder of the fragment sequence number divided by 360 is used as the reverse offset rotation angle of each fragment, and update the position of each fragment;

[0059] Step S7.3, converting the position-updated broken image into a binary image, and writing the binary image into a data picture;

[0060] Step S7.4, equally dividing the data picture into 64x64 parts, taking the upper left corner as the first loading position point, and filling the rotated broken image into the data picture according to a clockwise natural number spiral, as shown in the formula (1), to obtain a watermark picture as an original carrier, and generate a complementary carrier which is the same size as the original carrier and is all black. Figure 2

[0061] Step S8, the traditional LSB algorithm is very easy to be detected by steganalysis because of its very obvious transformation rule, therefore, the scheme changes the LSB by using the complementary carrier to achieve the characteristics of anti-cracking and traceability, specifically, if the least significant bits of the original carrier and the complementary carrier are different, the embedding mode is changed, if the embedding mode is changed to generate a random number of 1, the original carrier is changed, otherwise, the complementary carrier is changed; the original carrier and the complementary carrier are compared by the least significant bits, the hidden watermark picture is hidden in different positions of the data picture, so that the attacker cannot predict the position of the watermark picture, the concealment of the watermark picture is increased, and the tampering difficulty and complexity are greatly improved.

[0062] Step S9, the changed original carrier and the complementary carrier are synthesized into a new data picture, the changed original carrier is hidden in the picture layer, and the changed complementary carrier is sequentially spliced into a picture file and stored in a complementary carrier folder. For the hidden watermark picture, the hidden watermark picture is incomplete after being separated, rotated and split and hidden in the picture layer, and no information can be obtained by directly scanning the code, so that the tampering difficulty is greatly improved, and the security and traceability are achieved.

[0063] Step S10, all the synthesized new data pictures are spliced into a PDF, and provided to a user for downloading.

[0064] The specific process of the PDF file downloaded by the user in the application for traceability and tamper-proofing verification is as follows:

[0065] A, find the original carrier and the complementary carrier of the corresponding file through the downloaded PDF file record, extract the encrypted watermark picture of the least significant bits, and merge the watermark picture from the complementary carrier to generate an original watermark picture;

[0066] B, the watermark picture is divided into 64x64 parts, and the center point position broken image is extracted in reverse according to the spiral algorithm rule;

[0067] C, according to the modulo rule of the serial number of the broken image, the corresponding angle is rotated in a forward direction to reset the broken image;

[0068] D, the 4096 broken images are combined into a hidden watermark picture in the form of 64x64 grid.​

[0069] F, scan the dark pattern two-dimensional code picture, extract the encrypted two-dimensional code content;

[0070] G, generate a secret key according to a file download log table, decrypt the two-dimensional code content using an XXTEA algorithm, and perform tampering comparison;

[0071] H, extract the offset text and offset information in the data picture, compare the recorded offset information, and trace the source.

[0072] The downloading method of the traceable anti-tampered file solves the security problem of the file in the sharing circulation transmission process, prevents the classified file from being tampered with and leaked, and if the file is leaked, the source can be traced.

[0073] In one of the technical solutions of the present application, a computer readable storage medium is also provided, which stores a computer program, and the computer program enables a computer to execute the downloading method of the traceable anti-tampered file.

[0074] In one of the technical solutions of the present application, an electronic device is also provided, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the downloading method of the traceable anti-tampered file is realized.

[0075] In the embodiments disclosed in the present application, the computer storage medium can be a tangible medium, which can contain or store programs for use by or in conjunction with an instruction execution system, device or equipment. The computer storage medium can include but is not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of the computer storage medium can include one or more wire-based electrical connections, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0076] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in the present application can be realized by electronic hardware or a combination of electronic hardware and computer software. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0077] The above are only preferred embodiments of the present application, and the protection scope of the present application is not limited to the above-mentioned embodiments. Any technical scheme falling within the concept of the present application shall fall within the protection scope of the present application. It should be noted that, for ordinary skilled in the art, some improvements and refinements without departing from the principles of the present application shall be considered as the protection scope of the present application.

Claims

1. A method for downloading traceable and tamper-proof files, characterized in that, Specifically, the steps include the following: Step S1: When a user downloads a file on the sharing platform, they must authenticate their identity. If the authentication is successful, the file will be downloaded. Step S2: Record the log information during file download, save it to the structured database table, and generate a folder on the server to store the supplementary carrier files; Step S3: Based on the content of the downloaded file, generate a temporary file, convert the temporary file into a PDF file, and convert the data of each page in the PDF file into a data image in sequence; Step S4: Generate electronic watermarks and anti-counterfeiting QR codes at different locations on each data image, and display the anti-counterfeiting QR codes on the corresponding data images; Step S5: Recognize the text content in each data image using OCR, randomly select several characters for position and angle offset, and record the offset information; Step S6: For each data image, encrypt it in conjunction with user information to generate a hidden QR code image; Step S7: Divide each dark pattern QR code image into fragments, rotate them in a specified order, convert them into binary images, and write them into the data image. Divide the data image and fill the data image with the rotated fragments in a clockwise natural number sequence to obtain the watermark image, which serves as the original carrier. Generate a supplementary carrier that is the same size as the original carrier and is completely black. Step S8: If the least significant bit of the original carrier and the supplementary carrier are different, change the embedding method. If the embedding method is changed to generate a random number of 1s, change the original carrier; otherwise, change the supplementary carrier. Step S9: Combine the modified original carrier and the supplementary carrier to create a new data image. Hide the modified original carrier in the image layer and sequentially stitch the modified supplementary carriers into an image file and store it in the supplementary carrier folder. Step S10: Combine all the newly synthesized data images into a PDF and provide it to the user for download.

2. The method for downloading traceable and tamper-proof files according to claim 1, characterized in that, The log information in step S2 includes: file name, file content, download time, user ID, user name, user IP, and a randomly generated 32-bit UUID download log ID.

3. The method for downloading traceable and tamper-proof files according to claim 1, characterized in that, The specific process of randomly selecting several characters and shifting their position and angle in step S5 is as follows: the position of the selected characters is randomly shifted horizontally or vertically by 5 pixels, and the angle of the selected characters is randomly shifted to any value within the range of [-10°, 10°].

4. The method for downloading traceable and tamper-proof files according to claim 3, characterized in that, The offset information recorded in step S5 includes: file name, file page number, offset text, and corresponding offset angle and offset position.

5. The method for downloading traceable and tamper-proof files according to claim 1, characterized in that, Step S6 includes the following sub-steps: Step S6.1: Concatenate the user ID, download time, and downloaded file name in sequence with underscores to obtain a string, perform MD5 encryption, and use the encrypted string as the key for the XXTEA encryption algorithm; Step S6.2: Concatenate the username, download time, and downloaded file name with the @ symbol as plaintext, encrypt the plaintext using the XXTEA encryption algorithm and the key from step S6.1 to obtain an encrypted string, and generate a hidden QR code image from the encrypted string.

6. The method for downloading traceable and tamper-proof files according to claim 5, characterized in that, Step S7 includes the following sub-steps: Step S7.1: Divide each image of the dark pattern QR code into 4096 ordered fragments in a 64×64 grid. Step S7.2: Set the sequence number of the fragments as the modulus rule, and use it as the reverse offset rotation angle for each fragment to update the position of each fragment. Step S7.3: Convert the location-updated fragmented image into a binary image and write the binary image into the data image; Step S7.4: Divide the data image into 64×64 equal parts, take the upper left corner as the first loading position point, and fill the data image with the rotated fragments in a clockwise natural number sequence to obtain the watermark image, which serves as the original carrier, and generate a black supplementary carrier with the same size as the original carrier.

7. The method for downloading traceable and tamper-proof files according to claim 6, characterized in that, The specific rule for taking the sequence number of the fragment in step S7.2 is as follows: divide the fragment sequence number by 360 and take the remainder.

8. The method for downloading traceable and tamper-proof files according to claim 7, characterized in that, The specific process for tracing and verifying the authenticity of downloaded PDF files is as follows: A. Locate the original and supplementary carriers of the corresponding file through the downloaded PDF file records, extract the least significant bit of the encrypted watermark image, and merge it with the supplementary carrier to generate the original watermark image. B. Divide the watermarked image into 64×64 equal parts, and extract the fragmented image at the center point using the spiral algorithm rule; C. According to the sequence number of the fragments and the mold-taking rules, rotate the fragments forward by the corresponding angle to reset them. D. Merge the 4096 fragmented images into a 64×64 grid to form a dark-patterned QR code image; F. Scan the QR code image with the dark pattern and extract the encrypted QR code content; G. Generate a key based on the file download log table, use the XXTEA algorithm to decrypt the QR code content, and perform a tamper comparison. H. Extract the offset text and offset information from the data image, compare it with the recorded offset information, and trace the source.

9. A computer-readable storage medium storing a computer program, characterized in that, The computer program causes the computer to execute the method for downloading traceable and tamper-proof files as described in any one of claims 1-8.

10. An electronic device, characterized in that, include: The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the method for downloading traceable and tamper-proof files as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Synthetic aperture radar (SAR) scene deception jamming method based on image inversion

    CN114609598A

  • Ultra-large two-dimensional code positioning identification system and method in wind power scene

    CN118968208A