A method, system and medium for adding file traces

By adding custom attributes or tags to the email according to the file type, recording the company name, sender and sending time, the problem that traditional watermarking technology cannot add traces to multiple file types is solved, and traces to multiple files are achieved Adding and traceability queries reduces the risk of leaking confidential documents in enterprises.

CN112966231BActive Publication Date: 2025-01-17BEIJING WONDERSOFT TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110135522.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-01
Publication Date
2025-01-17
Estimated Expiration
2041-02-01

AI Technical Summary

Technical Problem

Traditional file watermarking technology is limited to certain file formats, cannot add traces to multiple file types, and cannot trace the path of file leakage.

Method used

By extracting basic information of the email, adding custom attributes, tags or nodes to the email according to the file type, recording the company name, sender, recipient and sending time, breaking through the file format limitations, and making multiple file types (such as Doc, xlsx, ppt, jpg, MP3, flac, etc.) add traces and deliver them through the mail proxy server.

Benefits of technology

It realizes the addition of traces of multiple file types, reduces the risk of leaking confidential files in enterprises, provides an effective traceability query method, and avoids the limitations of traditional watermarks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112966231B_ABST
    Figure CN112966231B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system and medium for adding file traces. The method comprises: step S1, extracting basic information of a first email, wherein the first email is an email sent from an enterprise's sending server; step S2, determining the file types of a second email and the files contained in the second email from the first email based on the basic information, wherein the second email is an email to which file traces are to be added; and step S3, adding the file traces to the files contained in the second email according to the file types of the files contained in the second email; wherein the file traces are the enterprise name of the enterprise, the sender, the recipient, and the sending time of the second email. The method adds file traces to files in emails without affecting the normal display of the files, thereby reducing the risk of leakage of confidential enterprise files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of file processing, and in particular to a method, system and medium for adding file traces. Background Art

[0002] The trace system refers to a system that purposefully scans email attachments, matches the attachment format information, and adds traces to the attachments if the format matches. Sensitive emails refer to emails that have been found to have attachments that hit the trace system policy after scanning the traces. Mysql is a lightweight relational database management system developed by Swedish MySQL AB and currently owned by Oracle. Currently, MySQL is widely used in small and medium-sized websites on the Internet; it stores data in different tables instead of putting all data in a large warehouse, which increases speed and flexibility. It has the advantages of small size, fast speed, low cost, open source, and free.

[0003] When companies send emails, files involving company secrets are often leaked. The traditional approach is to add watermarks to the files before sending them. However, watermarks usually only exist in word and pdf documents, which has great limitations. In addition, the files cannot be traced. Through the watermark, we can only know that the file is a confidential file of the company, but we cannot trace who leaked the file and when. Summary of the invention

[0004] The purpose of the present invention is to provide a solution for adding file traces to solve the technical problems in the prior art that the file format is limited and the source of confidential files cannot be traced after being leaked.

[0005] A first aspect of the present invention provides a method for adding file traces, the method comprising: step S1, extracting basic information of a first email, the first email being an email sent from an enterprise's sending server; step S2, determining, based on the basic information, from the first email, the file types of the files contained in a second email and the second email, the second email being the email to which file traces are to be added; and step S3, adding the file traces to the files contained in the second email according to the file types of the files contained in the second email; wherein the file traces are the enterprise name of the enterprise, the sender, recipient, and sending time of the second email.

[0006] According to the method provided by the first aspect of the present invention, in the step S1, the first email is recursively parsed to extract the basic information, which includes: the recipient and sender of the first email; and the file type of the file contained in the first email.

[0007] According to the method provided in the first aspect of the present invention, in step S2, when the recipient and sender of the first email are not in the whitelist set by the enterprise, and when the file type of the file contained in the first email supports adding the file trace, the first email is determined to be the second email.

[0008] According to the method provided by the first aspect of the present invention, in step S3, when the file type of the file included in the second email is the first file type, a custom attribute is added to the file included in the second email, the attribute name of the custom attribute is the company name, and the attribute value is the sender, recipient, and sending time of the second email, wherein the first file type includes pdf, xlsx, xls, docx, doc, pptx, ppt, tif and bmp; when the file type of the file included in the second email is the second file type, a new file tag is set for the file included in the second email, the tag name of the file tag is the company name, and the tag value is the sender, recipient, and sending time of the second email, wherein the second file type includes mp3 and flac; and when the file type of the file included in the second email is the third file type, a custom node is added to the file included in the second email, the node name of the custom node is the company name, and the node value is the sender, recipient, and sending time of the second email, wherein the third file type includes gif, png and jpg.

