CN107977551A - A kind of method, apparatus and electronic equipment for protecting file - Google Patents
A kind of method, apparatus and electronic equipment for protecting file Download PDFInfo
- Publication number
- CN107977551A CN107977551A CN201610941488.7A CN201610941488A CN107977551A CN 107977551 A CN107977551 A CN 107977551A CN 201610941488 A CN201610941488 A CN 201610941488A CN 107977551 A CN107977551 A CN 107977551A
- Authority
- CN
- China
- Prior art keywords
- box
- file
- index
- write
- user data
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000013507 mapping Methods 0.000 claims abstract description 25
- 230000004048 modification Effects 0.000 claims description 6
- 238000012986 modification Methods 0.000 claims description 6
- 238000012545 processing Methods 0.000 claims description 4
- 230000005611 electricity Effects 0.000 claims description 3
- 238000005516 engineering process Methods 0.000 abstract description 6
- AWSBQWZZLBPUQH-UHFFFAOYSA-N mdat Chemical compound C1=C2CC(N)CCC2=CC2=C1OCO2 AWSBQWZZLBPUQH-UHFFFAOYSA-N 0.000 description 9
- 230000008859 change Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 3
- 238000005538 encapsulation Methods 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000006378 damage Effects 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 239000012530 fluid Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 210000003733 optic disk Anatomy 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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; CALCULATING OR 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]
- G06F21/106—Enforcing content protection by specific content processing
- G06F21/1063—Personalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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]
- G06F21/16—Program or content traceability, e.g. by watermarking
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 embodiment of the present invention discloses a kind of method, apparatus and electronic equipment for protecting file, is related to file security technology, can ensure the integrality of MP4 file contents.The method of the protection file includes:Obtain the index box included in file destination;Digital rights management information is write in user data box in the index box;The position of digital rights management information and the index box in the file destination according to write-in, updates mapping table box and block the offset box of the sample and block in the index box of the file destination;The file destination of renewal is digitally signed.The present invention is suitable for ensureing the integrality of MP4 file contents.
Description
Technical field
The present invention relates to file security technology, more particularly to a kind of method, apparatus and electronic equipment for protecting file.
Background technology
MP4 is a set of for audio, the compression and coding standard of video information, by International Organization for standardization (ISO) and the world
The dynamic image expert group (MPEG, Moving Picture Experts Group) of the electrician committee (IEC) subordinate is formulated,
MP4 files are a kind of media files being packaged based on ISO/IEC 14496-12 standards, compared to using other encapsulation format
The media file of encapsulation, for example, the media file such as RMVB, AVI, FLV, WMV, MKV, MP4 files have higher practicality and
Popularization, thus be widely used.
In order to effectively protect file, for example, the copyright of MP4 files, safeguard the legitimate interests of copyright owner, it is necessary to file into
Row content protecting, by taking MP4 files as an example, passes through afterbody extension addition digital copyright management (DRM, the Digital in MP4 files
Rights Management) information, for example, digital watermarking, digital encryption and digital certificate etc., to control file to use
Power, is then digitally signed the MP4 files that with the addition of DRM information, so as to carry out content protecting to MP4 files.
But the method for current protection file, after MP4 tail of file adds DRM information by extended mode, equivalent to
Original MP4 file formats have been changed, have destroyed MP4 file contents so that the integrality of MP4 file contents receives destruction;
Further, due to having changed original MP4 file formats so that playing end needs accordingly to be changed, and otherwise will be unable to just
MP4 files are often played, if in this way, the MP4 files encapsulated using the broadcasting of existing broadcasting end according to DRM format, are played successfully
Rate is relatively low.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of method, apparatus and electronic equipment for protecting file, can ensure
The integrality of MP4 file contents, to solve to lead, it is necessary to change original MP4 file formats in the method for existing protection file
The problem of integrality of the MP4 file contents of cause is destroyed.
In a first aspect, the embodiment of the present invention provides a kind of method for protecting file, including:
Obtain the index box included in file destination;
Digital rights management information is write in user data box in the index box;
The position of digital rights management information and the index box in the file destination according to write-in, renewal
Mapping table box and block the offset box of sample and block in the index box of the file destination;
The file destination of renewal is digitally signed.
With reference to first aspect, in the first embodiment of first aspect, the user in the index box
Digital rights management information is write in data box to be included:
If not searching user data box in the index box, user data is added in the index box
Box, and write digital rights management information in the user data box of addition;
If searching user data box in the index box, the residue of user data box searched is judged
Whether data length is greater than or equal to the length of the digital rights management information, if so, the number of users arrived in described search
According to writing digital rights management information in box;If it is not, adding user data box in the index box, and adding
Digital rights management information is write in the user data box added.
With reference to first aspect, in second of embodiment of first aspect, the user in the index box
Digital rights management information is write in data box to be included:
User data box is added in the index box, and digital publishing rights are write in the user data box of addition
Management information.
With reference to first aspect, in the third embodiment of first aspect, the digital copyright management according to write-in
The position of information and the index box in the file destination, updates the sample in the index box of the file destination
Include with mapping table box and block the offset box of block:
If the index box is located at the centre position of the file destination, the digital rights management information according to write-in
Length and position, update the file destination index box in sample and block mapping table box and block offset box
Son;
If the index box is located at the tail position of the file destination, in the index box of the file destination
Sample and block mapping table box and block offset box without modification.
With reference to first aspect, the first embodiment of first aspect or second of embodiment or the third embodiment party
Formula, in the 4th kind of embodiment of first aspect, the method further includes:
The file type box in file destination is parsed, file type field is obtained, if file type field is identified as
MP4 files, perform it is described obtain file destination in index box the step of;If file type field mark is not MP4 texts
Part, terminates flow.
Second aspect, the embodiment of the present invention provide a kind of device for protecting file, including:Index box acquisition module, write
Enter module, update module and Digital Signature module, wherein,
Box acquisition module is indexed, for obtaining the index box included in file destination;
Writing module, for writing digital rights management information in the user data box in the index box;
Update module, for the digital rights management information according to write-in and the index box in the file destination
In position, update the file destination index box in sample and block mapping table box and block offset box;
Digital Signature module, for being digitally signed to the file destination of renewal.
With reference to second aspect, in the first embodiment of second aspect, said write module includes:Search judges single
Member, box create unit, length determining unit and writing unit, wherein,
Judging unit is searched for, for judging whether search user data box in the index box, if so, logical
Length determining unit is known, if not, notice box creates unit;
Box creates unit, for adding user data box in the index box, and in the user data of addition
Digital rights management information is write in box;
Whether length determining unit, the remaining data length of the user data box for judging to search are greater than or equal to
The length of the digital rights management information, if so, notice writing unit, if not, notice box creates unit;
Writing unit, for described search to user data box in write digital rights management information.
With reference to second aspect, in second of embodiment of second aspect, said write module includes:Box addition is single
Member and information writing unit, wherein,
Box adding device, for adding user data box in the index box;
Information writing unit, for by the user data box of digital rights management information write-in addition.
With reference to second aspect, in the third embodiment of second aspect, the update module includes:Position judgment list
Member and updating block, wherein,
Position judgment unit, for judging whether the index box is located at the centre position of the file destination, if
It is to notify updating block;If not, do not deal with;
Updating block, length and position for the digital rights management information according to write-in, updates the file destination
Index box in sample and block mapping table box and block offset box.
With reference to the first embodiment of second aspect, second aspect or second of embodiment or the third embodiment party
Formula, in the 4th kind of embodiment of second aspect, described device further includes:
File type judgment module, for parsing the file type box in file destination, obtains file type field, such as
Fruit file type field is identified as MP4 files, perform it is described obtain in file destination index box the step of;If files classes
Type-word segment identification is not MP4 files, terminates flow.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, and the electronic equipment includes:Housing, processor, deposit
Reservoir, circuit board and power circuit, wherein, circuit board is placed in the interior volume that housing surrounds, and processor and memory are set
On circuit boards;Power circuit, for each circuit or the device power supply for above-mentioned electronic equipment;Memory is used to store and can hold
Line program code;The executable program code that processor is stored by reading in memory is run and executable program code pair
The program answered, the method for performing foregoing any protection file.
A kind of method, apparatus and electronic equipment for protecting file provided in an embodiment of the present invention, by obtaining file destination
In the index box that includes;Digital rights management information is write in user data box in the index box;Foundation is write
Position of the digital rights management information and the index box entered in the file destination, updates the file destination
Index mapping table box and block the offset box of the sample and block in box;The file destination of renewal is digitally signed,
The integrality of MP4 file contents can be ensured, to solve in the method for existing protection file, it is necessary to change original MP4 texts
The problem of integrality of MP4 file contents caused by part form is destroyed.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is attached drawing needed in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of invention, for those of ordinary skill in the art, without creative efforts, can be with
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the method flow schematic diagram that the embodiment of the present invention one protects file;
Fig. 2 is the apparatus structure schematic diagram that the embodiment of the present invention two protects file;
Fig. 3 is the structure diagram of electronic equipment one embodiment of the present invention.
Embodiment
The embodiment of the present invention is described in detail below in conjunction with the accompanying drawings.
It will be appreciated that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.Base
Embodiment in the present invention, those of ordinary skill in the art obtained without creative efforts it is all its
Its embodiment, belongs to the scope of protection of the invention.
Fig. 1 is the method flow schematic diagram that the embodiment of the present invention one protects file, as shown in Figure 1, the side of the present embodiment
Method can include:
Step 101, the index box included in file destination is obtained;
In the present embodiment, file destination includes three parts, is respectively:File header, data field and index block.
In the present embodiment, by taking file destination is MP4 files as an example, as an alternative embodiment, file header is located at MP4 files
Front end, data field is located at the middle-end of MP4 files, and index block is located at the rear end of MP4 files, i.e., MP4 files for a file header+
The structure of MDAT (data)+MOOV (index);
As another alternative embodiment, file header is located at the front end of MP4 files, and index block is located at the middle-end of MP4 files, number
It is located at the rear end of MP4 files according to area, i.e. MP4 files are the structure of file header+MOOV (index)+MDAT (data).
In file structure, MP4 files include one or more boxes (Box), and every Box is used and included length structure
And the atomic structure describing mode of file type (FTYP, File Type) structure.Wherein, before every Box in 8 bytes,
4 bytes are length field, and the length of identification load data (MDAT data), another 4 byte is file type field, identifies the target
The type of file (frame).Wherein,
File header is used as initial structure, file type box with file type box (FTYP Box, File Type Box)
Include file type field, this document type field is located at the initial position of file type box, for being identified as MP4 texts
Part, is the four-byte character code (FOURCC, Four-Character Code) of 4 bytes.Wherein, as an alternative embodiment, text
Part type field includes:File header tag mark, major version number, auxiliary version number and compatible version, length field include itself
The file header length of nybble.
(MDAT, Media Data) is multi-medium data for data field, i.e. the encapsulating structure of load data (uncorrected data), comprising
Actual data stream, for example, image and sound sequence data.The fluid data (multi-medium data) of MP4 files is included in MDAT
In box (Media Data Box).In one MP4 files, one or more MDAT boxes can be included, can not also be included
MDAT boxes (when media data all quotes alternative document).
Index block, that is, index box (MOOV Box, Movie Box), be one comprising codec parameters, frame time stamp, frame
The level index structure of the information such as offset, frame length, frame position, wherein, codec parameters compile solution for the audio and video of each track
Code information.
Table 1 illustrates table for the level of the MOOV Box of the present embodiment
Table 1
In table 1,
MOOV Box include Multilevel B ox for one, you can with the multiple Box of nested inside.Data bit in MOOV Box
Put in box (stbl BOX), include encoding and decoding time, timestamp and the position relationship of track, can by the stbl BOX
To inquire any one frame audio and video in MP4 files.
Unlisted user data box (udta Box), udta Box are represented with a fourCC " udta " in table 1.
The afterbody of MOOV Box is normally placed at, for filling in user information.
In the present embodiment, as an alternative embodiment, this method further includes:
The file type box in file destination is parsed, file type field is obtained, if file type field is identified as
MP4 files, perform it is described obtain file destination in index box the step of;If file type field mark is not MP4 texts
Part, terminates flow.
In the present embodiment, exemplified by only being protected to MP4 files, MP4 files are opened, read the file header of MP4 files,
Nybble identifier, key plate sheet, auxiliary version, compatible version are recognized, if meeting the type of pre-set standard document
Definition, then be effective MP4 files, otherwise directly exit, and does not carry out any modification to MP4 files.In this way, by parsing MP4
File type box in the file header of file, can obtain file type field, be determined according to the file type field obtained
Whether it is MP4 files.
Step 102, digital rights management information is write in the user data box in the index box;
In the present embodiment, as an alternative embodiment, numeral is write in the user data box in the index box
Copyright management information includes:
If not searching user data box in the index box, user data is added in the index box
Box, and write digital rights management information in the user data box of addition.
In the present embodiment, scanned in MOOV Box, if not searching udta Box in the search procedure,
Udta Box are added in MOOV Box, DRM information is added in the udta Box of addition.In follow-up, change in stbl Box
Stsc Box, the positional information of stco Box, and accordingly change the size of MOOV Box.
In the present embodiment, as another alternative embodiment, number is write in the user data box in the index box
Word copyright management information includes:
If searching user data box in the index box, the residue of user data box searched is judged
Whether data length is greater than or equal to the length of the digital rights management information, if so, the number of users arrived in described search
According to writing digital rights management information in box;If it is not, adding user data box in the index box, and adding
Digital rights management information is write in the user data box added.
In the present embodiment, if including udta Box in MOOV Box, the remaining space (remainder of udta Box is judged
According to length) whether can accommodate DRM information, if it is possible to accommodate, then new udta Box need not be created, directly by DRM information
It is added in the remaining space in udta Box;If DRM information length is more than the remaining data length of udta Box, create
New udta Box, DRM information are added in new udta Box.
In the present embodiment, as yet another alternative embodiment, for compatible existing user Box, can also no matter MOOV
Whether udta Box are included in Box, directly increase new udta Box, DRM information is added in new udta Box.
Step 103, according to the digital rights management information of write-in and the index box in the file destination
Position, updates mapping table box and block the offset box of the sample and block in the index box of the file destination;
In the present embodiment, as an alternative embodiment, digital rights management information and the index box according to write-in
Position of the son in the file destination, update the mapping table box of sample in the index box of the file destination and block with
And block offset box includes:
If the index box is located at the centre position of the file destination, the digital rights management information according to write-in
Length and position, update the file destination index box in sample and block mapping table box and block offset box
Son.
In the present embodiment, if file header is located at the front end of MP4 files, index block is located at the middle-end of MP4 files, data field
Positioned at the rear end of MP4 files, in write-in digital rights management information, it is necessary to the sample and the mapping watchcase of block in index box
The information field of sub (stsc Box) and block offset box (stco Box) is accordingly changed, and changes the big of MOOV Box
It is small.
It is as an alternative embodiment, the information field of block offset box (stco Box) is corresponding partially in the present embodiment
Shifting value adds the information field of the corresponding deviant of digital rights management information, covering or replacement block offset box (stco Box)
Corresponding deviant.
As another alternative embodiment, according to the digital rights management information of write-in and the index box in the mesh
The position in file is marked, updates mapping table box and block the offset box of the sample and block in the index box of the file destination
Attached bag includes:
If the index box is located at the tail position of the file destination, in the index box of the file destination
Sample and block mapping table box and block offset box without modification.
In the present embodiment, if file header is located at the front end of MP4 files, data field is located at the middle-end of MP4 files, index block
Positioned at the rear end of MP4 files, since index block is in the afterbody of whole file, it is not necessary to modify the phase in the stbl Box of MOOV Box
Information is closed, need to only add udta Box, the size of modification MOOV Box.
Step 104, the file destination of renewal is digitally signed.
In the present embodiment, as an alternative embodiment, MP4 files are digitally signed using the private key of DRM server.
In the present embodiment, digital signature data, the i.e. whole target to the addition of DRM information are added to whole file destination
File carries out signature processing, and as an alternative embodiment, signing messages is according to the form addition of free Box at file destination end
Tail, is known technology, detailed description is omitted here on being digitally signed.
In the present embodiment, the definition format program code segments of digital signature are as follows:
The method that the present embodiment protects file, by obtaining the index box included in file destination;In the index box
Digital rights management information is write in user data box in son;Digital rights management information and the rope according to write-in
Draw position of the box in the file destination, update the mapping watchcase of the sample and block in the index box of the file destination
Son and block offset box;The file destination of renewal is digitally signed.In this way, pass through the user data box in MP4 files
Add DRM information in son, and box progresss is corresponding updates for mapping table box and the block offset to sample and block, without change original
Some MP4 file formats, are capable of the integrality of effective guarantee MP4 file contents;Further, end is played without being modified
Can normal play MP4 files, improve broadcasting success rate, effectively reduce change play end needed for cost;Moreover, in mesh
Tail of file is marked, digital signature is added by the form of free Box, it is therefore prevented that distorting for file content, is applicable to file
Program request, the scene such as live so that on the basis of MP4 file original structures are not destroyed, successfully add DRM information, and can protect
Hinder the integrality of file content and DRM information.
Fig. 2 is the apparatus structure schematic diagram that the embodiment of the present invention two protects file, as shown in Fig. 2, the dress of the present embodiment
Putting to include:Box acquisition module 21, writing module 22, update module 23 and Digital Signature module 24 are indexed, wherein,
Box acquisition module 21 is indexed, for obtaining the index box included in file destination;
In the present embodiment, file destination includes three parts, is respectively:File header, data field and index block.
In the present embodiment, by taking file destination is MP4 files as an example, as an alternative embodiment, file header is located at MP4 files
Front end, data field is located at the middle-end of MP4 files, and index block is located at the rear end of MP4 files, i.e., MP4 files for a file header+
The structure of MDAT (data)+MOOV (index);
As another alternative embodiment, file header is located at the front end of MP4 files, and index block is located at the middle-end of MP4 files, number
It is located at the rear end of MP4 files according to area, i.e. MP4 files are the structure of file header+MOOV (index)+MDAT (data).
Writing module 22, for writing digital rights management information in the user data box in the index box;
In the present embodiment, as an alternative embodiment, writing module 22 includes:Search judging unit, box create unit,
Length determining unit and writing unit (not shown), wherein,
Judging unit is searched for, for judging whether search user data box in the index box, if so, logical
Length determining unit is known, if not, notice box creates unit;
Box creates unit, for adding user data box in the index box, and in the user data of addition
Digital rights management information is write in box;
In the present embodiment, scanned in MOOV Box, if not searching udta Box in the search procedure,
Udta Box are added in MOOV Box, DRM information is added in the udta Box of addition.
Whether length determining unit, the remaining data length of the user data box for judging to search are greater than or equal to
The length of the digital rights management information, if so, notice writing unit, if not, notice box creates unit;
In the present embodiment, if including udta Box in MOOV Box, the remaining space (remainder of udta Box is judged
According to length) whether can accommodate DRM information, if it is possible to accommodate, then new udta Box need not be created, directly by DRM information
It is added in the remaining space in udta Box;If DRM information length is more than the remaining data length of udta Box, create
New udta Box, DRM information are added in new udta Box.
Writing unit, for described search to user data box in write digital rights management information.
In the present embodiment, as another alternative embodiment, writing module 22 includes:Box adding device and information write-in
Unit, wherein,
Box adding device, for adding user data box in the index box;
Information writing unit, for by the user data box of digital rights management information write-in addition.
Update module 23, for the digital rights management information according to write-in and the index box in target text
Position in part, updates mapping table box and block the offset box of the sample and block in the index box of the file destination;
In the present embodiment, as an alternative embodiment, update module 23 includes:Position judgment unit and updating block
(not shown), wherein,
Position judgment unit, for judging whether the index box is located at the centre position of the file destination, if
It is to notify updating block;If not, do not deal with;
In the present embodiment, if file header is located at the front end of MP4 files, index block is located at the middle-end of MP4 files, data field
Positioned at the rear end of MP4 files, in write-in digital rights management information, it is necessary to the sample and the mapping watchcase of block in index box
The information field of sub (stsc Box) and block offset box (stco Box) is accordingly changed, and changes the big of MOOV Box
It is small.If file header is located at the front end of MP4 files, data field is located at the middle-end of MP4 files, after index block is located at MP4 files
End, since index block is in the afterbody of whole file, it is not necessary to modify the relevant information in the stbl Box of MOOV Box, only needs to add
The size of udta Box, modification MOOV Box.
Updating block, length and position for the digital rights management information according to write-in, updates the file destination
Index box in sample and block mapping table box and block offset box.
Digital Signature module 24, for being digitally signed to the file destination of renewal.
In the present embodiment, as an alternative embodiment, which further includes:
File type judgment module (not shown), for parsing the file type box in file destination, obtains text
Part type field, if file type field is identified as MP4 files, performs the step of the index box obtained in file destination
Suddenly;If file type field mark is not MP4 files, terminate flow.
The device of the present embodiment, can be used for the technical solution for performing embodiment of the method shown in Fig. 1, its realization principle and skill
Art effect is similar, and details are not described herein again.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to
Non-exclusive inclusion, so that process, method, article or equipment including a series of elements not only will including those
Element, but also including other elements that are not explicitly listed, or further include as this process, method, article or equipment
Intrinsic key element.In the absence of more restrictions, the key element limited by sentence " including one ... ", it is not excluded that
Also there are other identical element in the process, method, article or apparatus that includes the element.
Each embodiment in this specification is described using relevant mode, identical similar portion between each embodiment
Divide mutually referring to what each embodiment stressed is the difference with other embodiment.
For device embodiment, since it is substantially similar to embodiment of the method, so the comparison of description is simple
Single, the relevent part can refer to the partial explaination of embodiments of method.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use
In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for
Instruction execution system, device or equipment (such as computer based system including the system of processor or other can be held from instruction
The system of row system, device or equipment instruction fetch and execute instruction) use, or combine these instruction execution systems, device or set
It is standby and use.For the purpose of this specification, " computer-readable medium " can any can be included, store, communicate, propagate or pass
Defeated program is for instruction execution system, device or equipment or the dress used with reference to these instruction execution systems, device or equipment
Put.The more specifically example (non-exhaustive list) of computer-readable medium includes following:Electricity with one or more wiring
Connecting portion (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only storage
(ROM), erasable edit read-only storage (EPROM or flash memory), fiber device, and portable optic disk is read-only deposits
Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable
Medium, because can be for example by carrying out optical scanner to paper or other media, then into edlin, interpretation or if necessary with it
His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each several part of the present invention can be realized with hardware, software, firmware or combinations thereof.
In the above-described embodiment, multiple steps or method can use storage to be performed in memory and by suitable instruction
The software or firmware that system performs are realized.If for example, being realized with hardware, with another embodiment, can use
Any one of following technology well known in the art or their combination are realized:With for realizing logic work(to data-signal
The discrete logic of the logic gates of energy, has the application-specific integrated circuit of suitable combinational logic gate circuit, programmable gate
Array (PGA), field programmable gate array (FPGA) etc..
The embodiment of the present invention also provides a kind of electronic equipment, and the electronic equipment includes the dress described in foregoing any embodiment
Put.
Fig. 3 is the structure diagram of electronic equipment one embodiment of the present invention, it is possible to achieve is implemented shown in Fig. 1-2 of the present invention
The flow of example, as shown in figure 3, above-mentioned electronic equipment can include:Housing 31, processor 32, memory 33, circuit board 34 and electricity
Source circuit 35, wherein, circuit board 34 is placed in the interior volume that housing 31 surrounds, and processor 32 and memory 33 are arranged on circuit
On plate 34;Power circuit 35, for each circuit or the device power supply for above-mentioned electronic equipment;Memory 33 is used to store and can hold
Line program code;Processor 32 is run and executable program generation by reading the executable program code stored in memory 33
The corresponding program of code, the method for performing the protection file described in foregoing any embodiment.
Processor 32 to the specific implementation procedures of above-mentioned steps and processor 32 by run executable program code come
The step of further performing, may refer to the description of Fig. 1-2 illustrated embodiments of the present invention, details are not described herein.
The electronic equipment exists in a variety of forms, includes but not limited to:
(1) mobile communication equipment:The characteristics of this kind equipment is that possess mobile communication function, and to provide speech, data
Communicate as main target.This Terminal Type includes:Smart mobile phone (such as iPhone), multimedia handset, feature mobile phone, and it is low
Hold mobile phone etc..
(2) super mobile personal computer equipment:This kind equipment belongs to the category of personal computer, there is calculating and processing work(
Can, generally also possess mobile Internet access characteristic.This Terminal Type includes:PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device:This kind equipment can show and play content of multimedia.The kind equipment includes:Audio,
Video player (such as iPod), handheld device, e-book, and intelligent toy and portable car-mounted navigation equipment.
(4) server:The equipment for providing the service of calculating, the composition of server are total including processor, hard disk, memory, system
Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy
Power, stability, reliability, security, scalability, manageability etc. are more demanding.
(5) other have the function of the electronic equipment of data interaction.
Those skilled in the art are appreciated that to realize all or part of step that above-described embodiment method carries
Suddenly it is that relevant hardware can be instructed to complete by program, the program can be stored in a kind of computer-readable storage medium
In matter, the program upon execution, including one or a combination set of the step of embodiment of the method.
For convenience of description, it is to be divided into various units/modules with function to describe respectively to describe apparatus above.Certainly, exist
Implement the function of each unit/module can be realized in same or multiple softwares and/or hardware during the present invention.
As seen through the above description of the embodiments, those skilled in the art can be understood that the present invention can
Realized by the mode of software plus required general hardware platform.Based on such understanding, technical scheme essence
On the part that contributes in other words to the prior art can be embodied in the form of software product, the computer software product
It can be stored in storage medium, such as ROM/RAM, magnetic disc, CD, including some instructions are used so that a computer equipment
(can be personal computer, server, either network equipment etc.) performs some of each embodiment of the present invention or embodiment
Method described in part.
The above description is merely a specific embodiment, but protection scope of the present invention is not limited thereto, any
Those familiar with the art the invention discloses technical scope in, the change or replacement that can readily occur in, all should
It is included within the scope of the present invention.Therefore, protection scope of the present invention should be subject to scope of the claims.
Claims (11)
- A kind of 1. method for protecting file, it is characterised in that including:Obtain the index box included in file destination;Digital rights management information is write in user data box in the index box;Digital rights management information and the position of the index box in the file destination according to write-in, described in renewal Mapping table box and block the offset box of sample and block in the index box of file destination;The file destination of renewal is digitally signed.
- 2. the method for protection file according to claim 1, it is characterised in that the user in the index box Digital rights management information is write in data box to be included:If not searching user data box in the index box, user data box is added in the index box Son, and write digital rights management information in the user data box of addition;If searching user data box in the index box, the remaining data of user data box searched is judged Whether length is greater than or equal to the length of the digital rights management information, if so, the user data box arrived in described search Digital rights management information is write in son;If it is not, user data box is added in the index box, and in addition Digital rights management information is write in user data box.
- 3. the method for protection file according to claim 1, it is characterised in that the user in the index box Digital rights management information is write in data box to be included:User data box is added in the index box, and digital copyright management is write in the user data box of addition Information.
- 4. the method for protection file according to claim 1, it is characterised in that the digital copyright management according to write-in The position of information and the index box in the file destination, updates the sample in the index box of the file destination Include with mapping table box and block the offset box of block:If the index box is located at the centre position of the file destination, the length according to the digital rights management information of write-in Degree and position, update mapping table box and block the offset box of the sample and block in the index box of the file destination;If the index box is located at the tail position of the file destination, to the sample in the index box of the file destination The mapping table box and block of sheet and block offset box are without modification.
- 5. the method for protection file according to any one of claims 1 to 4, it is characterised in that the method further includes:The file type box in file destination is parsed, obtains file type field, if file type field is identified as MP4 texts Part, perform it is described obtain file destination in index box the step of;If file type field mark is not MP4 files, knot Line journey.
- A kind of 6. device for protecting file, it is characterised in that including:Index box acquisition module, writing module, update module with And Digital Signature module, wherein,Box acquisition module is indexed, for obtaining the index box included in file destination;Writing module, for writing digital rights management information in the user data box in the index box;Update module, for the digital rights management information according to write-in and the index box in the file destination Position, updates mapping table box and block the offset box of the sample and block in the index box of the file destination;Digital Signature module, for being digitally signed to the file destination of renewal.
- 7. the device of protection file according to claim 6, it is characterised in that said write module includes:Search judges Unit, box create unit, length determining unit and writing unit, wherein,Judging unit is searched for, for judging whether search user data box in the index box, if so, notice length Judging unit is spent, if not, notice box creates unit;Box creates unit, for adding user data box in the index box, and in the user data box of addition Middle write-in digital rights management information;Length determining unit, whether the remaining data length of the user data box searched for judgement is more than or equal to described The length of digital rights management information, if so, notice writing unit, if not, notice box creates unit;Writing unit, for described search to user data box in write digital rights management information.
- 8. the device of protection file according to claim 6, it is characterised in that said write module includes:Box adds Unit and information writing unit, wherein,Box adding device, for adding user data box in the index box;Information writing unit, for by the user data box of digital rights management information write-in addition.
- 9. the device of protection file according to claim 6, it is characterised in that the update module includes:Position judgment Unit and updating block, wherein,Position judgment unit, for judging whether the index box is located at the centre position of the file destination, if so, logical Know updating block;If not, do not deal with;Updating block, the length of the digital rights management information write for foundation and position, update the rope of the file destination Draw mapping table box and block the offset box of the sample and block in box.
- 10. the device of file is protected according to claim 6 to 9 any one of them, it is characterised in that described device further includes:File type judgment module, for parsing the file type box in file destination, obtains file type field, if literary Part type field is identified as MP4 files, perform it is described obtain in file destination index box the step of;If files classes type-word Segment identification is not MP4 files, terminates flow.
- 11. a kind of electronic equipment, it is characterised in that the electronic equipment includes:Housing, processor, memory, circuit board and electricity Source circuit, wherein, circuit board is placed in the interior volume that housing surrounds, and processor and memory are set on circuit boards;Power supply Circuit, for each circuit or the device power supply for above-mentioned electronic equipment;Memory is used to store executable program code;Processing The executable program code that device is stored by reading in memory runs program corresponding with executable program code, for holding The method of protection file described in the foregoing any claim 1-5 of row.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610941488.7A CN107977551B (en) | 2016-10-25 | 2016-10-25 | Method and device for protecting file and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610941488.7A CN107977551B (en) | 2016-10-25 | 2016-10-25 | Method and device for protecting file and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107977551A true CN107977551A (en) | 2018-05-01 |
CN107977551B CN107977551B (en) | 2020-07-03 |
Family
ID=62005058
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610941488.7A Active CN107977551B (en) | 2016-10-25 | 2016-10-25 | Method and device for protecting file and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107977551B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110765076A (en) * | 2019-10-25 | 2020-02-07 | 北京奇艺世纪科技有限公司 | Data storage method and device, electronic equipment and storage medium |
CN113571100A (en) * | 2021-07-19 | 2021-10-29 | 深圳软牛科技有限公司 | MP4 generation method, device, equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1870757A (en) * | 2004-10-13 | 2006-11-29 | 美国博通公司 | Multistandard video decoder |
CN101207773A (en) * | 2007-12-06 | 2008-06-25 | 四川长虹电器股份有限公司 | Method for adding DRM information to AVI file |
US20090263099A1 (en) * | 2008-04-21 | 2009-10-22 | Canon Kabushiki Kaisha | Image processing apparatus, control method therefor, and program |
CN102387422A (en) * | 2010-08-31 | 2012-03-21 | 青岛海信电器股份有限公司 | Digital media player, file searching method thereof and television |
CN103617378A (en) * | 2013-11-01 | 2014-03-05 | 北京鹏宇成软件技术有限公司 | DRM content protection system and method based on mobile intelligent terminal |
-
2016
- 2016-10-25 CN CN201610941488.7A patent/CN107977551B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1870757A (en) * | 2004-10-13 | 2006-11-29 | 美国博通公司 | Multistandard video decoder |
CN101207773A (en) * | 2007-12-06 | 2008-06-25 | 四川长虹电器股份有限公司 | Method for adding DRM information to AVI file |
US20090263099A1 (en) * | 2008-04-21 | 2009-10-22 | Canon Kabushiki Kaisha | Image processing apparatus, control method therefor, and program |
CN102387422A (en) * | 2010-08-31 | 2012-03-21 | 青岛海信电器股份有限公司 | Digital media player, file searching method thereof and television |
CN103617378A (en) * | 2013-11-01 | 2014-03-05 | 北京鹏宇成软件技术有限公司 | DRM content protection system and method based on mobile intelligent terminal |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110765076A (en) * | 2019-10-25 | 2020-02-07 | 北京奇艺世纪科技有限公司 | Data storage method and device, electronic equipment and storage medium |
CN113571100A (en) * | 2021-07-19 | 2021-10-29 | 深圳软牛科技有限公司 | MP4 generation method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN107977551B (en) | 2020-07-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102363264B1 (en) | Media decoding control with hardware-protected digital rights management | |
KR100860201B1 (en) | Storage media of integrated multimedia contents, its based multimedia service offer system and method | |
US9729828B2 (en) | Data structure of multimedia file format, encrypting method and device thereof, and decrypting method and device thereof | |
US9342666B2 (en) | Providing security support for digital rights management in different formats | |
JP5350782B2 (en) | Method and apparatus for detecting falsification of metadata | |
US7433471B2 (en) | MPEG-21 digital content protection system | |
US20050033700A1 (en) | Method and apparatus for creating and rendering an advertisement | |
CN101669126B (en) | Method and apparatus for composing a digital rights management license format | |
CN109495459B (en) | Media data encryption method, system, device and storage medium | |
CN109800582B (en) | Traceable multi-party data processing method, device and equipment | |
CN105825143A (en) | Application program data writing and reading method and device | |
CN101395920A (en) | Device and method for generating a media package | |
CN107977551A (en) | A kind of method, apparatus and electronic equipment for protecting file | |
CN107567625A (en) | Group license encryption and decryption | |
CN110968885A (en) | Model training data storage method and device, electronic equipment and storage medium | |
CN110175320A (en) | Document mark up methods and device | |
CN105830461B (en) | Using the constraint to media file format with improving performance | |
CN107026841A (en) | The method and apparatus for issuing works in a network | |
Owen et al. | PRISM: Program replication and integration for seamless MILS | |
US20060200509A1 (en) | Method and apparatus for addressing media resource, and recording medium thereof | |
KR20090018590A (en) | Contents protection providing method and protected contents consuming method and apparatus thereof | |
CN1767639B (en) | Method for parsing the size of contents to be reproduced in a mobile communication device | |
CN101867773A (en) | Extended description to support targeting scheme, and TV anytime service and system employing the same | |
CN107659539A (en) | Method for auditing safely and device | |
Furini | Digital audiobook: from passive to active pursuit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |