CN103313097B - Method and system for encrypting and decrypting encoded file - Google Patents
Method and system for encrypting and decrypting encoded file Download PDFInfo
- Publication number
- CN103313097B CN103313097B CN201310269607.5A CN201310269607A CN103313097B CN 103313097 B CN103313097 B CN 103313097B CN 201310269607 A CN201310269607 A CN 201310269607A CN 103313097 B CN103313097 B CN 103313097B
- Authority
- CN
- China
- Prior art keywords
- file
- coding
- parameter
- encryption
- coding parameter
- 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.)
- Expired - Fee Related
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
- H04N21/2347—Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving video stream encryption
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/235—Processing of additional data, e.g. scrambling of additional data or processing content descriptors
- H04N21/2351—Processing of additional data, e.g. scrambling of additional data or processing content descriptors involving encryption of additional data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client
- H04N21/61—Network physical structure; Signal processing
- H04N21/6106—Network physical structure; Signal processing specially adapted to the downstream path of the transmission network
- H04N21/6125—Network physical structure; Signal processing specially adapted to the downstream path of the transmission network involving transmission via Internet
Abstract
The encryption scheme of the method and the system for encrypting and decrypting the coded file provided by the embodiment of the invention can analyze the coded file and obtain at least one unencrypted coded parameter from the storage position of the coded parameter in the coded file; encrypting at least one unencrypted coding parameter according to a preset encryption algorithm to generate an encrypted coding parameter; at least one unencrypted encoding parameter is removed from the encoded file and an encrypted encoded file is generated using the encrypted encoding parameter. The invention encrypts the coding parameters, and the encryption process is faster because the data volume of the coding parameters is smaller. Meanwhile, after the coding parameters are encrypted, other equipment cannot open the encrypted coding file, and the encryption effect is good. Meanwhile, the decryption process is faster.
Description
Technical field
The present invention relates to encryption and decryption technology field, particularly relate to coding file is encrypted and is solved
Close method and system.
Background technology
Video owing to downloading in mobile phone may be moved out of this mobile phone and distort, it is therefore desirable under to
The video carried is encrypted.
Existing encryption method needs video file to carry out overall encryption, due to the data of video file
Amount is relatively big, causes existing ciphering process to need to spend the more time, and ciphering process is slow.Accordingly
, when user needs to watch the video after encryption, need first to be decrypted.Due to same
Sample needs video file carries out overall deciphering, and the most existing encryption method also causes decrypting process same
Sample is slow, have impact on the playing efficiency of video.
Summary of the invention
The purpose of the embodiment of the present invention is to provide a kind of to encoding what file was encrypted and deciphered
Method and system, to realize the purpose quickly coding file being encrypted and being deciphered.
For reaching above-mentioned purpose, the embodiment of the invention discloses a kind of side that coding file is encrypted
Method, described method includes:
To coding file resolve, the coding parameter deposit position from described coding file obtain to
Few a kind of unencryption coding parameter;
Being encrypted at least one unencryption coding parameter described according to predetermined encryption algorithm, generation adds
Coding parameter after close;
From described coding file, remove at least one unencryption coding parameter described, use described encryption
After coding parameter generate encryption after coding file.
Preferably, described coding file is the video file of encoded process, encoded process
Audio file, the picture file of encoded process or the document files of encoded process.
Preferably, when the video file that described coding file is encoded process, described coding is joined
Number includes: at least one in coded system, video code rate, video resolution, video frame rate.
Preferably, described to coding file resolve, the coding parameter from described coding file is deposited
Put position to obtain at least one unencryption coding parameter and include:
Coding file is resolved, from file header and/or the described coding file of described coding file
End-of-file obtain at least one unencryption coding parameter.
Preferably, described removal at least one unencryption coding parameter described from described coding file,
Coding file after using the coding parameter after encryption to generate encryption, including:
At least one unencryption coding parameter described is removed from described coding parameter deposit position;
Coding parameter after encryption is put into the primary importance in coding file to be encrypted, raw
Becoming the coding file after encryption, wherein, described primary importance is described coding parameter deposit position or is
Non-described coding parameter deposit position.
Preferably, described removal at least one unencryption coding parameter described from described coding file,
Coding file after using the coding parameter after encryption to generate encryption, including:
At least one unencryption coding parameter described is removed from described coding parameter deposit position;
Coding parameter after encryption is put in Parameter File, so that coding file to be encrypted
Become the coding file after encryption.
Preferably, from described coding parameter deposit position, at least one unencryption described is removed described
After coding parameter, before generating the coding file after encryption, described method also includes:
Random code is put in described coding parameter deposit position.
Preferably, it is applied in client device or server, described client device and described service
Device is connected, and described adds at least one unencryption coding parameter described according to predetermined encryption algorithm
Close, generate the coding parameter after encryption, including:
Obtain the first predetermined encryption algorithm corresponding with described client device;
According to described first predetermined encryption algorithm, at least one unencryption coding parameter described is added
Close, generate the coding parameter after encryption.
Preferably, described according to predetermined encryption algorithm, at least one unencryption coding parameter described is carried out
Encryption, generates the coding parameter after encryption, including:
Obtain the file identification of coding file to be encrypted;
Obtain the second predetermined encryption algorithm corresponding with described file identification;
According to described second predetermined encryption algorithm, at least one coding parameter described is encrypted, generates
Coding parameter after encryption.
The embodiment of the present invention additionally provides a kind of method being decrypted coding file, including:
Obtain the coding after the encryption that a kind of aforesaid method being encrypted coding file generates
File;
Obtain the coding parameter after encryption;
Calculate according to the predetermined encryption described in a kind of aforesaid method that coding file is encrypted
The default decipherment algorithm that method is corresponding, is decrypted process to the coding parameter after described encryption, generates and solves
Coding parameter after close;
The coding parameter of the coding file after the coding parameter after described deciphering is put into described encryption is deposited
Put position, generate the coding file after deciphering.
Preferably, the described coding parameter obtained after encrypting, including:
The primary importance of the coding file after described encryption obtains the coding parameter after encryption, wherein,
Described primary importance is the coding parameter deposit position of the coding file after described encryption or is non-described
The coding parameter deposit position of the coding file after encryption;
Or, from Parameter File, obtain the coding parameter after encryption.
Preferably, described coding file coding parameter after described deciphering put into after described encryption
Coding parameter deposit position, generates the coding file after deciphering, including:
When the coding parameter deposit position of the coding file after described encryption exists random code, by institute
The random code stated in the coding parameter deposit position of the coding file after encryption is removed;
Coding parameter after described deciphering is put into described coding parameter deposit position, after generating deciphering
Coding file.
Present invention also offers a kind of system that coding file is encrypted, including: coding parameter obtains
Obtain module, parameter encrypting module and file encryption module,
Described coding parameter obtains module, for resolving, coding file from described coding file
In coding parameter deposit position obtain at least one unencryption coding parameter;
Described parameter encrypting module, for compiling at least one unencryption described according to predetermined encryption algorithm
Code parameter is encrypted, and generates the coding parameter after encryption;
Described file encryption module, for removing at least one unencryption described from described coding file
Coding parameter, the coding file after using the coding parameter after described encryption to generate encryption.
Preferably, described coding file is the video file of encoded process, encoded process
Audio file, the picture file of encoded process or the document files of encoded process.
Preferably, when the video file that described coding file is encoded process, described coding is joined
Number includes: at least one in coded system, video code rate, video resolution, video frame rate.
Preferably, described coding parameter obtains module and includes: the first parameter sub-module, for coding
File resolves, and obtains from the file header of described coding file and/or the end-of-file of described coding file
Obtain at least one unencryption coding parameter.
Preferably, described file encryption module includes: parameter removes submodule and the first parameter puts into son
Module,
Described parameter remove submodule, for from described coding parameter deposit position remove described at least
A kind of unencryption coding parameter;
Described first parameter puts into submodule, for the coding parameter after encryption is put into and to be added
The close primary importance in coding file, generates the coding file after encryption, wherein, described first
It is set to described coding parameter deposit position or for non-described coding parameter deposit position.
Preferably, described file encryption module includes: parameter removes submodule and the second parameter puts into son
Module,
Described parameter remove submodule, for from described coding parameter deposit position remove described at least
A kind of unencryption coding parameter;
Described second parameter puts into submodule, for the coding parameter after encryption is put into Parameter File
In, so that coding file to be encrypted becomes the coding file after encrypting.
Preferably, described file encryption module also includes that random code puts into submodule, described piles up at random
Enter submodule, for described remove from described coding parameter deposit position described at least one do not add
After code parameter, before generating the coding file after encryption, put in described coding parameter deposit position
Enter random code.
Preferably, it is applied in client device or server, described client device and described service
Device is connected, and described parameter encrypting module includes: the first algorithm obtains submodule and the encryption of the first parameter
Submodule,
Described first algorithm obtains submodule, pre-for obtaining first corresponding with described client device
If AES;
Described first parameter encryption submodule, for according to described first predetermined encryption algorithm to described extremely
Few a kind of unencryption coding parameter is encrypted, and generates the coding parameter after encryption.
Preferably, described parameter encrypting module includes: mark obtains submodule, the second algorithm obtains son
Module and the second parameter encryption submodule,
Described mark obtains submodule, for obtaining the files-designated of coding file to be encrypted
Know;
Described second algorithm obtains submodule, presets for obtaining second corresponding with described file identification
AES;
Described second parameter encryption submodule, for according to described second predetermined encryption algorithm to described extremely
Few a kind of coding parameter is encrypted, and generates the coding parameter after encryption.
Present invention also offers a kind of system that coding file is decrypted, including: file obtains mould
Block, encryption parameter obtain module, parameter deciphering module and file decryption module,
Described file obtains module, for obtaining through aforementioned a kind of system being encrypted coding file
Coding file after the encryption generated;
Described encryption parameter obtains module, the coding parameter after obtaining encryption;
Described parameter deciphering module, for according to a kind of to encoding the system that file is encrypted with aforementioned
In default decipherment algorithm corresponding to described predetermined encryption algorithm, the coding parameter after described encryption is entered
Row decryption processing, generates the coding parameter after deciphering;
Described file decryption module, after putting into described encryption by the coding parameter after described deciphering
The coding parameter deposit position of coding file, generates the coding file after deciphering.
Preferably, described encryption parameter acquisition module includes: the first gain of parameter submodule or the second ginseng
Number obtains submodule,
Described first gain of parameter submodule, for the primary importance of the coding file after described encryption
Obtaining the coding parameter after encryption, wherein, described primary importance is the coding file after described encryption
Coding parameter deposit position or be the coding parameter deposit position of coding file after non-described encryption;
Described second gain of parameter submodule, the coding ginseng after obtaining encryption from Parameter File
Number.
Preferably, described file decryption module includes: random code removes submodule and deciphering submodule,
Described random code removes submodule, when the coding parameter of the coding file after described encryption deposits position
When there is random code in putting, in the coding parameter deposit position by the coding file after described encryption
Random code remove;
Described deciphering submodule, deposits for the coding parameter after described deciphering is put into described coding parameter
Put position, generate the coding file after deciphering.
In the method and system that coding file is encrypted and deciphers that the embodiment of the present invention provides
Encipherment scheme, coding parameter can be encrypted, owing to the data volume of coding parameter is less, because of
This ciphering process is very fast.Meanwhile, after being encrypted coding parameter, other equipment cannot open encryption
After coding file, cipher round results is good.Meanwhile, decrypting process is the most very fast.Certainly, this is implemented
Bright arbitrary product or method must be not necessarily required to reach all the above advantage simultaneously.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below by right
In embodiment or description of the prior art, the required accompanying drawing used is briefly described, it should be apparent that,
Accompanying drawing in describing below is only some embodiments of the present invention, for those of ordinary skill in the art
From the point of view of, on the premise of not paying creative work, it is also possible to obtain the attached of other according to these accompanying drawings
Figure.
A kind of flow process to the method that coding file is encrypted that Fig. 1 provides for the embodiment of the present invention
Figure;
The another kind that Fig. 2 provides for the embodiment of the present invention stream to the method that coding file is encrypted
Cheng Tu;
A kind of structure to the system that coding file is encrypted that Fig. 3 provides for the embodiment of the present invention
Schematic diagram;
A kind of flow process to the method that coding file is decrypted that Fig. 4 provides for the embodiment of the present invention
Figure;
A kind of structure to the system that coding file is decrypted that Fig. 5 provides for the embodiment of the present invention
Schematic diagram.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is entered
Row clearly and completely describes, it is clear that described embodiment is only a part of embodiment of the present invention,
Rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not having
Have and make the every other embodiment obtained under creative work premise, broadly fall into present invention protection
Scope.
Embodiments provide a kind of method and system that coding file is encrypted, accordingly
, additionally provide a kind of method and system that coding file is decrypted.Right to one first below
The method and system that coding file is encrypted illustrate.
As it is shown in figure 1, a kind of method that coding file is encrypted that the embodiment of the present invention provides,
May include that
S100, to coding file resolve, the coding parameter deposit position from described coding file
Obtain at least one unencryption coding parameter;
Wherein, described coding file is the video file of encoded process, the sound of encoded process
Frequency file, the picture file of encoded process or the document files of encoded process.
When the video file that described coding file is encoded process, described coding parameter includes:
At least one in coded system, video code rate, video resolution, video frame rate.
It should be noted is that, coding parameter is the important information of coding file, needs to use coding
Parameter just can open coding file.The data volume of coding parameter is relative to encoding the data volume of file very
Little, therefore to the ciphering process of coding parameter quickly.
If coding file does not has coding parameter, all of and correct coding parameter maybe cannot be obtained,
Then cannot open coding file.Therefore, a kind of coding parameter can be only encrypted by the present invention, as
Only coded system is encrypted.Certainly, multiple or whole coding parameters can also be carried out by the present invention
Encryption, to improve cryptographic security further.
In actual applications, the coding parameter deposit position of different coding files may be different, specifically
Coding parameter deposit position have multiple, in the middle part of file header, end-of-file or file.Need exist for spy
Do not mentionlet alone bright a bit, Online Video is also a kind of coding file, and a big Video segmentation is become by it
Multiple little video segments, each little video segment all constitutes a coding file, and in this volume
The file header of code file and end-of-file placed coding parameter.
Therefore, in actual applications, S100 may include that
Coding file is resolved, from file header and/or the described coding file of described coding file
End-of-file obtain at least one unencryption coding parameter.
S200, according to predetermined encryption algorithm, at least one unencryption coding parameter described is encrypted,
Generate the coding parameter after encryption;
Step S200 can have two kinds of different executive modes:
Mode one, in other embodiments of the present invention, method shown in Fig. 1 can apply to client and sets
In standby or server, described client device is connected with described server, and S200 may include that
Obtain the first predetermined encryption algorithm corresponding with described client device;
According to described first predetermined encryption algorithm, at least one unencryption coding parameter described is added
Close, generate the coding parameter after encryption.
Mode two, S200 may include that
Obtain the file identification of coding file to be encrypted;
Obtain the second predetermined encryption algorithm corresponding with described file identification;
According to described second predetermined encryption algorithm, at least one coding parameter described is encrypted, generates
Coding parameter after encryption.
It can be seen that the first predetermined encryption algorithm in mode one is corresponding with client device, therefore
Different client devices can have different AESs, and this allows for the coding file tool after encryption
There is equipment restriction.And the second predetermined encryption algorithm in mode two is corresponding with file identification, the most not
Same file can have different AESs, and this cipher round results allowing for encoding file is higher, peace
Full property is more preferable.
Certainly, both the above mode is only the some embodiments in reality application, and the present invention is not
It is only limitted to above two mode.
S300, from described coding file, remove at least one unencryption coding parameter described, use institute
State the coding file after the coding parameter after encryption generates encryption.
In actual applications, step S300 can have two kinds to carry into execution a plan:
Scheme one, S300 may include that
At least one unencryption coding parameter described is removed from described coding parameter deposit position;
Coding parameter after encryption is put into the primary importance in coding file to be encrypted, raw
Becoming the coding file after encryption, wherein, described primary importance is described coding parameter deposit position or is
Non-described coding parameter deposit position.
Scheme two, S300 may include that
At least one unencryption coding parameter described is removed from described coding parameter deposit position;
Coding parameter after encryption is put in Parameter File, so that coding file to be encrypted
Become the coding file after encryption.
It can be seen that the coding parameter after encryption has been put back into again in original encoding file by scheme one, tool
Body, the coding parameter deposit position in coding file can be put back into, it is also possible to be put into coding file
In other positions, such as end-of-file.Coding parameter after encryption has been put into another file by scheme two
In, thus make original encoding file no longer exists this kind of coding parameter.Concrete, in scheme two
Parameter File can have certain relatedness with this coding file, as the two is bundled, shape
Become a new file.
In both the above scheme, described from described coding parameter deposit position remove described at least
After a kind of unencryption coding parameter, before generating the coding file after encryption, the method also includes:
Random code is put in described coding parameter deposit position.
It is understood that after removing unencryption coding parameter, coding parameter deposit position will appear from
Room, puts into random code in room and other equipment will be made cannot to learn original volume according to random code
Code parameter, can preferably play cipher round results.Certainly, in actual applications, it is also possible at coding
Parameter deposit position is put into specific numerical value, such as 0, or 1.
A kind of method being encrypted coding file that the embodiment of the present invention provides, can be to coding ginseng
Number is encrypted, and owing to the data volume of coding parameter is less, therefore ciphering process is very fast.Meanwhile, right
After coding parameter is encrypted, other equipment cannot open the coding file after encryption, and cipher round results is good
Good.
As in figure 2 it is shown, the invention provides the another kind of method that coding file is decrypted, permissible
Including:
S110, coding file is resolved, from the file header of described coding file and described coding literary composition
The end-of-file of part obtains at least one unencryption coding parameter.
S210, obtain the first predetermined encryption algorithm corresponding with described client device.
S220, according to described first predetermined encryption algorithm, at least one unencryption coding parameter described is entered
Row encryption, generates the coding parameter after encryption.
S311, from described file header and end-of-file, remove at least one unencryption coding parameter described.
S312, the deposit position of described file header and end-of-file Central Plains unencryption coding parameter put into
Machine code.
S320, the coding parameter after encryption is put into the file in coding file to be encrypted
Tail, generates the coding file after encryption.
In actual applications, the position of the end-of-file that coding parameter after encryption is placed can with deposit former
The position of the end-of-file of unencryption coding parameter is different, it is also possible to identical.
The most each step is illustrated the most in the embodiment shown in fig. 1, repeats no more.
Corresponding with the embodiment of the method shown in Fig. 1, present invention also offers one and coding file is entered
The system of row encryption.
As it is shown on figure 3, a kind of system that coding file is encrypted that the embodiment of the present invention provides,
May include that coding parameter obtains module 100, parameter encrypting module 200 and file encryption module 300,
Coding parameter obtains module 100, for resolving, coding file from described coding file
In coding parameter deposit position obtain at least one unencryption coding parameter;
Wherein, coding file can be the video file of encoded process, the sound of encoded process
Frequency file, the picture file of encoded process or the document files of encoded process.
When the video file that described coding file is encoded process, described coding parameter can wrap
Include: at least one in coded system, video code rate, video resolution, video frame rate.
Concrete, coding parameter obtains module 100 and may include that the first parameter sub-module, for right
Coding file resolves, from file header and/or the file of described coding file of described coding file
Tail obtains at least one unencryption coding parameter.
Parameter encrypting module 200, for compiling at least one unencryption described according to predetermined encryption algorithm
Code parameter is encrypted, and generates the coding parameter after encryption;
Parameter encrypting module 200 has two kinds of executive modes:
Mode one, system shown in Figure 3 can apply in client device or server, described client
End equipment is connected with described server, and parameter encrypting module 200 may include that the first algorithm obtains
Submodule and the first parameter encryption submodule,
First algorithm obtains submodule, and for obtaining, first corresponding with described client device is default to be added
Close algorithm;
First parameter encryption submodule, is used for according to described first predetermined encryption algorithm described at least one
Plant unencryption coding parameter to be encrypted, generate the coding parameter after encryption.
Mode two, parameter encrypting module 200 may include that mark obtains submodule, the second algorithm obtains
Obtain submodule and the second parameter encryption submodule,
Mark obtains submodule, for obtaining the file identification of coding file to be encrypted;
Second algorithm obtains submodule, for obtaining second predetermined encryption corresponding with described file identification
Algorithm;
Second parameter encryption submodule, is used for according to described second predetermined encryption algorithm described at least one
Plant coding parameter to be encrypted, generate the coding parameter after encryption.
File encryption module 300, for removing at least one unencryption described from described coding file
Coding parameter, the coding file after using the coding parameter after described encryption to generate encryption.
In actual applications, file encryption module 300 can have two kinds to carry into execution a plan:
Scheme one, file encryption module 300 may include that parameter removes submodule and the first parameter is put
Enter submodule,
Parameter removes submodule, for remove from described coding parameter deposit position described at least one
Unencryption coding parameter;
First parameter puts into submodule, for putting into be encrypted by the coding parameter after encryption
Primary importance in coding file, generates the coding file after encryption, and wherein, described primary importance is
Described coding parameter deposit position or be non-described coding parameter deposit position.
Scheme two, file encryption module 300 may include that parameter removes submodule and the second parameter is put
Enter submodule,
Parameter removes submodule, for remove from described coding parameter deposit position described at least one
Unencryption coding parameter;
Second parameter puts into submodule, for the coding parameter after encryption is put in Parameter File, with
Coding file after making coding file to be encrypted become encryption.
In both the above scheme, file encryption module 300 can also include that random code puts into submodule,
For removing described at least one unencryption coding ginseng from described coding parameter deposit position described
After number, before generating the coding file after encryption, in described coding parameter deposit position, put into random code.
The concrete execution process of the most each module is illustrated, no the most in the embodiment shown in fig. 1
Repeat again.
A kind of system being encrypted coding file that the embodiment of the present invention provides, can be to coding ginseng
Number is encrypted, and owing to the data volume of coding parameter is less, therefore ciphering process is very fast.Meanwhile, right
After coding parameter is encrypted, other equipment cannot open the coding file after encryption, and cipher round results is good
Good.
A kind of method and system that coding file is decrypted below the embodiment of the present invention provided
Illustrate:
As shown in Figure 4, a kind of method that coding file is decrypted that the embodiment of the present invention provides,
May include that
S001, acquisition coding file after the encryption of the method generation of embodiment illustrated in fig. 1;
Concrete, the present invention performs a kind of equipment to the method that coding file is encrypted and execution
A kind of equipment to the method that coding file is decrypted can be identical, it is also possible to different.
Wherein, described coding file is the video file of encoded process, the sound of encoded process
Frequency file, the picture file of encoded process or the document files of encoded process.
Coding parameter after S002, acquisition encryption;
When the video file that described coding file is encoded process, described coding parameter includes:
At least one in coded system, video code rate, video resolution, video frame rate.
Concrete, step S002 may include that
The primary importance of the coding file after described encryption obtains the coding parameter after encryption, wherein,
Described primary importance is the coding parameter deposit position of the coding file after described encryption or is non-described
The coding parameter deposit position of the coding file after encryption;
Or, from Parameter File, obtain the coding parameter after encryption.
S003, according to corresponding with the described predetermined encryption algorithm in the method for embodiment illustrated in fig. 1 pre-
If decipherment algorithm, the coding parameter after described encryption is decrypted process, generates the coding after deciphering
Parameter;
S004, the coding parameter after described deciphering is put into the coding ginseng of the coding file after described encryption
Number deposit position, generates the coding file after deciphering.
Step S004 may include that
When the coding parameter deposit position of the coding file after described encryption exists random code, by institute
The random code stated in the coding parameter deposit position of the coding file after encryption is removed;
Coding parameter after described deciphering is put into described coding parameter deposit position, after generating deciphering
Coding file.
Concrete, whether can first determine whether in the coding parameter deposit position of the coding file after encryption
There is random code, and in the presence of carry out above-mentioned process.
The most each step is corresponding with the corresponding steps in embodiment illustrated in fig. 1 or concrete executive mode,
Therefore repeat no more.
Corresponding to the method shown in Fig. 4, present invention also offers a kind of to encoding what file was decrypted
System.
A kind of method being decrypted coding file that the embodiment of the present invention provides, can be to coding ginseng
Number is decrypted, and owing to the data volume of coding parameter is less, therefore decrypting process is very fast.
As it is shown in figure 5, a kind of system that coding file is decrypted that the embodiment of the present invention provides,
May include that file obtains module 001, encryption parameter obtains module 002, parameter deciphering module 003
With file decryption module 004,
File obtains module 001, for obtaining after the encryption of the system generation of embodiment illustrated in fig. 3
Coding file;
Encryption parameter obtains module 002, the coding parameter after obtaining encryption;
Wherein, encryption parameter obtains module 002 and may include that the first gain of parameter submodule or second
Gain of parameter submodule,
First gain of parameter submodule, the primary importance for the coding file after described encryption obtains
Coding parameter after encryption, wherein, described primary importance is the coding of the coding file after described encryption
Parameter deposit position or be the coding parameter deposit position of coding file after non-described encryption;
Second gain of parameter submodule, the coding parameter after obtaining encryption from Parameter File.
Parameter deciphering module 003, for adding according to described the presetting in the system of embodiment illustrated in fig. 3
The default decipherment algorithm that close algorithm is corresponding, is decrypted process to the coding parameter after described encryption, raw
Become the coding parameter after deciphering;
File decryption module 004, after putting into described encryption by the coding parameter after described deciphering
The coding parameter deposit position of coding file, generates the coding file after deciphering.
Wherein, file decryption module 004 may include that random code removes submodule and deciphering submodule,
Random code removes submodule, when in the coding parameter deposit position of the coding file after described encryption
When there is random code, for by after described encryption coding file coding parameter deposit position in
Machine code is removed;
Deciphering submodule, deposits position for the coding parameter after described deciphering is put into described coding parameter
Put, generate the coding file after deciphering.
Embodiment illustrated in fig. 5 is the system embodiment corresponding with embodiment of the method shown in Fig. 4, refers to figure
4 illustrated embodiment parts, repeat no more.
A kind of system being decrypted coding file that the embodiment of the present invention provides, can be to coding ginseng
Number is decrypted, and owing to the data volume of coding parameter is less, therefore decrypting process is very fast.
It should be noted that in this article, the relational terms of such as first and second or the like is only used
By an entity or operation separate with another entity or operating space, and not necessarily require or
Imply relation or the order that there is any this reality between these entities or operation.And, term
" include ", " comprising " or its any other variant are intended to comprising of nonexcludability, thus
Make to include that the process of a series of key element, method, article or equipment not only include those key elements, and
And also include other key elements being not expressly set out, or also include for this process, method, thing
Product or the intrinsic key element of equipment.In the case of there is no more restriction, statement " include one
Individual ... " key element that limits, it is not excluded that include the process of described key element, method, article or
Equipment there is also other identical element.
Each embodiment in this specification all uses relevant mode to describe, phase between each embodiment
As homophase part see mutually, each embodiment stress with other embodiments
Difference.For system embodiment, owing to it is substantially similar to embodiment of the method,
So describe is fairly simple, relevant part sees the part of embodiment of the method and illustrates.
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the protection of the present invention
Scope.All any modification, equivalent substitution and improvement etc. made within the spirit and principles in the present invention,
It is all contained in protection scope of the present invention.
Claims (12)
1. the method that coding file is encrypted, it is characterised in that including:
To coding file resolve, the coding parameter deposit position from described coding file obtain to
Few a kind of unencryption coding parameter;Described coding file is the video file of encoded process, process
The document literary composition of the audio file of coded treatment, the picture file of encoded process or encoded process
Part;
Being encrypted at least one unencryption coding parameter described according to predetermined encryption algorithm, generation adds
Coding parameter after close;
At least one unencryption coding parameter described is removed from described coding parameter deposit position;
Random code is put in room in described coding parameter deposit position;
Coding parameter after encryption is put in Parameter File, so that coding file to be encrypted
Become the coding file after encryption;Described Parameter File is another literary composition being associated with described coding file
Part.
Method the most according to claim 1, it is characterised in that when described coding file is for passing through
During the video file of coded treatment, described coding parameter includes: coded system, video code rate, video
At least one in resolution, video frame rate.
Method the most according to claim 1 and 2, it is characterised in that described to coding file enter
Row resolves, and the coding parameter deposit position from described coding file obtains at least one unencryption coding
Parameter includes:
Coding file is resolved, from file header and/or the described coding file of described coding file
End-of-file obtain at least one unencryption coding parameter.
Method the most according to claim 1 and 2, it is characterised in that be applied to client device
Or in server, described client device is connected with described server, described according to predetermined encryption calculation
At least one unencryption coding parameter described is encrypted by method, generates the coding parameter after encryption, bag
Include:
Obtain the first predetermined encryption algorithm corresponding with described client device;
According to described first predetermined encryption algorithm, at least one unencryption coding parameter described is added
Close, generate the coding parameter after encryption.
Method the most according to claim 1 and 2, it is characterised in that described according to predetermined encryption
At least one unencryption coding parameter described is encrypted by algorithm, generates the coding parameter after encryption,
Including:
Obtain the file identification of coding file to be encrypted;
Obtain the second predetermined encryption algorithm corresponding with described file identification;
According to described second predetermined encryption algorithm, at least one coding parameter described is encrypted, generates
Coding parameter after encryption.
6. the method that coding file is decrypted, it is characterised in that including:
Obtain the coding file after the encryption that the method described in claim 1 generates;Described coding literary composition
Part is the video file of encoded process, the audio file of encoded process, encoded process
Picture file or the document files of encoded process;
The coding parameter after encryption is obtained from Parameter File;Pre-according to described in claim 1
If the default decipherment algorithm that AES is corresponding, the coding parameter after described encryption is decrypted place
Reason, generates the coding parameter after deciphering;Described Parameter File is another with what described coding file was associated
One file;
By the random code in the room in the coding parameter deposit position of the coding file after described encryption
Remove;
The coding parameter of the coding file after the coding parameter after described deciphering is put into described encryption is deposited
Put position, generate the coding file after deciphering.
7. the system that coding file is encrypted, it is characterised in that including: coding parameter
Obtain module, parameter encrypting module and file encryption module,
Described coding parameter obtains module, for resolving, coding file from described coding file
In coding parameter deposit position obtain at least one unencryption coding parameter;Described coding file is warp
Cross the video file of coded treatment, the audio file of encoded process, the picture of encoded process
File or the document files of encoded process;
Described parameter encrypting module, for compiling at least one unencryption described according to predetermined encryption algorithm
Code parameter is encrypted, and generates the coding parameter after encryption;
Described file encryption module includes: parameter removes submodule, random code puts into submodule and second
Parameter puts into submodule,
Described parameter remove submodule, for from described coding parameter deposit position remove described at least
A kind of unencryption coding parameter;
Described random code puts into submodule, puts in the room in described coding parameter deposit position
Enter random code;
Described second parameter puts into submodule, for the coding parameter after encryption is put into Parameter File
In, so that coding file to be encrypted becomes the coding file after encrypting;Described Parameter File
For another file being associated with described coding file.
System the most according to claim 7, it is characterised in that when described coding file is for passing through
During the video file of coded treatment, described coding parameter includes: coded system, video code rate, video
At least one in resolution, video frame rate.
9. according to the system described in claim 7 or 8, it is characterised in that described coding parameter obtains
Module includes: the first parameter sub-module, for resolving, coding file from described coding file
File header and/or the end-of-file of described coding file obtain at least one unencryption coding parameter.
10. according to the system described in claim 7 or 8, it is characterised in that be applied to client device
Or in server, described client device is connected with described server, described parameter encrypting module bag
Include: the first algorithm obtains submodule and the first parameter encryption submodule,
Described first algorithm obtains submodule, pre-for obtaining first corresponding with described client device
If AES;
Described first parameter encryption submodule, for according to described first predetermined encryption algorithm to described extremely
Few a kind of unencryption coding parameter is encrypted, and generates the coding parameter after encryption.
11. according to the system described in claim 7 or 8, it is characterised in that described parameter encrypting module
Including: mark obtains submodule, the second algorithm obtains submodule and the second parameter encryption submodule,
Described mark obtains submodule, for obtaining the files-designated of coding file to be encrypted
Know;
Described second algorithm obtains submodule, presets for obtaining second corresponding with described file identification
AES;
Described second parameter encryption submodule, for according to described second predetermined encryption algorithm to described extremely
Few a kind of coding parameter is encrypted, and generates the coding parameter after encryption.
12. 1 kinds of systems that coding file is decrypted, it is characterised in that including: file obtains
Module, encryption parameter obtain module, parameter deciphering module and file decryption module,
Described file obtains module, for obtaining after the encryption that the system described in claim 7 generates
Coding file;Described coding file is the video file of encoded process, encoded process
Audio file, the picture file of encoded process or the document files of encoded process;
Described encryption parameter obtains module, the coding parameter after obtaining encryption from Parameter File;
Described Parameter File is another file being associated with described coding file;
Described parameter deciphering module, for according to the described predetermined encryption algorithm pair in claim 7
The default decipherment algorithm answered, is decrypted process to the coding parameter after described encryption, after generating deciphering
Coding parameter;
Described file decryption module includes: random code removes submodule and deciphering submodule,
Described random code removes submodule, for being deposited by the coding parameter of the coding file after described encryption
Put the random code in the room in position to remove;
Described deciphering submodule, deposits for the coding parameter after described deciphering is put into described coding parameter
Put position, generate the coding file after deciphering.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310269607.5A CN103313097B (en) | 2013-06-28 | 2013-06-28 | Method and system for encrypting and decrypting encoded file |
PCT/CN2014/081290 WO2014206370A1 (en) | 2013-06-28 | 2014-06-30 | Method and system for encrypting and decrypting coding file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310269607.5A CN103313097B (en) | 2013-06-28 | 2013-06-28 | Method and system for encrypting and decrypting encoded file |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103313097A CN103313097A (en) | 2013-09-18 |
CN103313097B true CN103313097B (en) | 2016-12-07 |
Family
ID=49137808
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310269607.5A Expired - Fee Related CN103313097B (en) | 2013-06-28 | 2013-06-28 | Method and system for encrypting and decrypting encoded file |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN103313097B (en) |
WO (1) | WO2014206370A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103313097B (en) * | 2013-06-28 | 2016-12-07 | 贝壳网际(北京)安全技术有限公司 | Method and system for encrypting and decrypting encoded file |
CN108390862B (en) * | 2018-01-29 | 2021-04-27 | 丹露成都网络技术有限公司 | Graph verification method based on picture data encryption index |
CN111432242B (en) * | 2020-03-31 | 2022-05-27 | 广州市百果园信息技术有限公司 | Encrypted video call method, device, equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101442676A (en) * | 2008-12-26 | 2009-05-27 | 北京工业大学 | Method for enciphering H.264 video based on CAVLC encode |
CN102469344A (en) * | 2010-11-16 | 2012-05-23 | 腾讯科技(深圳)有限公司 | Video stream encryption and decryption method, video stream encryption and decryption device, communication terminal and storage terminal |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100505866C (en) * | 2004-10-28 | 2009-06-24 | 武汉大学 | A video information encrypting-decrypting method |
CN201663660U (en) * | 2010-04-06 | 2010-12-01 | 深圳市爱美得科技有限公司 | Data encryption and data decryption system of digital video |
CN101902333B (en) * | 2010-07-20 | 2015-08-19 | 中兴通讯股份有限公司 | The application process of digital copyright management and terminal equipment |
CN102724552B (en) * | 2012-05-30 | 2014-12-17 | 华为技术有限公司 | Image coding method, image decoding method and device |
CN103313097B (en) * | 2013-06-28 | 2016-12-07 | 贝壳网际(北京)安全技术有限公司 | Method and system for encrypting and decrypting encoded file |
-
2013
- 2013-06-28 CN CN201310269607.5A patent/CN103313097B/en not_active Expired - Fee Related
-
2014
- 2014-06-30 WO PCT/CN2014/081290 patent/WO2014206370A1/en active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101442676A (en) * | 2008-12-26 | 2009-05-27 | 北京工业大学 | Method for enciphering H.264 video based on CAVLC encode |
CN102469344A (en) * | 2010-11-16 | 2012-05-23 | 腾讯科技(深圳)有限公司 | Video stream encryption and decryption method, video stream encryption and decryption device, communication terminal and storage terminal |
Also Published As
Publication number | Publication date |
---|---|
WO2014206370A1 (en) | 2014-12-31 |
CN103313097A (en) | 2013-09-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101291325B (en) | Method for encryption for information and decryption method for information | |
KR101744748B1 (en) | Contents protection, encryption and decryption apparatus using white-box cryptography | |
CN111756523B (en) | Data transmission method and device | |
US20150172053A1 (en) | Method for converting a conditional access content and receiver for the implementation for said method | |
KR101369748B1 (en) | Method for encrypting datas and appatus therefor | |
CN102333236A (en) | Video content encryption and decryption system | |
CN104579680B (en) | A kind of method of secure distribution seed | |
CN105406969A (en) | Apparatus And Method For Data Encryption | |
CN104378198A (en) | Voice encryption method based on block cipher system | |
CN102546156A (en) | Method, system and device for grouping encryption | |
CN105871549A (en) | Digital signal encryption processing method | |
WO2018002856A1 (en) | Systems and methods for authenticating communications using a single message exchange and symmetric key | |
CN111404953A (en) | Message encryption method, message decryption method, related devices and related systems | |
CN101895390A (en) | Method, device and system for encryption and decryption | |
CN103313097B (en) | Method and system for encrypting and decrypting encoded file | |
CN103339896A (en) | Method and system for conditional access to a digital content, associated terminal and subscriber device | |
EP2904731B1 (en) | Method and device for digital data blocks encryption and decryption | |
CN105915345B (en) | The implementation method of licensed-type production and restructuring in a kind of family gateway equipment production test | |
CN100461199C (en) | Method and device for encrypting and de-encrypting digital content | |
CN103501220A (en) | Encryption method and device | |
CN104954362A (en) | Serial number encryption-decryption method and device | |
KR101602803B1 (en) | The encryption and decryption Method of using to polarization | |
CN105959106A (en) | Low-complexity digital encryption method | |
CN107294713B (en) | Encryption authentication method | |
CN103532706B (en) | Data encryption/decryption method, device and mobile terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20161207 Termination date: 20180628 |