CN104657629A - Document copyright protection method and device - Google Patents
Document copyright protection method and device Download PDFInfo
- Publication number
- CN104657629A CN104657629A CN201310597940.9A CN201310597940A CN104657629A CN 104657629 A CN104657629 A CN 104657629A CN 201310597940 A CN201310597940 A CN 201310597940A CN 104657629 A CN104657629 A CN 104657629A
- Authority
- CN
- China
- Prior art keywords
- file
- side device
- fragment
- sequence
- terminal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/10—Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/21—Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/2107—File encryption
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Technology Law (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
Abstract
本发明公开了一种文件版权保护方法和设备。在本发明中,对于服务器端设备:对原始文件进行碎片乱序化处理,并记录处理后的乱序文件中各碎片文件在原始文件中的位置;生成碎片顺序文件,并将该碎片顺序文件根据预设算法插入到乱序文件中,且在该乱序文件中添加该碎片顺序文件的大小;将乱序文件下发给终端侧设备。对于终端侧设备:接收服务器端设备下发的乱序文件;根据预设算法,以及乱序文件中携带的碎片顺序文件的大小从乱序文件中获取对应的碎片顺序文件;根据碎片顺序文件将乱序文件恢复为原始文件,提高了文件的安全性。
The invention discloses a file copyright protection method and equipment. In the present invention, for the server-side device: perform fragmentation out-of-sequence processing on the original file, and record the position of each fragment file in the original file in the out-of-order file after processing; generate a fragment order file, and store the fragment order file Insert it into the out-of-sequence file according to a preset algorithm, and add the size of the fragment sequence file to the out-of-order file; and send the out-of-order file to the terminal side device. For the terminal side device: receive the out-of-order file sent by the server-side device; obtain the corresponding fragment order file from the out-of-order file according to the preset algorithm and the size of the fragment order file carried in the out-of-order file; The out-of-sequence files are restored to the original files, which improves the security of the files.
Description
技术领域technical field
本发明涉及通信技术领域,尤其涉及一种文件版权保护方法和设备。The invention relates to the technical field of communications, in particular to a file copyright protection method and device.
背景技术Background technique
目前需要数字版权保护的内容主要采用DRM(Digital Right Management,数字权限管理)解决方案。DRM是又可以称为“内容数字版权加密保护技术”,是目前应用最广泛的内容版权保护技术。其主要针对文件在使用过程中的版权保护,打击盗版,保护版权所有者的合法权益。At present, the content that needs digital copyright protection mainly adopts DRM (Digital Right Management, digital rights management) solution. DRM is also called "content digital copyright encryption protection technology", which is the most widely used content copyright protection technology at present. It is mainly aimed at copyright protection during the use of files, combating piracy, and protecting the legitimate rights and interests of copyright owners.
现有DRM解决方案中,存在如下缺点:In the existing DRM solution, there are the following disadvantages:
1、DRM方案比较复杂,需要在服务器侧以及终端侧部署较复杂的DRM系统;1. The DRM solution is more complicated, and a more complicated DRM system needs to be deployed on the server side and the terminal side;
2、DRM加密方案针对文件整体加密,在并发高的系统中有较大的效率问题。2. The DRM encryption scheme is aimed at encrypting the entire file, which has a greater efficiency problem in a system with high concurrency.
发明内容Contents of the invention
本发明提供了一种文件版权保护方法和设备,用于提高文件的安全性。The invention provides a file copyright protection method and equipment for improving file security.
为了达到以上目的,本发明实施例提供了一种文件版权保护方法,包括:In order to achieve the above purpose, the embodiment of the present invention provides a file copyright protection method, including:
服务器端设备对原始文件进行碎片乱序化处理,并记录处理后的乱序文件中各碎片文件在原始文件中的位置;The server-side device performs fragmentation out-of-sequence processing on the original file, and records the position of each fragment file in the original file in the processed out-of-order file;
所述服务器端设备生成碎片顺序文件,所述碎片顺序文件中包括所述乱序文件中各碎片文件在原始文件中的位置、原始文件大小,以及碎片文件大小;其中,所述乱序文件中各碎片文件大小相同;The server-side device generates a fragment sequence file, which includes the position of each fragment file in the original file, the size of the original file, and the size of the fragment file in the disorder file; wherein, in the disorder file Each fragment file has the same size;
所述服务器端设备将所述碎片顺序文件根据预设算法插入到所述乱序文件中,并在所述乱序文件中添加所述碎片顺序文件的大小;The server-side device inserts the fragment sequence file into the out-of-order file according to a preset algorithm, and adds the size of the fragment sequence file in the out-of-order file;
所述服务器端设备将该乱序文件下发给终端侧设备。The server-side device sends the out-of-sequence file to the terminal-side device.
本发明实施例还提供了一种文件版权保护方法,包括:The embodiment of the present invention also provides a file copyright protection method, including:
终端侧设备接收服务器端设备下发的乱序文件;The terminal-side device receives the out-of-sequence files sent by the server-side device;
所述终端侧设备根据预设算法,以及所述乱序文件中携带的碎片顺序文件的大小从所述乱序文件中获取对应的碎片顺序文件,所述顺序碎片文件中包括所述乱序文件中各碎片文件在原始文件中的位置、原始文件大小,以及碎片文件大小;其中,所述乱序文件中各碎片文件大小相同;The terminal side device acquires the corresponding fragment sequence file from the disorder file according to a preset algorithm and the size of the fragment sequence file carried in the disorder file, and the sequence fragment file includes the sequence fragment file The position of each fragmented file in the original file, the size of the original file, and the size of the fragmented file; wherein, the size of each fragmented file in the disordered file is the same;
所述终端侧设备根据所述碎片顺序文件将所述乱序文件恢复为原始文件。The terminal-side device restores the out-of-sequence file to an original file according to the fragment sequence file.
本发明实施例还提供了一种服务器端设备,包括:The embodiment of the present invention also provides a server-side device, including:
第一处理模块,用于对原始文件进行碎片乱序化处理;The first processing module is used to perform fragmentation out-of-sequence processing on the original file;
记录模块,用于记录处理后的乱序文件中各碎片文件在原始文件中的位置;A recording module, configured to record the position of each fragmented file in the original file in the processed out-of-sequence file;
生成模块,用于生成碎片顺序文件,所述碎片顺序文件中包括所述乱序文件中各碎片文件在原始文件中的位置、原始文件大小,以及碎片文件大小;其中,所述乱序文件中各碎片文件大小相同;A generating module, configured to generate a fragment sequence file, the fragment sequence file including the position of each fragment file in the original file, the size of the original file, and the size of the fragment file in the disordered file; wherein, in the disordered file Each fragment file has the same size;
第二处理模块,用于将所述碎片顺序文件根据预设算法插入到所述乱序文件中,并在所述乱序文件中添加所述碎片顺序文件的大小;The second processing module is used to insert the fragment sequence file into the out-of-order file according to a preset algorithm, and add the size of the fragment sequence file in the out-of-order file;
发送模块,用于将对应乱序文件下发给所述终端侧设备。A sending module, configured to send the corresponding out-of-sequence file to the terminal-side device.
本发明实施例还提供了一种终端侧设备,包括:The embodiment of the present invention also provides a terminal side device, including:
接收模块,用于接收服务器端设备下发的乱序文件;The receiving module is used to receive the out-of-sequence files sent by the server-side device;
获取模块,用于根据预设算法,以及所述乱序文件中携带的碎片顺序文件的大小从所述乱序文件中获取对应的碎片顺序文件,所述顺序碎片文件中包括所述乱序文件中各碎片文件在原始文件中的位置、原始文件大小,以及碎片文件大小;其中,所述乱序文件中各碎片文件大小相同;An acquisition module, configured to acquire a corresponding fragment sequence file from the disorder file according to a preset algorithm and the size of the fragment sequence file carried in the disorder file, the sequence fragment file including the disorder file The position of each fragmented file in the original file, the size of the original file, and the size of the fragmented file; wherein, the size of each fragmented file in the disordered file is the same;
处理模块,根据所述碎片顺序文件将所述乱序文件恢复为原始文件。A processing module restores the out-of-sequence file to the original file according to the fragment sequence file.
本发明上述实施例中,对于服务器端设备:对原始文件进行碎片乱序化处理,并记录乱序文件中各碎片文件在原始文件中的位置;生成碎片顺序文件,并将该碎片顺序文件根据预设算法插入到乱序文件中,且在该乱序文件中添加该碎片顺序文件的大小;将乱序文件下发给终端侧设备。对于终端侧设备:接收服务器端设备下发的乱序文件;根据预设算法,以及乱序文件中携带的碎片顺序文件的大小从乱序文件中获取对应的碎片顺序文件;根据碎片顺序文件将乱序文件恢复为原始文件,方案实现更加简单,安全性更高。In the foregoing embodiments of the present invention, for the server-side device: perform fragmentation out-of-sequence processing on the original file, and record the position of each fragment file in the original file in the out-of-order file; generate a fragment order file, and store the fragment order file according to The preset algorithm is inserted into the out-of-sequence file, and the size of the fragment sequence file is added to the out-of-order file; and the out-of-order file is sent to the terminal side device. For the terminal side device: receive the out-of-order file sent by the server-side device; obtain the corresponding fragment order file from the out-of-order file according to the preset algorithm and the size of the fragment order file carried in the out-of-order file; The out-of-sequence files are restored to the original files, and the implementation of the solution is simpler and the security is higher.
附图说明Description of drawings
图1为本发明实施例提供的一种文件版权保护方法的流程示意图;Fig. 1 is a schematic flow chart of a file copyright protection method provided by an embodiment of the present invention;
图2为本发明实施例提供的另一种文件版权保护方法的流程示意图;FIG. 2 is a schematic flow diagram of another file copyright protection method provided by an embodiment of the present invention;
图3为本发明实施例提供的另一种文件版权保护方法的流程示意图;FIG. 3 is a schematic flow diagram of another file copyright protection method provided by an embodiment of the present invention;
图4为本发明实施例提供的另一种文件版权保护方法的流程示意图;FIG. 4 is a schematic flowchart of another file copyright protection method provided by an embodiment of the present invention;
图5a为本发明实施例提供的一种服务器端设备将原始文件处理为乱序文件的示意图;Fig. 5a is a schematic diagram of processing an original file into an out-of-sequence file by a server-side device provided by an embodiment of the present invention;
图5b为本发明实施例提供的一种终端侧设备将乱序文件恢复为原始文件的示意图;FIG. 5b is a schematic diagram of restoring an out-of-sequence file to an original file by a terminal-side device according to an embodiment of the present invention;
图6为本发明实施例提供的一种服务器端设备的结构示意图;FIG. 6 is a schematic structural diagram of a server-side device provided by an embodiment of the present invention;
图7为本发明实施例提供的一种终端侧设备的结构示意图。FIG. 7 is a schematic structural diagram of a terminal-side device provided by an embodiment of the present invention.
具体实施方式Detailed ways
针对上述现有技术中存在的问题,本发明实施例提供了一种文件版权保护的技术方案。在该技术方案中,对于服务器端设备:对原始文件进行碎片乱序化处理,并记录处理后的乱序文件中各碎片文件在原始文件中的位置;生成碎片顺序文件,并将该碎片顺序文件根据预设算法插入到乱序文件中,且在该乱序文件中添加该碎片顺序文件的大小;将乱序文件下发给终端侧设备。对于终端侧设备:接收服务器端设备下发的乱序文件;根据预设算法,以及乱序文件中携带的碎片顺序文件的大小从乱序文件中获取对应的碎片顺序文件;根据碎片顺序文件将乱序文件恢复为原始文件。Aiming at the above-mentioned problems in the prior art, the embodiment of the present invention provides a technical solution for file copyright protection. In this technical solution, for the server-side device: perform fragmentation out-of-sequence processing on the original file, and record the position of each fragment file in the original file in the processed out-of-order file; generate a fragment order file, and store the fragment order The file is inserted into the out-of-sequence file according to a preset algorithm, and the size of the fragment sequence file is added to the out-of-order file; the out-of-order file is sent to the terminal side device. For the terminal side device: receive the out-of-order file sent by the server-side device; obtain the corresponding fragment order file from the out-of-order file according to the preset algorithm and the size of the fragment order file carried in the out-of-order file; The out-of-sequence files are restored to the original files.
其中,在本发明实施例中,碎片顺序文件中可以包括乱序文件中各碎片文件在原始文件中的位置、原始文件大小,以及碎片文件大小等;乱序文件中各碎片文件大小相同。Wherein, in the embodiment of the present invention, the fragment sequence file may include the position of each fragment file in the original file in the out-of-order file, the size of the original file, and the size of the fragment file; the size of each fragment file in the out-of-order file is the same.
下面将结合本申请中的附图,对本申请中的技术方案进行清楚、完整的描述,显然,所描述的实施例是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Apparently, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in the present application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present application.
实施例一Embodiment one
该实施例为本发明实施例提供的文件版权保护的技术方案在服务器端设备侧的处理流程。This embodiment is the processing flow of the technical solution for file copyright protection provided by the embodiment of the present invention on the side of the server-end device.
如图1所示,为本发明实施例提供的一种文件版权保护方法的流程示意图,可以包括以下步骤:As shown in FIG. 1, it is a schematic flowchart of a file copyright protection method provided by an embodiment of the present invention, which may include the following steps:
步骤101、服务器端设备对原始文件进行碎片乱序化处理,并记录处理后的乱序文件中各碎片文件在原始文件中的位置。Step 101, the server-side device performs fragmentation out-of-sequence processing on the original file, and records the position of each fragment file in the original file in the out-of-order file after processing.
具体的,考虑到文件是由一系列有序的二进制比特流组成的,每种文件格式都有自己特定的文件格式和架构,在本发明实施例中,服务器端设备可以对原始文件进行碎片乱序化处理的方式,将原始文件以N个字节为一组(N可以根据文件大小和服务器端设备性能取值,如2K、4K、8K等),化分成若干组(每组即为一个碎片文件),并将这些碎片文件的位置随机打乱,重新排序,同时记录处理后(即碎片乱序化处理后)的文件中各碎片文件在原始文件中的位置。其中,乱序文件中各碎片文件的大小相同。Specifically, considering that a file is composed of a series of ordered binary bit streams, and each file format has its own specific file format and structure, in the embodiment of the present invention, the server-side device can perform fragmentation on the original file. The way of sequential processing is to divide the original file into a group of N bytes (N can be set according to the file size and the performance of the server-side device, such as 2K, 4K, 8K, etc.), and divide it into several groups (each group is a Fragmented files), and the positions of these fragmented files are randomly scrambled, reordered, and the position of each fragmented file in the original file in the processed (ie, fragmented out-of-sequence processing) file is recorded. Wherein, the size of each fragmented file in the out-of-sequence file is the same.
步骤102、服务器端设备生成碎片顺序文件。其中,该碎片顺序文件中包括乱序文件中各碎片文件在原始文件中的位置、原始文件大小,以及碎片文件大小。Step 102, the server-side device generates a sequence file of fragments. Wherein, the fragment sequence file includes the position of each fragment file in the original file, the size of the original file, and the size of the fragment file in the out-of-order file.
具体的,在本发明实施例中,服务器端设备对原始文件进行碎片乱序化处理后,可以根据原始文件大小、碎片文件大小,以及乱序文件中各碎片文件在原始文件中的位置生成碎片顺序文件。Specifically, in the embodiment of the present invention, after the server-side device performs fragmentation out-of-sequence processing on the original file, fragments can be generated according to the size of the original file, the size of the fragmented files, and the position of each fragmented file in the original file. sequential files.
其中,该碎片顺序文件中可以以字节序列的方式记录乱序文件中各碎片文件在原始文件中的位置。Wherein, the fragment sequence file may record the position of each fragment file in the original file in a byte sequence.
假设原始文件大小为100K个字节,服务器端设备对该原始文件进行碎片乱序化处理时,将该原始文件以4K个字节为一组划分为25个碎片文件,并将各碎片文件的位置随机打乱,重新排序。则服务器端设备生成的顺序文件碎片中可以以一个25个字节长度的字节序列记录乱序文件中各碎片文件在原始文件中的位置。例如,假设该25个字节长度的字节序列中的第1个字节为“00000111”,则表明乱序文件中的第1个碎片文件在原始文件中的位置为7(即乱序文件中的第1个碎片文件为原始文件按4K字节为一组进行碎片划分后的第7个碎片文件)。Assuming that the size of the original file is 100K bytes, when the server-side device fragments the original file, it divides the original file into 25 fragment files in groups of 4K bytes, and divides the fragment files into 25 fragment files. The positions are randomly shuffled and reordered. Then, in the sequence file fragments generated by the server-side device, the position of each fragment file in the out-of-order file in the original file can be recorded in a byte sequence with a length of 25 bytes. For example, assuming that the first byte in the 25-byte byte sequence is "00000111", it indicates that the position of the first fragmented file in the out-of-order file is 7 in the original file (that is, out-of-order file The first fragment file in is the seventh fragment file after the original file is divided into fragments in groups of 4K bytes).
应该认识到,上述通过字节序列记录乱序文件中的碎片文件在原文件中的位置的方式仅仅是本发明实施例提供的技术方案中的一种具体实现方式,而并不是对本发明保护范围的限定,基于本发明实施例,本领域技术人员在不付出创造性劳动前提下,想到的其他记录乱序文件中的碎片文件在原文件中的位置的方式均应在本发明的保护范围中。It should be recognized that the above method of recording the position of fragmented files in the original file in the out-of-sequence file through the byte sequence is only a specific implementation of the technical solution provided by the embodiment of the present invention, and is not a limitation of the protection scope of the present invention. Restriction: Based on the embodiment of the present invention, other ways of recording the position of the fragmented files in the original file in the out-of-order file conceived by those skilled in the art without making creative efforts shall fall within the protection scope of the present invention.
步骤103、服务器端设备将碎片顺序文件根据预设算法插入到乱序文件中,并在该乱序文件中添加碎片顺序文件的大小。Step 103, the server-side device inserts the fragment sequence file into the out-of-order file according to a preset algorithm, and adds the size of the fragment sequence file to the out-of-order file.
具体的,在本发明实施例中,在对原始文件进行了碎片化乱序处理,并生成了碎片顺序文件后,服务器端设备可以根据预设算法将该碎片顺序文件插入到乱序文件中,并在该乱序文件中添加碎片顺序文件的大小。Specifically, in the embodiment of the present invention, after performing fragmentation and out-of-order processing on the original file and generating the fragment sequence file, the server-side device can insert the fragment sequence file into the out-of-order file according to a preset algorithm, And add the size of the fragment sequence file in the out-of-sequence file.
其中,该预设算法可以由服务器端设备和终端侧设备协商确定。例如,该预设算法可以为在乱序文件中的第20个字节处开始插入碎片顺序文件。Wherein, the preset algorithm may be determined through negotiation between the server-side device and the terminal-side device. For example, the preset algorithm may be to start inserting the fragment sequence file at the 20th byte in the out-of-order file.
步骤104、服务器端设备将该乱序文件下发给终端侧设备。Step 104, the server-side device sends the out-of-sequence file to the terminal-side device.
具体的,终端侧设备的接收到该乱序文件后,可以根据预先协商确定的算法从乱序文件中读取出碎片顺序文件,并根据碎片顺序文件将乱序文件恢复为原始文件。Specifically, after receiving the out-of-sequence file, the terminal-side device can read out the fragment sequence file from the out-of-order file according to an algorithm determined in advance through negotiation, and restore the out-of-order file to the original file according to the fragment sequence file.
实施例二Embodiment two
为了进一步提高安全性,在该实施例中,服务器端设备生成碎片顺序文件后,可以对该碎片顺序文件进行加密。相应地,服务器端设备将碎片顺序文件插入到乱序文件中时,插入的为加密后的碎片顺序文件。In order to further improve security, in this embodiment, after the server-side device generates the fragment sequence file, it may encrypt the fragment sequence file. Correspondingly, when the server-side device inserts the fragment sequence file into the random sequence file, the encrypted fragment sequence file is inserted.
如图2所示,为本发明实施例提供的另一种文件版权保护方法的流程示意图,可以包括以下步骤:As shown in FIG. 2, it is a schematic flowchart of another file copyright protection method provided by the embodiment of the present invention, which may include the following steps:
步骤201、服务器端设备对原始文件进行碎片乱序化处理,并记录处理后的乱序文件中各碎片文件在原始文件中的位置。Step 201, the server-side device performs fragmentation out-of-sequence processing on the original file, and records the position of each fragmented file in the original file in the processed out-of-order file.
步骤202、服务器端设备生成碎片顺序文件。其中,该碎片顺序文件中包括乱序文件中各碎片文件在原始文件中的位置、原始文件大小,以及碎片文件大小。Step 202, the server-side device generates a sequence file of fragments. Wherein, the fragment sequence file includes the position of each fragment file in the original file, the size of the original file, and the size of the fragment file in the out-of-order file.
步骤203、服务器端设备对该碎片顺序文件进行加密,并将加密后的碎片顺序文件(在本发明实施例中也可以称为证书文件)根据预设算法插入到乱序文件中,并在该乱序文件中添加加密后的碎片顺序文件的大小。Step 203: The server-side device encrypts the fragment sequence file, and inserts the encrypted fragment sequence file (also referred to as a certificate file in the embodiment of the present invention) into the random sequence file according to a preset algorithm, and The size of the encrypted fragment sequence file added to the random file.
具体的,在该实施例中,为了进一步提高安全性,可以对碎片顺序文件进行加密,该加密的密钥可以是网络侧设备与终端侧设备预先协商的,如用户名、密码、或终端ID等信息。Specifically, in this embodiment, in order to further improve security, the fragment sequence file can be encrypted, and the encryption key can be pre-negotiated between the network side device and the terminal side device, such as user name, password, or terminal ID and other information.
其中,对于不同的终端侧设备(或用户),加密密钥可以不同,也可以相同。Wherein, for different terminal-side devices (or users), the encryption keys may be different or the same.
当对于不同的终端侧设备,加密密钥不同时,当服务器端设备接收到终端侧设备发送的文件下载请求时,可以根据该文件下载请求中携带的终端侧设备的标识信息确定对应该终端侧设备的加密密钥,并使用该终端侧设备对应的加密密钥对碎片顺序文件进行加密,并将加密后的碎片顺序文件插入到乱序文件中,下发给终端侧设备。例如,该加密密钥可以为终端侧设备注册时使用的用户名,当终端侧设备想要下载文件时,需要先使用注册时使用的用户名和密码进行登录。服务器端设备接收到登录后的终端侧设备发送的文件下载请求后,使用该终端侧设备注册时使用的用户名对碎片顺序文件进行加密,并将加密后的碎片顺序文件插入到乱序文件中,下发给终端侧设备。When the encryption keys are different for different terminal-side devices, when the server-side device receives the file download request sent by the terminal-side device, it can determine the corresponding terminal-side device according to the identification information of the terminal-side device carried in the file download request. The encryption key of the device, and use the encryption key corresponding to the terminal-side device to encrypt the fragment sequence file, insert the encrypted fragment sequence file into the random sequence file, and send it to the terminal-side device. For example, the encryption key may be the user name used when the terminal-side device is registered. When the terminal-side device wants to download files, it needs to log in with the user name and password used during registration. After the server-side device receives the file download request sent by the logged-in terminal-side device, it encrypts the fragment sequence file with the user name used for registration of the terminal-side device, and inserts the encrypted fragment sequence file into the disordered file , and send it to the terminal-side device.
在该情况下,当发生文件泄露时,可以根据所使用的加密密钥确定该文件泄露的源头。In this case, when a file is leaked, the source of the file leak can be determined according to the encryption key used.
当对于不同的终端侧设备,加密密钥相同时,服务器端设备可以预先对原始文件相应的碎片乱序化处理、生成碎片顺序文件、对碎片顺序文件进行加密,并将加密后的碎片顺序文件插入到乱序文件中。当接收到终端侧设备发送的文件下载请求时,将乱序文件下发给终端侧设备。When the encryption keys are the same for different terminal-side devices, the server-side device can pre-shuffle the corresponding fragments of the original file, generate a fragment sequence file, encrypt the fragment sequence file, and store the encrypted fragment sequence file inserted into the out-of-order file. When receiving the file download request sent by the terminal-side device, the out-of-sequence file is sent to the terminal-side device.
步骤204、服务器端设备将乱序文件下发给终端侧设备。Step 204, the server-side device sends the out-of-sequence file to the terminal-side device.
实施例三Embodiment three
该实施例为本发明实施例提供的文件版权保护的技术方案在服务器端设备侧的处理流程。This embodiment is the processing flow of the technical solution for file copyright protection provided by the embodiment of the present invention on the side of the server-end device.
如图3所示,为本发明实施例提供的一种文件版权保护方法的流程示意图,可以包括以下步骤:As shown in FIG. 3 , it is a schematic flowchart of a file copyright protection method provided by an embodiment of the present invention, which may include the following steps:
步骤301、终端侧设备接收服务器端设备下发的乱序文件。Step 301, the terminal-side device receives the out-of-sequence file delivered by the server-side device.
具体的,当终端侧设备想要下载文件时,可以向服务器端设备发送文件下载请求,并接收服务器端设备发送的乱序文件。其中,服务器端设备的文处理流程可以参见实施例一或实施例二中服务器端设备处理流程。Specifically, when the terminal-side device wants to download a file, it can send a file download request to the server-side device, and receive the out-of-sequence file sent by the server-side device. For the document processing flow of the server-side device, refer to the processing flow of the server-side device in Embodiment 1 or Embodiment 2.
步骤302、终端侧设备根据预设算法,以及乱序文件中携带的碎片顺序文件的大小从乱序文件中获取对应的碎片顺序文件。其中,该顺序碎片文件中包括乱序文件中各碎片文件在原始文件中的位置、原始文件大小,以及碎片文件大小;乱序文件中各碎片文件大小相同。Step 302, the terminal side device acquires the corresponding fragment sequence file from the disorder file according to the preset algorithm and the size of the fragment sequence file carried in the disorder file. Wherein, the sequence fragment file includes the position of each fragment file in the out-of-order file in the original file, the size of the original file, and the size of the fragment file; the size of each fragment file in the out-of-order file is the same.
具体的,终端侧设备接收到服务器端设备下发的乱序文件后,可以根据预设的算法(如从第K个字节处读取碎片顺序文件),以及乱序文件中携带的碎片顺序文件的大小从乱序文件中获取对应的碎片顺序文件。Specifically, after the terminal-side device receives the out-of-sequence file sent by the server-side device, it can use the preset algorithm (such as reading the fragment order file from the Kth byte) and the order of fragments carried in the out-of-order file The size of the file gets the corresponding fragment sequence file from the out-of-order file.
步骤303、终端侧设备根据碎片顺序文件将该乱序文件恢复为原始文件。Step 303, the terminal side device restores the out-of-sequence file to the original file according to the sequence file of fragments.
具体的,在该实施例中,终端侧设备获取到碎片顺序文件后,若该碎片顺序文件为未加密的文件,则该终端设备可以直接根据该碎片顺序文件中包括的乱序文件中各碎片文件在原始文件中的位置、原始文件大小,以及碎片文件大小将乱序文件恢复为原始文件。Specifically, in this embodiment, after the terminal-side device obtains the fragment sequence file, if the fragment sequence file is an unencrypted file, the terminal device can directly calculate The position of the file in the original file, the original file size, and the fragmented file size will restore the out-of-order file to the original file.
若该碎片顺序文件为加密文件,则该终端设备需要先使用预先与服务器端设备协商的加密密钥对该加密后的碎片顺序文件进行解密,并根据该解密后的碎片顺序文件将乱序文件恢复为原始文件。If the fragmented sequence file is an encrypted file, the terminal device needs to decrypt the encrypted fragmented sequence file using the encryption key negotiated with the server device in advance, and then decrypt the random file according to the decrypted fragmented sequence file Revert to the original file.
实施例四Embodiment four
进一步地,为了验证终端侧设备恢复得到原始文件是否正确,在该实施例中,服务器端设备生成的碎片顺序文件中还可以包括原始文件MD5散列值,以使终端侧设备根据该原始文件MD5散列值对恢复得到的原始文件进行验证。Further, in order to verify whether the original file recovered by the terminal-side device is correct, in this embodiment, the fragment sequence file generated by the server-side device may also include the original file MD5 hash value, so that the terminal-side device The hash value verifies the recovered original file.
如图4所示,为本发明实施例提供的另一种文件版权保护方法的流程示意图,可以包括以下步骤:As shown in FIG. 4 , it is a schematic flowchart of another file copyright protection method provided by the embodiment of the present invention, which may include the following steps:
步骤401、终端侧设备接收服务器端设备下发的乱序文件。Step 401, the terminal-side device receives the out-of-sequence file delivered by the server-side device.
步骤402、终端侧设备根据预设算法,以及乱序文件中携带的碎片顺序文件的大小从乱序文件中获取对应的碎片顺序文件。其中,该顺序碎片文件中包括乱序文件中各碎片文件在原始文件中的位置、原始文件大小、碎片文件大小,以及原始文件MD5散列值;乱序文件中各碎片文件大小相同。Step 402, the terminal side device acquires the corresponding fragment sequence file from the disorder file according to the preset algorithm and the size of the fragment sequence file carried in the disorder file. Wherein, the sequence fragment file includes the position of each fragment file in the out-of-order file in the original file, the size of the original file, the size of the fragment file, and the MD5 hash value of the original file; the size of each fragment file in the out-of-order file is the same.
步骤403、终端侧设备根据碎片顺序文件将该乱序文件恢复为原始文件。Step 403, the terminal side device restores the out-of-sequence file to the original file according to the fragment sequence file.
步骤404、终端侧设备根据碎片顺序文件中的原始文件MD5散列值对该原始文件进行校验。Step 404, the terminal side device verifies the original file according to the MD5 hash value of the original file in the fragment sequence file.
其中,本发明实施例中服务器端设备将原始文件处理为乱序文件,以及终端侧设备将乱序文件恢复为原始文件的示意图可以分别如图5a和5b所示。The schematic diagrams of the server-side device processing the original file into an out-of-order file and the terminal-side device restoring the out-of-order file into the original file in the embodiment of the present invention can be shown in Figures 5a and 5b respectively.
通过以上描述可以看出,在本发明实施例提供的技术方案中,对于服务器端设备:对原始文件进行碎片乱序化处理,并记录乱序文件中各碎片文件在原始文件中的位置;生成碎片顺序文件,并将该碎片顺序文件根据预设算法插入到乱序文件中,且在该乱序文件中添加该碎片顺序文件的大小;将乱序文件下发给终端侧设备。对于终端侧设备:接收服务器端设备下发的乱序文件;根据预设算法,以及乱序文件中携带的碎片顺序文件的大小从乱序文件中获取对应的碎片顺序文件;根据碎片顺序文件将乱序文件恢复为原始文件,方案实现更加简单,安全性更高。It can be seen from the above description that in the technical solution provided by the embodiment of the present invention, for the server-side device: perform fragmentation out-of-sequence processing on the original file, and record the position of each fragmented file in the original file in the out-of-order file; generate Fragment sequence file, and insert the fragment sequence file into the out-of-order file according to a preset algorithm, and add the size of the fragment sequence file in the out-of-order file; send the out-of-order file to the terminal side device. For the terminal side device: receive the out-of-order file sent by the server-side device; obtain the corresponding fragment order file from the out-of-order file according to the preset algorithm and the size of the fragment order file carried in the out-of-order file; The out-of-sequence files are restored to the original files, and the implementation of the solution is simpler and the security is higher.
基于相同的技术构思,本发明实施例还提供了一种服务器端设备,可以应用于上述方法实施例。Based on the same technical concept, the embodiment of the present invention also provides a server-side device, which can be applied to the above method embodiment.
实施例五Embodiment five
如图6所示,为本发明实施例提供的一种服务器端设备的结构示意图,可以包括:As shown in FIG. 6, it is a schematic structural diagram of a server-side device provided by an embodiment of the present invention, which may include:
第一处理模块61,用于对原始文件进行碎片乱序化处理;The first processing module 61 is configured to perform fragmentation out-of-sequence processing on the original file;
记录模块62,用于记录处理后的乱序文件中各碎片文件在原始文件中的位置;Recording module 62, for recording the position of each fragment file in the original file in the out-of-sequence file after processing;
生成模块63,用于生成碎片顺序文件,所述碎片顺序文件中包括所述乱序文件中各碎片文件在原始文件中的位置、原始文件大小,以及碎片文件大小;其中,所述乱序文件中各碎片文件大小相同;Generating module 63, is used for generating the sequence file of fragments, and includes the position in the original file of each fragment file in described out-of-sequence file, original file size, and fragmentation file size in the described fragment order file; Wherein, described out-of-sequence file The size of each fragment file in the file is the same;
第二处理模块64,用于将所述碎片顺序文件根据预设算法插入到所述乱序文件中,并在所述乱序文件中添加所述碎片顺序文件的大小;The second processing module 64 is configured to insert the fragmented sequence file into the disordered file according to a preset algorithm, and add the size of the fragmented sequence file to the disordered file;
发送模块65,用于将对应乱序文件下发给所述终端侧设备。The sending module 65 is configured to send the corresponding out-of-sequence file to the terminal side device.
其中,本发明实施例提供的服务器端设备还包括:Wherein, the server end device provided by the embodiment of the present invention also includes:
还包括:Also includes:
加密模块66,用于对所述碎片顺序文件进行加密;An encryption module 66, configured to encrypt the fragment sequence file;
所述第二处理模块64具体用于,将所述加密后的碎片顺序文件根据预设算法插入到所述乱序文件中,并在所述乱序文件中添加所述加密后的碎片顺序文件的大小。The second processing module 64 is specifically configured to insert the encrypted fragment sequence file into the disordered file according to a preset algorithm, and add the encrypted fragment sequence file to the disordered file the size of.
其中,对于不同的终端侧设备,所述服务器端设备对所述碎片顺序文件进行加密时使用的加密密钥相同;或,Wherein, for different terminal-side devices, the encryption key used by the server-side device to encrypt the fragment sequence file is the same; or,
对于不同的终端侧设备,所述服务器端设备对所述碎片顺序文件进行加密时使用的加密密钥不同。For different terminal-side devices, the server-side device uses different encryption keys when encrypting the fragment sequence file.
其中,当对于不同的终端侧设备,所述服务器端设备对所述碎片顺序文件进行加密时使用的加密密钥不同时,本发明实施例提供的服务器端设备还包括:Wherein, when the encryption keys used by the server-side device for encrypting the fragment sequence file are different for different terminal-side devices, the server-side device provided in the embodiment of the present invention further includes:
接收模块67,用于接收终端侧设备发送的文件下载请求,该文件下载请求携带有终端侧设备的标识信息;The receiving module 67 is configured to receive a file download request sent by the terminal-side device, the file download request carrying identification information of the terminal-side device;
所述加密模块66具体用于,根据所述终端侧设备的标识信息确定所述终端侧设备对应的加密密钥,并使用该加密密钥对所述碎片顺序文件进行加密。The encryption module 66 is specifically configured to determine an encryption key corresponding to the terminal-side device according to the identification information of the terminal-side device, and use the encryption key to encrypt the fragment sequence file.
基于相同的技术构思,本发明实施例还提供了一种终端侧设备,可以应用于上述方法实施例。Based on the same technical concept, embodiments of the present invention also provide a terminal-side device, which can be applied to the foregoing method embodiments.
实施例六Embodiment six
如图7所示,为本发明实施例提供的一种终端侧设备的结构示意图,可以包括:As shown in FIG. 7, it is a schematic structural diagram of a terminal-side device provided by an embodiment of the present invention, which may include:
接收模块71,用于接收服务器端设备下发的乱序文件;The receiving module 71 is configured to receive the out-of-sequence files issued by the server-side device;
获取模块72,用于根据预设算法,以及所述乱序文件中携带的碎片顺序文件的大小从所述乱序文件中获取对应的碎片顺序文件,所述顺序碎片文件中包括所述乱序文件中各碎片文件在原始文件中的位置、原始文件大小,以及碎片文件大小;其中,所述乱序文件中各碎片文件大小相同;The acquiring module 72 is configured to acquire a corresponding fragment sequence file from the disorder file according to a preset algorithm and the size of the fragment sequence file carried in the disorder file, and the sequence fragment file includes the disorder The position of each fragment file in the original file, the size of the original file, and the size of the fragment file in the file; wherein, the size of each fragment file in the disordered file is the same;
处理模块73,根据所述碎片顺序文件将所述乱序文件恢复为原始文件。The processing module 73 restores the out-of-sequence file to the original file according to the fragment sequence file.
其中,所述从乱序文件中获取到的碎片顺序文件为加密后的碎片顺序文件;Wherein, the fragment sequence file obtained from the out-of-order file is an encrypted fragment sequence file;
本发明实施例提供的终端侧设备还包括:The terminal-side device provided by the embodiment of the present invention further includes:
解密模块74,用于对所述加密后的碎片顺序文件进行解密;A decryption module 74, configured to decrypt the encrypted fragment sequence file;
所述处理模块73具体用于,根据所述解密后的碎片顺序文件将所述乱序文件恢复为原始文件。The processing module 73 is specifically configured to restore the out-of-sequence file to the original file according to the decrypted fragment sequence file.
其中,所述碎片顺序文件中还包括:原始文件MD5散列值;Wherein, the fragment sequence file also includes: the original file MD5 hash value;
所述处理模块73还用于,根据所述碎片顺序文件中的原始文件MD5散列值对所述原始文件进行校验。The processing module 73 is further configured to verify the original file according to the MD5 hash value of the original file in the fragment sequence file.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台终端设备(可以是手机,个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is a better implementation Way. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to make a A terminal device (which may be a mobile phone, a personal computer, a server, or a network device, etc.) executes the methods described in various embodiments of the present invention.
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that, for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications can also be made. It should be regarded as the protection scope of the present invention.
Claims (14)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310597940.9A CN104657629A (en) | 2013-11-22 | 2013-11-22 | Document copyright protection method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310597940.9A CN104657629A (en) | 2013-11-22 | 2013-11-22 | Document copyright protection method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN104657629A true CN104657629A (en) | 2015-05-27 |
Family
ID=53248743
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201310597940.9A Pending CN104657629A (en) | 2013-11-22 | 2013-11-22 | Document copyright protection method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN104657629A (en) |
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106991314A (en) * | 2016-01-20 | 2017-07-28 | 阿里巴巴集团控股有限公司 | A kind of date storage method and device |
| CN108038075A (en) * | 2017-12-07 | 2018-05-15 | 湖北三新文化传媒有限公司 | Methods of exhibiting, e-book reading device and the readable storage medium storing program for executing of e-book document |
| WO2019033751A1 (en) * | 2017-08-14 | 2019-02-21 | 北京奇虎科技有限公司 | Method and system for performing security processing on data file |
| CN110633575A (en) * | 2019-09-19 | 2019-12-31 | 腾讯云计算(北京)有限责任公司 | Data encryption method, device, equipment and storage medium |
| CN111698576A (en) * | 2020-06-23 | 2020-09-22 | 网易有道信息技术(杭州)有限公司 | Information encryption method, decryption method, server, client, and medium |
| CN113660258A (en) * | 2021-08-13 | 2021-11-16 | 重庆中科云从科技有限公司 | Method, system, medium, and apparatus for preventing file from being tampered during transmission |
| CN114553503A (en) * | 2022-01-29 | 2022-05-27 | 新华三云计算技术有限公司 | Network file synchronization method, device and equipment |
| CN116936041A (en) * | 2023-09-18 | 2023-10-24 | 天河超级计算淮海分中心 | Medical image file processing method, electronic equipment and storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101976317A (en) * | 2010-11-05 | 2011-02-16 | 北京世纪互联工程技术服务有限公司 | Virtual machine image safety method in private cloud computing application |
| CN102402670A (en) * | 2011-08-03 | 2012-04-04 | 广东欧珀移动通信有限公司 | File encryption and decryption method |
| CN102594920A (en) * | 2012-03-20 | 2012-07-18 | 广东凌康科技有限公司 | Remote data transmission system |
| CN102981879A (en) * | 2012-12-03 | 2013-03-20 | 中国联合网络通信集团有限公司 | Supply method, acquisition method, equipment and processing system of application software installation package |
-
2013
- 2013-11-22 CN CN201310597940.9A patent/CN104657629A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101976317A (en) * | 2010-11-05 | 2011-02-16 | 北京世纪互联工程技术服务有限公司 | Virtual machine image safety method in private cloud computing application |
| CN102402670A (en) * | 2011-08-03 | 2012-04-04 | 广东欧珀移动通信有限公司 | File encryption and decryption method |
| CN102594920A (en) * | 2012-03-20 | 2012-07-18 | 广东凌康科技有限公司 | Remote data transmission system |
| CN102981879A (en) * | 2012-12-03 | 2013-03-20 | 中国联合网络通信集团有限公司 | Supply method, acquisition method, equipment and processing system of application software installation package |
Cited By (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106991314A (en) * | 2016-01-20 | 2017-07-28 | 阿里巴巴集团控股有限公司 | A kind of date storage method and device |
| WO2019033751A1 (en) * | 2017-08-14 | 2019-02-21 | 北京奇虎科技有限公司 | Method and system for performing security processing on data file |
| CN108038075A (en) * | 2017-12-07 | 2018-05-15 | 湖北三新文化传媒有限公司 | Methods of exhibiting, e-book reading device and the readable storage medium storing program for executing of e-book document |
| CN110633575A (en) * | 2019-09-19 | 2019-12-31 | 腾讯云计算(北京)有限责任公司 | Data encryption method, device, equipment and storage medium |
| CN110633575B (en) * | 2019-09-19 | 2024-11-15 | 腾讯云计算(北京)有限责任公司 | Data encryption method, device, equipment and storage medium |
| CN111698576A (en) * | 2020-06-23 | 2020-09-22 | 网易有道信息技术(杭州)有限公司 | Information encryption method, decryption method, server, client, and medium |
| CN111698576B (en) * | 2020-06-23 | 2022-04-01 | 网易有道信息技术(杭州)有限公司 | Information encryption method, decryption method, server, client, and medium |
| CN113660258A (en) * | 2021-08-13 | 2021-11-16 | 重庆中科云从科技有限公司 | Method, system, medium, and apparatus for preventing file from being tampered during transmission |
| CN114553503A (en) * | 2022-01-29 | 2022-05-27 | 新华三云计算技术有限公司 | Network file synchronization method, device and equipment |
| CN116936041A (en) * | 2023-09-18 | 2023-10-24 | 天河超级计算淮海分中心 | Medical image file processing method, electronic equipment and storage medium |
| CN116936041B (en) * | 2023-09-18 | 2023-12-22 | 天河超级计算淮海分中心 | Medical image file processing method, electronic equipment and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104657629A (en) | Document copyright protection method and device | |
| CN110798315B (en) | Data processing method and device based on block chain and terminal | |
| US9735962B1 (en) | Three layer key wrapping for securing encryption keys in a data storage system | |
| US8831228B1 (en) | System and method for decentralized management of keys and policies | |
| CN102915263B (en) | A kind of data back up method, system and equipment | |
| CN104205123B (en) | Systems and methods for secure third-party data storage | |
| US9489520B2 (en) | Decryption and encryption of application data | |
| CN113557689B (en) | Initialize the data storage device with the manager device | |
| CN109040090A (en) | A kind of data ciphering method and device | |
| CN101977190B (en) | Digital content encryption transmission method and server side | |
| CN113383335B (en) | Security logging of data storage device events | |
| CN107659829A (en) | A kind of method and system of video-encryption | |
| CN102231744B (en) | media file protection method, system, media file server and terminal | |
| CN107153794A (en) | File encrypting method and device, file decryption method and apparatus | |
| CN105210079A (en) | Community-based deduplication for encrypted data | |
| WO2014180416A1 (en) | Method for file upload to cloud storage system, download method and device | |
| CN114175574A (en) | Wireless security protocol | |
| CN106878013A (en) | Method and device for encrypting and decrypting files | |
| WO2020044095A1 (en) | File encryption method and apparatus, device, terminal, server, and computer-readable storage medium | |
| WO2022048315A1 (en) | File encryption method, terminal, apparatus, device, and medium | |
| CN113626859B (en) | Method, system, equipment and medium for supporting encryption protection of key escrow personal file | |
| GB2488753A (en) | Encrypted communication | |
| CN112818404B (en) | Data access permission updating method, device, equipment and readable storage medium | |
| WO2014206370A1 (en) | Method and system for encrypting and decrypting coding file | |
| CN111107245A (en) | Efficient interrupt recoverable image hiding encryption transmission method, device and system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20150527 |