[0009] According to the method provided in the first aspect of the present invention, the method further includes: step S4, replacing the file included in the second email with the file to which the file trace is added, and delivering the file through the email proxy server of the enterprise.

[0010] A second aspect of the present invention provides a system for adding file traces, the system comprising: an extraction unit configured to extract basic information of a first email, the first email being an email sent from an enterprise's sending server; a determination unit configured to determine, based on the basic information, from a second email and the file types of files contained in the second email, the second email being the email to which file traces are to be added; and an adding unit configured to add the file traces to the files contained in the second email according to the file types of the files contained in the second email; wherein the file traces are the enterprise name of the enterprise, the sender, recipient, and sending time of the second email.

[0011] According to the system provided by the second aspect of the present invention, wherein: the extraction unit is specifically configured to recursively parse the first email to extract the basic information, and the basic information includes: the recipient and sender of the first email; and the file type of the file contained in the first email; the determination unit is specifically configured to determine the first email as the second email when the recipient and sender of the first email are not in the whitelist set by the enterprise and when the file type of the file contained in the first email supports adding the file trace.

[0012] According to the system provided by the second aspect of the present invention, the adding unit is specifically configured to: when the file type of the file included in the second email is the first file type, add a custom attribute to the file included in the second email, the attribute name of the custom attribute is the company name, and the attribute value is the sender, recipient, and sending time of the second email, wherein the first file type includes pdf, xlsx, xls, docx, doc, pptx, ppt, tif and bmp; when the file type of the file included in the second email is the second file type, set a new file tag for the file included in the second email, the tag name of the file tag is the company name, and the tag value is the sender, recipient, and sending time of the second email, wherein the second file type includes mp3 and flac; and when the file type of the file included in the second email is the third file type, add a custom node to the file included in the second email, the node name of the custom node is the company name, and the node value is the sender, recipient, and sending time of the second email, wherein the third file type includes gif, png and jpg.

[0013] According to the system provided by the second aspect of the present invention, the system further comprises: a delivery unit configured to replace the file included in the second email with a file to which the file trace is added, and deliver the file through the email proxy server of the enterprise.

[0014] A third aspect of the present invention provides a non-transitory computer-readable medium storing instructions, which, when executed by a processor, executes the steps of a method for adding file traces according to the first aspect of the present invention.

[0015] The above technical solution solves the problems caused by traditional watermarks by adding traces to files. It breaks through the limitations of file formats and can add traces to 14 types of files such as doc, xlsx, ppt, jpg, MP3, flac, etc. In addition, without affecting the normal display of the file, the trace can be used to query when and to whom the file was delivered through the mailbox. This solution reduces the risk of leakage of corporate confidential documents and can provide an effective and feasible query method when corporate confidential documents are leaked. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 A flowchart of a method for adding file traces according to an embodiment of the present invention; and

[0018] Figure 2 The figure is a structural diagram of a system for adding file traces according to an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of 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.

[0020] A first aspect of the present invention provides a method for adding a file trace. Figure 1 Flow chart of a method for adding file traces according to an embodiment of the present invention. Figure 1 As shown, the process starts with step S1, extracting basic information of a first email, where the first email is an email sent from an outgoing email server of an enterprise. Specifically, in step S1, the first email is recursively parsed to extract the basic information, which includes: the recipient and sender of the first email; and the file type of the file contained in the first email.

[0021] In some embodiments, the email (first email) is delivered from the enterprise's sending server to the trace system through network configuration. When it arrives at the trace system, the email will be parsed first. Email parsing is to recursively unload the eml file. Unloading the package is to read the eml file as a Message type, get the Content attribute from the Message, and judge the Content. If the Content type is Multipart, we think it is still a small package. Continue to recursively call this method until the Content type is Part type. At this time, get the various parts of the email from the Part type, such as attachments and body, store the parsed attachments in the local hard disk, and cache the basic information of the email in the memory.

[0022] Next, in step S2, based on the basic information, the file types of the second email and the file contained in the second email are determined from the first email, and the second email is the email to which the file trace is to be added. Specifically, in step S2, when the recipient and sender of the first email are not in the whitelist set by the enterprise, and when the file type of the file contained in the first email supports adding the file trace, the first email is determined to be the second email.

