A method, gateway and system for preventing file leakage based on feature code

By embedding a special picture of one pixel size in the file and using signature generation and steganography, the problem of difficulty in tracing file leaks in the existing technology is solved, and rapid detection of file leaks and highly concealed tracking functions are achieved.

CN118400183BActive Publication Date: 2024-08-27SHENGYE INFORMATION TECH SERVICE (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410820270.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-08-27
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

With existing technology, it is difficult to quickly trace the leaked personnel and responsibilities when files are leaked, and the anti-leakage measures are not concealed enough and are easily discovered.

Method used

By embedding a special invisible image of one pixel size in the file, using signature generation and least significant bit steganography to encode user information, file information and time information, generate a signature URL, and trigger a request when the file is opened. Determine whether files are leaked and record abnormal IP addresses to locate the source of the leak.

Benefits of technology

It achieves reliable detection and tracking of file leaks, can quickly locate the source of leaks, and is highly concealed and difficult to be discovered.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118400183B
    Figure CN118400183B
Patent Text Reader

Abstract

The present invention discloses a method, gateway and system for preventing file leakage based on feature codes, wherein the method comprises: receiving a download request from a user inside a local area network; addressing a corresponding file from a corresponding file server based on the download request; generating a feature code based on user information, file information, time information and an event triggering script; embedding the feature code into a special picture with a pixel size of 1 to form a first special invisible picture; inserting the first special invisible picture inside the file; and judging whether the file is leaked based on the first special invisible picture. The present invention has the advantages of strong concealment, high reliability, information integrity and traceability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the network field, and in particular relates to a method, a gateway and a system for preventing file leakage based on feature codes. Background Art

[0002] File security is an important part of data security. Enterprises can use this method to prevent file leaks. When files are leaked, they can immediately trace them, investigate relevant personnel, and stop losses in time. The technical logic of this method is: the file gateway is deployed between the server and the user. The file port needs to be open to the external network for checking. Employees use the company-controlled network in their daily offices. When employees download files within the company, the gateway inserts a special invisible image into the file. The special image is a 1-pixel image. The gateway generates a feature code URL based on the identity of the employee, the information of the downloaded file, the download time and other factors, and the image is bound to the feature code. When an employee opens a file, the feature code is requested through the image, and the gateway can receive the terminal IP address that opens the file and the specific file that is opened. File leakage can be discovered through abnormal IPs, and the responsibility of the leaker can be traced. Summary of the invention

[0003] In view of the defects in the above-mentioned prior art, the present invention provides a method for preventing file leakage based on feature codes, comprising the following steps:

[0004] Step S101, receiving a download request from a user within a local area network;

[0005] Step S102: based on the download request, address the corresponding file from the corresponding file server;

[0006] Step S103, generating a feature code based on user information, file information, time information and event triggering script;

[0007] Step S104, embedding the feature code into a special picture with a pixel size of 1 to form a first special invisible picture;

[0008] Step S105, inserting a first special invisible picture into the file;

[0009] Step S106: Based on the first special invisible picture, determine whether the file is leaked.

[0010] Wherein, the step S103 includes: splicing the user information, file information, and time information into the first URL.

[0011] Wherein, the step S104 includes: using the least significant bit steganography to embed the feature code into a special picture with a pixel size of 1.

[0012] Assume there is a 1x1 pixel transparent PNG image with an initial RGB value of (0, 0, 0). The binary data i is encoded into the RGB value using:

[0013] Convert the feature code into binary data i;

[0014] Use R&0xFE to clear the lowest bit of the R channel;

[0015] Use int(binary_data[i 2], 2) Convert the first 2 bits of the binary data into a decimal number;

[0016] Use the "|" operator to encode this number into the lowest bit of the R channel;

[0017] The G and B channels are encoded in the same way, just to different channels.

[0018] Wherein, the step S105 includes: inserting the first special invisible picture in different ways based on different file types.

[0019] Wherein, when the file is a PDF file, the PDF file structure is parsed to find the position of the tail of the file;

[0020] encoding the first special invisible picture into a PDF compatible format to create a new PDF object;

[0021] The new PDF object is added to the end of the PDF file, and the cross-reference table and file end information are updated.

[0022] When the file is an Office document, the structure of the Office document is parsed to find a suitable position to insert the hidden data.

[0023] Encoding the first special invisible picture into a corresponding format to create a new custom attribute;

[0024] The new custom attribute is added to the metadata of the file, and the document information is updated.

[0025] Wherein, the step S106 specifically includes:

[0026] When generating the first URL, in addition to including information such as the file ID, user ID, and download time, a random session ID needs to be added;

[0027] When opening the file containing the first special invisible image, the browser will automatically initiate an HTTP request to the first URL.

[0028] Get the source IP address of the request;

[0029] The obtained IP address is recorded in the log and the corresponding event processing script is triggered according to the business rules.

[0030] The present invention also proposes a gateway for preventing file leakage based on feature codes, wherein the gateway comprises:

[0031] A receiving module, which is used to receive download requests from users within the local area network;

[0032] An addressing module, used for addressing a corresponding file from a corresponding file server based on the download request;

[0033] A signature generation module, which is used to generate signatures based on user information, file information, time information and event triggering scripts;

[0034] An embedding module, used for embedding the feature code into a special picture with a pixel size of 1 to form a first special invisible picture;

[0035] An inserting module, used for inserting a first special invisible picture into the file;

[0036] A judgment module is used to judge whether the file is leaked based on the first special invisible picture.

[0037] The present invention also proposes a file leakage prevention system based on feature codes, which comprises:

[0038] Such as the above-mentioned signature-based file leakage prevention gateway;

[0039] A file server is used to store files within a local area network.

[0040] Compared with the prior art, the present invention has the following advantages:

[0041] By embedding tiny images as carriers, the tracking code can be well hidden and not easily discovered.

[0042] When an employee opens the file, the image triggers a request to the signature URL, thus reliably detecting the file opening event.

[0043] By including file information, downloader information, etc. in the signature URL, complete file usage tracking data can be obtained.

[0044] Once a file leak is discovered, the source of the leak can be quickly located and the person responsible can be held accountable through abnormal IP addresses and other related information. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0046] Figure 1 The flowchart of the method for preventing file leakage based on feature codes according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. 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.