[0023] In some embodiments, if the sender or recipient of the first email is not in the whitelist configured by the enterprise, and the file type of the file contained in the first email does not support adding traces, the first email is determined as the second email, that is, the email to be added with file traces. Otherwise, the trace system will not process the email in any way and directly deliver the email through the email proxy server.

[0024] Then, in step S3, the file trace is added to the file contained in the second email according to the file type of the file contained in the second email; wherein the file trace is the company name of the enterprise, the sender, recipient, and sending time of the second email.

[0025] If it is determined in the previous step that traces need to be added, then the original email is backed up first, and then the basic information of the email is retrieved from the memory, and then the corresponding trace adding method is called according to the file type. The trace adding methods corresponding to each file type are as follows:

[0026] When the file type of the file included in the second email is the first file type, a custom attribute is added to the file included in the second email, the attribute name of the custom attribute is the company name, and the attribute value is the sender, recipient, and sending time of the second email, wherein the first file type includes pdf, xlsx, xls, docx, doc, pptx, ppt, tif and bmp.

[0027] pdf:

[0028] The pdf type file is read through the file stream as PdfReader, and the PdfStamper object is created through PdfReader. The PdfStamper object can add custom attributes to the pdf file. The name of the attribute is set to the company name, and the value of the attribute is set to "sender + recipient + sending time". In this way, when you need to read the file trace, you can get the corresponding information through the attribute name.

[0029] xlsx:

[0030] Read the xlsx file as a Workbook object through the file path (the Workbook object can add custom properties in the xlsx file), set the name of the property to the company name, and set the value of the property to "sender + recipient + sending time". In this way, when you need to read the file trace, you can get the corresponding information through the property name.

[0031] xls:

[0032] The xls type file is read as HSSFWorkbook through the file stream. The HSSFWorkbook object can add custom attributes in the xls file. The attribute name is set to the company name, and the attribute value is set to "sender + recipient + sending time". In this way, when you need to read the file trace, you can get the corresponding information through the attribute name.

[0033] docx:

[0034] Read the docx file as an XWPFDocument object through the file path (the XWPFDocument object can add custom attributes in the docx file), set the attribute name to the company name, and set the attribute value to "sender + recipient + sending time". In this way, when you need to read the file trace, you can get the corresponding information through the attribute name.

[0035] doc:

[0036] The doc file is read as a Document object through the file path (the Document object can add custom attributes in the doc file), the attribute name is set to the company name, and the attribute value is set to "sender + recipient + sending time". In this way, when you need to read the file trace, you can get the corresponding information through the attribute name.

[0037] pptx:

[0038] Read the pptx file as an XWPFDocument object through the file path (the XWPFDocument object can add custom attributes in the pptx file), set the attribute name to the company name, and set the attribute value to "sender + recipient + sending time". In this way, when you need to read the file trace, you can get the corresponding information through the attribute name.

[0039] ppt:

[0040] Read the ppt file as an XWPFDocument object through the file path (the XWPFDocument object can add custom attributes in the ppt file), set the attribute name to the company name, and set the attribute value to "sender + recipient + sending time". In this way, when you need to read the file trace, you can get the corresponding information through the attribute name.

[0041] tif:

[0042] Read the tif file through the path using the FileInputStream stream, obtain the fileCacheRandomAccessInputStream stream through FileInputStream, and obtain the TIFFImage object through the fileCacheRandomAccessInputStream stream (the TIFFImage object can add custom attributes in the tif file). The name of the attribute is set to the company name, and the value of the attribute is set to "sender + recipient + sending time". In this way, when you need to read the file trace, you can get the corresponding information through the attribute name.

[0043] bmp:

[0044] Read the bmp file as a BufferedImage object through the path, convert the attribute name and attribute value to be saved into an int array, and write the array into the lowest bit of the pixel component to save the file trace.

[0045] When the file type of the file contained in the second email is the second file type, a new file tag is set for the file contained in the second email, the tag name of the file tag is the company name, and the tag value is the sender, recipient, and sending time of the second email, wherein the second file type includes mp3 and flac.

[0046] mp3:

[0047] Read the mp3 file as an MP3File object through the file path, obtain the original file tag in the MP3File as tag, add a new tag to the file tag, set the tag name to the company name, and set the tag value to "sender + recipient + sending time". In this way, when you need to read the file trace, you can get the corresponding information through the tag name.

[0048] flac:

[0049] Read the flac file as an AudioFile object in the form of a file stream through the file path, obtain the original file tag in the AudioFile as tag, add a new tag to the file tag, set the tag name to the company name, and set the tag value to "sender + recipient + sending time". In this way, when you need to read the file trace, you can get the corresponding information through the tag name.