[0048] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.

[0049] It should be understood that although the terms first, second, third, etc. may be used to describe ... in the embodiments of the present invention, these ... should not be limited to these terms. These terms are only used to distinguish .... For example, without departing from the scope of the embodiments of the present invention, the first ... may also be referred to as the second ..., and similarly, the second ... may also be referred to as the first ....

[0050] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0051] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0052] It should also be noted that the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the commodity or device including the elements.

[0053] The optional embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0054] Embodiment 1

[0055] like Figure 1 As shown, the present invention discloses a method for preventing file leakage based on feature codes, comprising the following steps:

[0056] Step S101, receiving a download request from a user within a local area network;

[0057] Step S102: based on the download request, address the corresponding file from the corresponding file server;

[0058] Step S103, generating a feature code based on user information, file information, time information and event triggering script;

[0059] Step S104, embedding the feature code into a special picture with a pixel size of 1 to form a first special invisible picture;

[0060] Step S105, inserting a first special invisible picture into the file;

[0061] Step S106: Based on the first special invisible picture, determine whether the file is leaked.

[0062] Embodiment 2

[0063] The method for preventing file leakage based on feature codes proposed by the present invention comprises the following steps:

[0064] Step S101, receiving a download request from a user within a local area network;

[0065] Step S102: based on the download request, address the corresponding file from the corresponding file server;

[0066] Step S103, generating a feature code based on user information, file information, time information and event triggering script;

[0067] Step S104, embedding the feature code into a special picture with a pixel size of 1 to form a first special invisible picture;

[0068] Step S105, inserting a first special invisible picture into the file;

[0069] Step S106: Based on the first special invisible picture, determine whether the file is leaked.

[0070] Wherein, the step S103 includes: splicing the user information, file information, and time information into the first URL.

[0071] Wherein, the step S104 comprises: using the least significant bit steganography to embed the feature code into a special picture with a pixel size of 1.

[0072] In one embodiment, assuming that there is a Word document that needs to add tracking information, the gateway will generate a hidden image according to the following steps:

[0073] The gateway will generate a 1x1 pixel transparent PNG image. This extremely small size image is almost invisible to the naked eye.

[0074] In the pixel data of this image, the gateway will encode hidden information, such as:

[0075] File signature: 128-bit unique identifier

[0076] Download time: 2023-08-15 10:23:45

[0077] Downloader: John Smith

[0078] The gateway will use a special encoding method to hide the above information in the pixel data of the image.

[0079] For example, the least significant bit (LSB) steganography can be used to bury information in the lowest bit of the RGB value of each pixel.

[0080] This method can hide large amounts of data without changing the overall appearance of the image.

[0081] After encoding, the gateway will get a 1x1 pixel transparent PNG image.

[0082] This image looks like an ordinary transparent image to the naked eye, but it actually contains file tracking information.

[0083] Assume there is a 1x1 pixel transparent PNG image with an initial RGB value of (0, 0, 0). The binary data i is encoded into the RGB value using:

[0084] Convert the feature code into binary data i;

[0085] Use R&0xFE to clear the lowest bit of the R channel;

[0086] Use int(binary_data[i 2], 2) Convert the first 2 bits of the binary data into a decimal number;

[0087] Use the "|" operator to encode this number into the lowest bit of the R channel;

[0088] The G and B channels are encoded in the same way, just to different channels.

[0089] In one embodiment, assume that the following binary data needs to be encoded:

[0090] File signature (128-bit UUID): '12345678-90ab-cdef-1234-567890abcdef'

[0091] Download time (2023-08-15 10:23:45): '2023-08-15 10:23:45'

[0092] Download user (John Smith): 'John Smith'

[0093] Convert this information into binary form:

[0094] File signature (128-bit UUID):

[0095] based on binary_file_id = ''.join([bin(int(x, 16))[2:].zfill(8) for x infile_id.replace('-', '')])

[0096] get

[0097] binary_file_id = '000100010011001000101011001010111000101011110011110100010001010001 001000110100010101110001010111110000100101100001010001110100111101'

[0098] Download time (August 15, 2023 10:23:45):

[0099] Based on binary_download_time = ''.join([bin(ord(char))[2:].zfill(8) forchar in download_time])

[0100] get

[0101] binary_download_time = '001100100001100101011101100001000101010100001000010100010101100101010001'

[0102] Downloading User (John Smith):

[0103] binary_user_name = ''.join([bin(ord(char))[2:].zfill(8) for char inuser_name])

[0104] get

[0105] binary_user_name = '010010000110111101101110001000000101011101101111001000000100100101110011'

[0106] Assume there is a 1x1 pixel transparent PNG image with an initial RGB value of (0, 0, 0). We can use the following formula to encode binary data into RGB values:

[0107] R = (R&0xFE) | int(binary_data[i twenty two)

[0108] G = (G&0xFE) | int(binary_data[i 2+1], 2)

[0109] B = (B&0xFE) | int(binary_data[i 2+2], 2)

[0110] Among them, binary_data is the binary data to be encoded, and i is the current encoding position.

[0111] First, use R&0xFE to clear the lowest bit of the R channel to 0. This is to ensure that we only modify the lowest bit and do not affect other bits.

[0112] Then, use int(binary_data[i 2], 2) Convert the first 2 digits of the binary data to a decimal number.

[0113] Finally, this number is encoded into the least significant bit of the R channel using the "|" operator.

[0114] The G and B channels are encoded in the same way, just to different channels.

[0115] For example, the first byte of the file signature '00010001' can be encoded as follows:

[0116] R = (R&0xFE) | int('00', 2) = (R&0xFE) | 0 = R

[0117] G = (G&0xFE) | int('01', 2) = (G&0xFE) | 1 = G + 1

[0118] B = (B&0xFE) | int('00', 2) = (B&0xFE) | 0 = B

[0119] By analogy, all binary data can be encoded into the RGB value of the image. The final image contains the hidden tracking information.

[0120] Wherein, the step S105 includes: inserting the first special invisible picture in different ways based on different file types.

[0121] Wherein, when the file is a PDF file, the PDF file structure is parsed to find the position of the tail of the file;

[0122] encoding the first special invisible picture into a PDF compatible format to create a new PDF object;

[0123] The new PDF object is added to the end of the PDF file, and the cross-reference table and file end information are updated.

[0124] The structure of a PDF file includes a file header, main content, a cross-reference table, and a file footer.

[0125] Add a new data segment at the end of the file to store the image data. This data segment can be a custom object, such as PDF annotations or metadata.

[0126] The specific steps include:

[0127] Parse the PDF file structure and find the end of the file.

[0128] Creates a new PDF object, encoding the image data into a PDF-compatible format (such as JPEG or PNG).

[0129] Add this new object to the end of the PDF file and update the cross-reference table and file trailer information.

[0130] This method can hide data without destroying the structure of the PDF file. Parsing software can ignore the hidden data, while regular PDF viewers can still open the file normally.

[0131] When the file is an Office document, the structure of the Office document is parsed to find a suitable position to insert the hidden data.

[0132] Encode the first special invisible picture into a corresponding format (such as Base64) to create a new custom attribute;

[0133] The new custom attribute is added to the metadata of the file, and the document information is updated.

[0134] In some embodiments, three common Office file types, Word, PPT and Excel, are used as examples to illustrate how the gateway embeds special invisible images.

[0135] Pictures, tables, headers and footers in Word documents are all suitable embedding locations.

[0136] The gateway can add a hidden image object in the blank area, margin or footer of the document. This image object can be a very small transparent PNG image that is almost invisible to the naked eye.

[0137] In this image, the gateway can encode hidden signatures, timestamps, etc. The format and content of the Word document will not be affected.

[0138] Slide backgrounds, headers and footers, and some less conspicuous graphic elements in PowerPoint are all suitable embedding locations.

[0139] The gateway can add a tiny image object to the edge of the slide and encode hidden information in it, which will neither affect the aesthetics of the slide nor interfere with the presentation of the content.

[0140] Some PPTs also support hiding slides, and the gateway can also use this method to add hidden tracking images.

[0141] Cell borders, headers and footers, worksheet backgrounds and other locations in Excel can be used to embed special pictures.

[0142] The gateway can insert a very small image object in the blank area of ​​the table and hide the relevant tracking information in it. Since the image is very small, it will not attract the user's attention.

[0143] If the Excel file contains a chart, the gateway may also consider adding a hidden picture element in the chart area.

[0144] Wherein, the step S106 specifically includes:

[0145] When generating the first URL, in addition to including information such as the file ID, user ID, and download time, a random session ID needs to be added;

[0146] When opening the file containing the first special invisible image, the browser will automatically initiate an HTTP request to the first URL.

[0147] Get the source IP address of the request;

[0148] The obtained IP address is recorded in the log and the corresponding event processing script is triggered according to the business rules.

[0149] Once these abnormal situations are discovered, the file gateway can promptly alert the administrator and provide relevant traceability information, such as the file downloader, opener, IP address, etc.

[0150] When these external users open the confidential file using abnormal IP addresses, the file gateway will receive a notification.

[0151] The file gateway detects this abnormal behavior, such as:

[0152] File access from unexpected or unfamiliar IP addresses;

[0153] A large number of different IP addresses access the same file in a short period of time.

[0154] Once such an abnormal situation is discovered, the file gateway will immediately send a security alarm to the administrator and provide relevant traceability information, including:

[0155] Information about the downloader of the file;

[0156] Information about visitors with unusual IP addresses;

[0157] Time and frequency of file access, etc.

[0158] After receiving the alarm, the administrator can immediately take appropriate security measures, such as:

[0159] Investigate the source of file downloads and outbound transmissions;

[0160] Assess potential risks of information leakage;

[0161] Take further security reinforcement measures.

[0162] Embodiment 3

[0163] The present invention also proposes a gateway for preventing file leakage based on feature codes, wherein the gateway comprises:

[0164] A receiving module, which is used to receive download requests from users within the local area network;

[0165] An addressing module, used for addressing a corresponding file from a corresponding file server based on the download request;

[0166] A signature generation module, which is used to generate signatures based on user information, file information, time information and event triggering scripts;

[0167] An embedding module, used for embedding the feature code into a special picture with a pixel size of 1 to form a first special invisible picture;

[0168] An inserting module, used for inserting a first special invisible picture into the file;

[0169] A judgment module is used to judge whether the file is leaked based on the first special invisible picture.

[0170] Embodiment 4

[0171] The present invention also proposes a file leakage prevention system based on feature codes, which includes:

[0172] Such as the above-mentioned signature-based file leakage prevention gateway;

[0173] A file server is used to store files within a local area network.

[0174] Embodiment 5

[0175] An embodiment of the present disclosure provides a non-volatile computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the method steps described in the above embodiment.

[0176] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0177] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0178] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (AN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0179] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0180] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0181] The above introduces the preferred embodiments of the present invention, which is intended to make the spirit of the present invention clearer and easier to understand, but is not intended to limit the present invention. All modifications, substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection outlined by the claims attached to the present invention.

Claims

1. A method for preventing file leakage based on feature codes, characterized in that: The method comprises the following steps: Step S101, receiving a download request from a user within a local area network; Step S102: based on the download request, address the corresponding file from the corresponding file server; Step S103, generating a feature code based on user information, file information, time information and event triggering script; Step S104, embedding the feature code into a special picture with a pixel size of 1 to form a first special invisible picture; Step S105, inserting a first special invisible picture into the file; Step S106: judging whether the file is leaked based on the first special invisible picture; The step S106 specifically includes: When generating a signature URL, in addition to the file ID, user ID, and download time information, a random session ID needs to be added; When opening a file containing the first special invisible image, the browser will automatically initiate an HTTP request to the feature code URL. Get the source IP address of the request; The obtained IP address is recorded in the log and the corresponding event processing script is triggered according to the business rules.

2. The method for preventing file leakage based on feature codes as claimed in claim 1, characterized in that: The step S103 includes: splicing the user information, file information, and time information into the first URL.

3. The method for preventing file leakage based on feature codes as claimed in claim 2, characterized in that: The step S104 includes: using the least significant bit steganography to embed the feature code into a special picture with a pixel size of 1.

4. The method for preventing file leakage based on feature codes as claimed in claim 3, characterized in that: Assume there is a 1x1 pixel transparent PNG image whose initial RGB value is (0, 0, 0). Use the following method to encode the binary data i into the RGB value: Convert the feature code into binary data i; Use R & 0xFE to clear the lowest bit of the R channel; Use int(binary_data[i 2], 2) Convert the first 2 bits of the binary data into a decimal number; Use the "|" operator to encode this number into the least significant bit of the R channel; The G and B channels are encoded in the same way, just to different channels.

5. The method for preventing file leakage based on feature codes as claimed in claim 1, characterized in that: The step S105 includes: inserting the first special invisible picture in different ways based on different file types.

6. The method for preventing file leakage based on feature codes as claimed in claim 5, characterized in that: When the file is a PDF file, the PDF file structure is parsed to find the position of the tail of the file; encoding the first special invisible picture into a PDF compatible format to create a new PDF object; The new PDF object is added to the end of the PDF file, and the cross-reference table and file end information are updated.

7. The method for preventing file leakage based on feature codes as claimed in claim 5, characterized in that: When the file is an Office document, parsing the structure of the Office document to find a suitable position to insert the hidden data; Encoding the first special invisible picture into a corresponding format to create a new custom attribute; The new custom attribute is added to the metadata of the file, and the document information is updated.

8. A gateway for preventing file leakage based on feature codes, characterized in that: Using the method according to any one of claims 1 to 7, the gateway comprises: A receiving module, which is used to receive download requests from users within the local area network; An addressing module, used for addressing a corresponding file from a corresponding file server based on the download request; A signature generation module, which is used to generate signatures based on user information, file information, time information and event triggering scripts; An embedding module, used for embedding the feature code into a special picture with a pixel size of 1 to form a first special invisible picture; An inserting module, used for inserting a first special invisible picture into the file; A judgment module is used to judge whether the file is leaked based on the first special invisible picture.

9. A file leakage prevention system based on feature codes, characterized in that: The system comprises: The gateway for preventing file leakage based on feature codes as claimed in claim 8; A file server is used to store files within a local area network.