[0050] When the file type of the file included in the second email is the third file type, a custom node is added to the file included in the second email, the node name of the custom node is the enterprise name, and the node value is the sender, recipient, and sending time of the second email, wherein the third file type includes gif, png and jpg.

[0051] gif:

[0052] Read the gif file as a BufferedImage object through the path, and then create an IIOMetadata object corresponding to the gif type. In IIOMetadata, we can set a custom IIOMetadataNode node, set the node name to the company name, and the node value to "sender + recipient + sending time", and then store the node in the IIOMetadata object. Finally, write buffImg and metadata to the hard disk through IIOImage, so that when you need to read the file trace, you can get the corresponding information through the nodes in IIOMetadata.

[0053] png:

[0054] Read the gif file as a BufferedImage object through the path, and then create an IIOMetadata object corresponding to the gif type. In IIOMetadata, we can set a custom IIOMetadataNode node, set the node name to the company name, and the node value to "sender + recipient + sending time", and then store the node in the IIOMetadata object. Finally, write buffImg and metadata to the hard disk through IIOImage, so that when you need to read the file trace, you can get the corresponding information through the nodes in IIOMetadata.

[0055] jpg:

[0056] Read the jpg file as a BufferedImage object through the path, and then create an IIOMetadata object corresponding to the jpg type. In IIOMetadata, we can set a custom IIOMetadataNode node, set the node name to the company name, and the node value to "sender + recipient + sending time". Then store the node in the IIOMetadata object, and finally write buffImg and metadata to the hard disk through IIOImage. In this way, when you need to read the file trace, you can get the corresponding information through the nodes in IIOMetadata.

[0057] Finally, the method further includes: step S4, replacing the file included in the second email with the file to which the file trace is added, and delivering the file through the email proxy server of the enterprise.

[0058] In some embodiments, after the traces of the relevant attachments are added in the previous step, the attachments in the original email are replaced with new files, and then the email is delivered through the email proxy server. If the email delivery fails, the return information obtained by the email proxy server will be stored in the database, waiting for the scheduled task to deliver again.

[0059] A second aspect of the present invention provides a system for adding file traces. Figure 2 FIG. 4 is a structural diagram of a system for adding file traces according to an embodiment of the present invention. Figure 2As shown, the system 200 includes: an extraction unit 201, configured to extract basic information of a first email, wherein the first email is an email sent from an enterprise's sending server; a determination unit 202, configured to determine, based on the basic information, a second email and a file type of a file contained in the second email from the first email, wherein the second email is an email to which a file trace is to be added; and an adding unit 203, configured to add the file trace to the file contained in the second email according to the file type of the file contained in the second email; wherein the file trace is the enterprise name of the enterprise, the sender, the recipient, and the sending time of the second email.

[0060] According to the system provided by the second aspect of the present invention, wherein: the extraction unit 201 is specifically configured to recursively parse the first email to extract the basic information, and the basic information includes: the recipient and sender of the first email; and the file type of the file contained in the first email; the determination unit 202 is specifically configured to determine the first email as the second email when the recipient and sender of the first email are not in the whitelist set by the enterprise and when the file type of the file contained in the first email supports adding the file trace.

[0061] According to the system provided by the second aspect of the present invention, the adding unit 203 is specifically configured to: when the file type of the file included in the second email is the first file type, add a custom attribute to the file included in the second email, the attribute name of the custom attribute is the company name, and the attribute value is the sender, recipient, and sending time of the second email, wherein the first file type includes pdf, xlsx, xls, docx, doc, pptx, ppt, tif and bmp; when the file type of the file included in the second email is the second file type, set a new file tag for the file included in the second email, the tag name of the file tag is the company name, and the tag value is the sender, recipient, and sending time of the second email, wherein the second file type includes mp3 and flac; and when the file type of the file included in the second email is the third file type, add a custom node to the file included in the second email, the node name of the custom node is the company name, and the node value is the sender, recipient, and sending time of the second email, wherein the third file type includes gif, png and jpg.

[0062] According to the system provided by the second aspect of the present invention, the system further includes: a delivery unit 204 configured to replace the file included in the second email with the file to which the file trace is added, and deliver the file through the mail proxy server of the enterprise.

[0063] A third aspect of the present invention provides a non-transitory computer-readable medium storing instructions, which, when executed by a processor, executes the steps of a method for adding file traces according to the first aspect of the present invention.

[0064] In summary, the various aspects of the present disclosure solve the problems caused by traditional watermarks by adding traces to files. It breaks through the limitations of file formats and can add traces to 14 types of files such as doc, xlsx, ppt, jpg, MP3, flac, etc. In addition, without affecting the normal display of the file, the trace can be used to query when and to whom the file was delivered through the mailbox. This solution reduces the risk of leakage of corporate confidential files and can provide an effective and feasible query method when corporate confidential files are leaked.

[0065] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for adding file traces, characterized in that: The method comprises: Step S1, extracting basic information of a first email, wherein the first email is an email sent from an enterprise's sending server, and the basic information includes: a recipient and a sender of the first email; and a file type of a file contained in the first email, wherein the first email is an email sent from an enterprise's sending server, and after parsing the email, recursively unpacking the eml file and reading it as a Message type, obtaining a Content attribute from the Message, and obtaining a Part type through a recursive method; Step S2: based on the basic information, determining the file types of the second email and the file contained in the second email from the first email, the second email being the email to which a file trace is to be added, and when the recipient and sender of the first email are not in the whitelist set by the enterprise, and when the file type of the file contained in the first email supports adding the file trace, determining the first email as the second email; and Step S3, adding the file trace to the file contained in the second email according to the file type of the file contained in the second email, and when the file type of the file contained in the second email is the first file type, adding a custom attribute to the file contained in the second email, the attribute name of the custom attribute is the company name, and the attribute value is the sender, recipient, and sending time of the second email, wherein the first file type includes pdf, xlsx, xls, docx, doc, pptx, ppt, tif and bmp; When the file type of the file included in the second email is a second file type, setting a new file tag for the file included in the second email, wherein the tag name of the file tag is the company name, and the tag value is the sender, recipient, and sending time of the second email, wherein the second file type includes mp3 and flac; and When the file type of the file included in the second email is a third file type, adding a custom node to the file included in the second email, the node name of the custom node being the enterprise name, and the node value being the sender, recipient, and sending time of the second email, wherein the third file type includes gif, png, and jpg; The file traces include the name of the enterprise, the sender, the recipient, and the sending time of the second email.

2. The method for adding file traces according to claim 1, characterized in that: The method further includes: step S4, replacing the file included in the second email with the file to which the file trace is added, and delivering the file through the email proxy server of the enterprise.

3. A system for adding file traces, characterized in that: The system comprises: The extraction unit is configured to extract basic information of a first email, wherein the first email is an email sent from an enterprise's sending server, and the basic information includes: a recipient and a sender of the first email; and a file type of a file contained in the first email, wherein the first email is an email sent from the enterprise's sending server, and after parsing the email, recursively unpack the eml file and read it as a Message type, obtain a Content attribute from the Message, and obtain a Part type through a recursive method; a determining unit configured to, based on the basic information, determine from the first email a second email and a file type of a file contained in the second email, the second email being an email to which a file trace is to be added, and when a recipient and a sender of the first email are not in a whitelist set by an enterprise and when the file type of the file contained in the first email supports adding the file trace, determine the first email as the second email; and an adding unit configured to, according to a file type of the file contained in the second email, add the file trace to the file contained in the second email, and when the file type of the file contained in the second email is a first file type, add a custom attribute to the file contained in the second email, wherein the attribute name of the custom attribute is the company name, and the attribute value is the sender, recipient, and sending time of the second email, wherein the first file type includes pdf, xlsx, xls, docx, doc, pptx, ppt, tif, and bmp; When the file type of the file included in the second email is a second file type, setting a new file tag for the file included in the second email, wherein the tag name of the file tag is the company name, and the tag value is the sender, recipient, and sending time of the second email, wherein the second file type includes mp3 and flac; and When the file type of the file included in the second email is a third file type, adding a custom node to the file included in the second email, the node name of the custom node being the enterprise name, and the node value being the sender, recipient, and sending time of the second email, wherein the third file type includes gif, png, and jpg; The file traces include the name of the enterprise, the sender, the recipient, and the sending time of the second email.

4. The system for adding file traces according to claim 3, characterized in that: The system further includes: a delivery unit configured to replace the file included in the second email with the file to which the file trace is added, and deliver the file through the email proxy server of the enterprise.

5. A non-transitory computer-readable medium storing instructions, which, when executed by a processor, executes the steps in the method for adding file traces according to any one of claims 1-2.

Citation Information

Patent Citations

  • Method and device for sending mail, memory medium and processor thereof

    CN111147360A