CN100551056C - Video encryption method based on Advanced Encryption Standard - Google Patents

Video encryption method based on Advanced Encryption Standard Download PDF

Info

Publication number
CN100551056C
CN100551056C CNB2008101226809A CN200810122680A CN100551056C CN 100551056 C CN100551056 C CN 100551056C CN B2008101226809 A CNB2008101226809 A CN B2008101226809A CN 200810122680 A CN200810122680 A CN 200810122680A CN 100551056 C CN100551056 C CN 100551056C
Authority
CN
China
Prior art keywords
video
data
code
memory
encryption standard
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
Application number
CNB2008101226809A
Other languages
Chinese (zh)
Other versions
CN101304525A (en
Inventor
吴蒙
陈勇
祝丽丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Post and Telecommunication University
Nanjing University of Posts and Telecommunications
Original Assignee
Nanjing Post and Telecommunication University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nanjing Post and Telecommunication University filed Critical Nanjing Post and Telecommunication University
Priority to CNB2008101226809A priority Critical patent/CN100551056C/en
Publication of CN101304525A publication Critical patent/CN101304525A/en
Application granted granted Critical
Publication of CN100551056C publication Critical patent/CN100551056C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

Be applicable to that based on the video encryption method of Advanced Encryption Standard pay TV, video request program, Internet video etc. protect the video encryption method of transmission to the lower video content of some significance levels under internet and wireless environment condition, the output feedback mode that utilizes the superencipherment algorithm carries out method of encrypting to the direct current difference coefficient of intra piece in the direct current difference coefficient in the intra-frame encoding mode in the MPEG-4 video and inter prediction encoding pattern, the interframe bi-directional predictive coding pattern.The present invention be a kind of have expense little, can carry out certain protection to the MPEG-4 video, the video encryption method of characteristics such as certain anti-error propagation ability is arranged.

Description

Video encryption method based on Advanced Encryption Standard
Technical field
The present invention a kind ofly is applicable to that based on Advanced Encryption Standard pay TV, video request program, Internet video etc. under internet and wireless environment condition, protect the video encryption method of transmission to the lower video content of some significance levels.
Background technology
Along with the development of information technology and the continuous progress of society, the human demand that information is obtained is more and more abundanter.And multimedia messages has become the main carrier that the mankind obtain information, so technology such as the coding of multimedia messages, transmission become the focus of people's research.Wherein, the data volume maximum be digital of digital video data, so video compression technology is the key of multimedia technology.
The MPEG of Motion Picture Experts Group of the ISO of International Standards Organization (Moving Picture ExpertsGroup) is the expert group that formulates compression standard specially for digital video/audio, has proposed video compression standards such as MPEG-1, MPEG-2, MPEG-4, MPEG-7 and MPEG-21 at present.
MPEG-4 (ISO/IEC 14496, and IEC is the abbreviation of International Electrotechnical Commission) is based on the interactive multimedia data processing international standard of object.It has broken away from the traditional view of video sequence only being regarded as the rectangle sets of video frames, video sequence is regarded as the set of one or more object video.Object video (VO) is to continue video scene random time, arbitrary shape zone.
Video object plane VOP is object video sampling at a time.According to the notion of VOP, each frame of input video sequence all may be partitioned into the image-region (video object plane) of many arbitrary shapes, can comprise specific image in the every zone or feel the emerging video content of getting over.The coding of VOP has three kinds of patterns, i.e. intra-frame encoding mode I-VOP, inter prediction encoding pattern P-VOP, interframe bi-directional predictive coding Mode B-VOP, and MPEG-4 adopts these three kinds of frame formats to characterize different motion compensation types.
In existing video coding and decoding system, people adopt three kinds of modes to realize compression algorithm usually: the pure hardware mode of the first, promptly adopt special chip to realize the encoding and decoding of image, the coding/decoding system real-time that this kind mode realizes is good, compression ratio is high, picture quality might as well, in case being coding and decoding scheme, shortcoming fixes, just can't upgrade and renewal, and this system cost cost is very high to it; Its two software mode that is based on common PC processor, but its compression speed is limited, is difficult to realize some comparatively complicated algorithm in the demanding video coding and decoding system of real-time, cause poor image quality, the time prolong, frame per second is low.But advantages such as this scheme has flexibly, software is easily upgraded, cost is low; Its three software realization mode that is based on the general digital signal processing.This kind mode is utilized the high speed signal processing capacity of DSP, and the code decode algorithm that high-speed cruising uses software to realize has shortened the encoding and decoding time greatly, and because software and hardware has relative independentability, system has the easily advantage of renewal of easy upgrading, algorithm.Along with improving constantly of general dsp performance in recent years, the progressively reduction of price, causing with DSP is that core adds that the formed video coding and decoding system of suitable peripheral components becomes main flow.
Discrete cosine transform (DCT, Discrete cosine Transform) is the same a kind of conversion that clear and definite physical quantity meaning is arranged with Fourier transform, only contains cosine term in the Fourier transform of any real symmetric function continuously.At first general image is divided into N * N block of pixels during conversion, then these block of pixels is carried out dct transform one by one.Because the coefficient that image block obtains later on through dct transform, its energy mainly distributes along leading diagonal, and main concentration of energy is in the upper left corner.This be because in piece image between the pixel YUV change slowly, most of regional change is little, and the jump in brightness part only occupies the minority, in 8 * 8 sub-pieces, correlation is very strong between the pixel, is zero or goes to zero away from the high-frequency ac coefficient great majority of DC coefficient.The low frequency energy that square has reflected image of each coefficient value of upper left side, the high-frequency energy that square has reflected image of each coefficient value of lower right, i.e. image detail.According to these characteristics, only need the DC coefficient of concentration of energy is encrypted, just can cover image effect to a certain extent.Therefore, as if can obtain the time the MPEG-4 video-encryption, only the DC coefficient of each piece among the I-VOP is encrypted the image effect that just can cover entire I-VOP, utilize the time domain prediction between P-VOP, B-VOP and I-VOP to concern the encryption that just can realize whole M PEG-4 video sequence then.Yet,, therefore only the DC coefficient in the I frame is encrypted and will be can not get gratifying cipher round results owing to the piece that exists part to encode in P, the B frame in the Intra mode.The AES conversion realizes that by many wheel iteration according to the difference of key length, the iterations of round function is also different by round function, and corresponding to 128,192,256 3 kinds of key lengths, iterations is respectively 10,12,14 and takes turns.The formation of round function comprises elements such as nonlinear transformation, diffusion and key schedule.The target of nonlinear transformation is exactly to obtain big complicated nonlinear member by less better simply non-linear element.Take turns in the iteration in each of round function, comprise four step conversion, be respectively: 1) byte substitution, finish in the grouping replacement with a S box by byte; 2) row displacement, a simple displacement; 3) row are obscured, and a utilization is at territory GF (2 8) on the replacement of arithmetic characteristic; 4) round key adds, and utilizes the part of current group and expanded keys to carry out the step-by-step XOR.Its effect is exactly by repeating simple nonlinear conversion, mixed function conversion, the Nonlinear Diffusion that the byte substitution computing is produced reaches sufficient mixing, grouping information statistical property after the encryption is more evenly distributed, take turns the different key of introducing in the iteration every, so just, obtain best cipher round results with simple calculations cost, realize the validity of encrypting.
A block cipher comes encrypting plaintext (as n=64 or 128) with the n bit groupings of fixed dimension.For the message that has exceeded the n bit, the simplest method is the grouping that message is divided into the n bit, encrypts respectively then.This ecb mode (code book pattern) defectiveness all in the overwhelming majority's application inspires having produced block cipher and encrypt the additive method (operator scheme) of long message thus.Four kinds of the most frequently used patterns are ECB (code book), CBC (cipher block chaining), CFB (cipher feedback pattern) and OFB (output feedback mode).
Output feedback mode is applicable to the application that must avoid error propagation.Similar with CFB, it can encrypt the grouping of various sizes, but different is, as feedback be the output of encrypting block function E, but not ciphertext.
In the MPEG-4 video, reduce the transmission data volume in order to improve compression performance, among Intra piece among P-VOP, the B-VOP and the I-VOP DC coefficient of piece all will be earlier through prediction, so really send to the difference value after the prediction of having only in the code stream, therefore only need encrypt and get final product the DC difference coefficient.But because the difference value of DC coefficient has only several bits usually, therefore to utilize symmetrical block encryption algorithm,, two kinds of methods be arranged: 1) wait for and want ciphered data, up to the size of dividing into groups that gathers together enough as DES or AES; 2) the cipher feedback pattern (CFB) or the output feedback mode (OFB) of employing symmetric encipherment algorithm.For the former, because pending datas such as needs are filled full grouping, therefore will increase the encoding and decoding time-delay, when particularly using AES to encrypt, the grouping size is at least 128.Therefore consider to adopt this cipher mode of the latter, and,, be not subjected to the influence of channel error code, therefore with respect to the propagation that can not lead to errors of CFB pattern because its encryption ciphertext that is used for XOR produces in this locality for the OFB pattern with stream cipher characteristic.
Summary of the invention
Technical problem: the purpose of this invention is to provide a kind of have expense little, can carry out certain protection to the MPEG-4 video, the MPEG-4 video encryption method based on Advanced Encryption Standard of characteristics such as certain anti-error propagation ability is arranged.This method is applicable to that pay TV, video request program, Internet video etc. under internet and wireless environment condition, protect the video encryption method of transmission to the lower video content of some significance levels.
Technical scheme: to be a kind of output feedback OFB pattern of utilizing the superencipherment algorithm carry out method of encrypting to the DC difference coefficient of intra piece in the DC difference coefficient in the intra-frame encoding mode (I-VOP) in the MPEG-4 video and inter prediction encoding pattern (P-VOP), the interframe bi-directional predictive coding pattern (B-VOP) in the present invention.
This method comprises the steps:
The first step: video coding handled making it on fixed-point dsp SDK platform, to realize, specifically as follows to the video coding treatment step:
11) code compiling and transplanting: the type double precision data are used instead the long categorical data, instruction Debugging message of the printf in the program code and Floating-point Computation are closed with the conditional compilation instruction, and recompilate;
12) project level Compiler Optimization: utilize the compiler interface option to call software pipeline, the software pipeline circulation feedback of highest level, increase the concurrency that software translating becomes the Digital Signal Processing code; Link makes dispositions in proper order to code segment simultaneously, and the cache miss that code call was brought when the minimizing program was carried out improves executing efficiency;
13) memory optimization: the memory of 1 Mbytes memory space is divided into the second level cache memory of 256 kilobytes and second level static RAM two parts of 768 kilobytes, data and code commonly used are placed on the static RAM of the on-chip memory second level, the external sync dynamic random access memory are set at cacheable to improve access efficiency;
14) cache memory cache optimization: the capable size of first order program high-speed cache is 32 and adopts direct mapping structure, the capable size of first order data high-speed buffer memory is 64 and adopts two-way group associative structure to improve the circulation step value, first order program high-speed cache is hit in the finger visit of getting of central processing unit, and the monocycle is returned the Fetch Packet that needs; If do not hit first order program high-speed cache, what hit is second level memory, carry out the degree of parallelism of bag and the cycle that flow beat decision central processing unit gets clogged, otherwise central processing unit is blocked to second level memory and obtains corresponding Fetch Packet from external memory space, after sending into first order program high-speed cache, send into central processing unit again, take the double word alignment when store data or storage allocation, the central processing unit congestion situations that reduces to cause because of cache miss takes place;
15) carry out code optimization: use the image processing function library, this function is the assembly code of manual layout streamline,
Rewrite the C code: carry out packing data for the ease of the Digital Signal Processing compiler and handle, cycling quadruple in the program is launched, to improve flowing water efficient, for the circulation of iterations in compilation time the unknown, utilize bit arithmetic to launch, make compiler use the packing data technology to carry out stream treatment
Use linear compilation: C64x series digit signal processing in video encoder, use during the half-pix interpolation dotpu4, subabs4 command calculations absolute error and; The SPACK2 instruction is used for image reconstruction; Carry out the LDNDW instruction that pixel value reads when carrying out estimation in reference image frame, data do not satisfy the problem of double word alignment in the solution reference picture;
Data-moving: the use direct memory access that utilizes chip to support the storehouse to provide carries out function and the multichannel enhancement mode direct memory access (DMA) of employing that internal storage data transmits, the realization view data is moved, there is copy in the moving data for the treatment of in the synchronous DRAM in the cache memory of the second level, before the data-moving, the moving data for the treatment of in second level cache memory and the synchronous DRAM is carried out consistency operation, avoid program running to make mistakes.
Second step: video is encrypted with the output feedback mode of Advanced Encryption Standard: the frame format in the video is judged, if video object plane is an intra-frame encoding mode, then the Advanced Encryption Standard output feedback mode that 8 * 8 direct current difference coefficient is used is encrypted; Otherwise if video object plane is the intra-coded macroblock in inter prediction encoding pattern and the interframe bi-directional predictive coding pattern, then the direct current difference coefficient to piece in the macro block uses the output feedback mode of Advanced Encryption Standard to encrypt.
The 3rd step: send with decryption step as follows to encrypted video:
31) client sends session and sets up request;
32) server end receives that session sets up request back checking client's legitimacy, if the verification passes, then utilizes the PKI of client that Advanced Encryption Standard key and initialization vector are encrypted, and sends to client then, if disabled user's interrupt requests then;
33) receiving end is utilized the private key of himself, and the ciphertext of receiving is decrypted, and obtains Advanced Encryption Standard key and initialization vector, sends acknowledge message then;
34) receive the client acknowledge message after, server end uses corresponding Advanced Encryption Standard key and initialization vector video is encrypted and to be encoded and send, receiving end is then utilized Advanced Encryption Standard key and initialization vector that video flowing is decrypted and is decoded.
This method step 32 in the 3rd step), step 33), step 34) Advanced Encryption Standard be clear packets and the initial vector that output feedback mode is used for given bit, calculate the output of grouping ciphertext.
Beneficial effect:
(1) the encryption and decryption frame of video that obtains by Fig. 6-Figure 13 contrast as can be seen, the encrypted video frame has produced the effect of covering to original video image, the information in original video image can not identification.
(2) the present invention has the little characteristics of expense, thereby can not influence the real-time working of MPEG-4 video encoder.
(3) since algorithm the DC difference coefficient of the Intra piece of the DC difference coefficient of I-VOP and P-VOP, B-VOP is encrypted, changed the value of these parameters, cause the input of entropy coder inconsistent with original priori statistical probability, therefore cause the MPEG-4 video compression ratio to descend, it is big that compressed file becomes.Table 1 has provided the influence of encrypting for the compressed file size, and this moment, the MPEG-4 video encoder was set to: code check 256Kbps, frame per second 30f/s, I-VOP upgrade and are spaced apart 5, promptly carry out the coded system of IPPPP...IPPPP...IPPPP.Because enciphered data mainly is distributed in the I-VOP, therefore be provided with under the identical situation at the MPEG-4 video encoder, the I-VOP that the influence of encryption is provided with encoder upgrades relevant at interval, and more little at interval, I-VOP quantity is many more, and compressed file changes more greatly.
The sequence title Compressed file size (unencryption) Compressed file size (encryption) Change
News.qcif 171,430 bytes 175,277 bytes +2.24%
Carphone.qcif 495,787 bytes 501,583 bytes +1.17%
Container.qcif 394,947 bytes 401,234 bytes +1.59%
Silent.qcif 400,917 bytes 405,525 bytes +1.15%
Foreman.qcif 407,888 bytes 411,763 bytes +0.95%
Table 1 is encrypted the influence for the compressed file size
(4) decoder end is correctly deciphered the influence of decoding in order to assess this algorithm error code under the OFB pattern, in MPEG-4 video encoder output code flow, change some certain bits selectively with of the influence of simulated channel error code to code stream, because the present invention has only related to the encryption of DC difference coefficient, therefore the generation of error code only can be limited to the DC difference coefficient.Encoder is set to: code check is that 512Kbps, frame per second are that 30f/s, I frame update are spaced apart 6 frames, no B frame, and promptly coded system is IPPPPPIPPPPPI........
With news sequence (a kind of low code check cycle tests) is example, and the change DC difference coefficient of latter two macro block in first I-VOP is with emulation transmission channel generation random error.At this moment, correspondence image effect (Figure 14) variation that obtains in decoder end (deciphering back).Because follow-up P-VOP and B-VOP are based upon in the prediction of this I-VOP, therefore cause all images deterioration before next I-VOP arrives again.Yet when second I-VOP arrives,, therefore can decipher and decoding (Figure 15) this I-VOP is correct owing to the ciphertext of feeding back under the OFB pattern produces by decoder-side is local.And under the CFB pattern, because the shift register utilization is that the unit that AES encrypts behind ciphertext and the XOR expressly feeds back filling, and the ciphertext that decoder end is received has been damaged, therefore under the CFB pattern, second I-VOP can not correctly decipher and decode, and leads to errors and propagates in video sequence.
The present invention more efficiently resists the error propagation phenomenon under the error code condition.
Yet, be confined to occur on the preceding several DC difference coefficient among first I-VOP if it is pointed out that error code, will cause the rapid deterioration of this picture frame quality.Although this is because have only the DC difference coefficient of minority piece to make a mistake, because the DC coefficient of subsequent block all has certain projected relationship with this piece DC coefficient in the frame, so cause the deterioration of entire image frame.If but this moment algorithm based on the CFB pattern, because this pattern also is self synchronous, only need [n/r] individual ciphertext block just can recover, therefore possibility (depend on the position that error code takes place) shift register of CFB pattern before second I-VOP arrives just reverts to correct filling value, and such second I-VOP also can correctly decipher.But the algorithm based on the OFB pattern does not have this dependence, all the time the influence area of error code to deciphering is limited in the piece of error code generation.
This shows that the OFB pattern of utilizing AES is carried out part to the MPEG-4 video code flow and encrypted the error propagation phenomenon that will more efficiently resist under the error code condition, so the present invention can work under error-prone environments such as internet, wireless network.
(5) anti-attack performance analysis: because the particularity of video file still can obtain partial video information by encrypt file even fail to know whole plaintexts.Because the object that the present invention encrypts is the DC difference coefficient of I-VOP, and the DC difference coefficient of Intra piece among P-VOP and the B-VOP, therefore the assailant can intercept and capture the MPEG-4 video code flow of whole section this algorithm for encryption of process, the code word of the DC difference coefficient correspondence of encrypting is distorted code word into the zero coefficient correspondence, decode with the MPEG-4 decoder then.Following surface analysis is to the attack experiment and the result of this algorithm.
Experiment is based on the Container sequence of QCIF form and the Highway sequence of CIF form, and (Container sequence, Highway sequence, news sequence, Akiyo sequence and foreman sequence all are cycle testss, cycle tests is one group of video that the meaning represented is arranged that MPEG chooses, generally unifiedly everybody testing efficiency the time use this, so that comparative effectiveness), being set to of MPEG-4 video encoder: code check is that 512Kbps, frame per second are that 30f/s, I frame update are spaced apart 6 frames, B-VOP is arranged, and coded system is
IBPBPB...IBPBPB......。Carry out the frame of video after the MPEG-4 video decode promptly obtains attacking after adopting above-mentioned attack method that ciphertext is distorted.The part attack effect is (left side figure is the container sequence, and right figure is the highway sequence) as shown in Figure 5.This shows that after attacking, video image is not revealed substantially, the assailant can not obtain useful video image.
(6) application scenario of the present invention is analyzed: although the algorithm that we propose based on Advanced Encryption Standard AES, and AES can resist known all attacks effectively, therefore knows that fully the whole video plaintext document almost is impossible.But because the particularity of video file, even fail to know that whole plaintexts still can obtain partial information by encrypt file, therefore, it is unsafe with this algorithm video military, economic and political sensitiveness being encrypted.
Yet some video content can only be kept the high value of short time, and a period of time will become useless later.Therefore adopting some high-end cryptographic algorithm of a high price will be uneconomic to these video protections.In addition, in some application, as pay TV, video request program, Internet video etc., they are often not high to security requirement, only need simply cover, even wish the just simple deterioration of video quality, attract some potential consumption clients with this to video.And this algorithm is because its expense is little and have certain fail safe, and if need obtain high-quality video image fully then must obtain characteristics such as key, therefore can some are used under the less demanding occasion security performance in Internet video etc.
Description of drawings
Fig. 1 is that encryption method of the present invention is made flow process.
Fig. 2 is the specific implementation to the MPEG-4 coding encrypting.
Fig. 3 is that the MPEG-4 encoding software is optimized flow chart.
Fig. 4 is an output feedback OFB pattern block diagram.
Embodiment
Be that specific embodiments of the invention further describe below:
The present invention is based on the MPEG-4 video compression encoder of DSK (the DSP Starter Kit) platform of 32 fixed-point dsp TMS320C6416DSP of high-performance of American TI Company.
The OFB pattern that the present invention utilizes AES is carried out method of encrypting to the DC difference coefficient of DC difference coefficient among the I-VOP in the MPEG-4 video and the intra piece among P-VOP, the B-VOP.
Specify and use false code:
If (VOP is I-VOP) then (using the OFB pattern of AES to encrypt) to 8 * 8 DC difference coefficients;
Else if (being the intra coded macroblocks) then (the DC difference coefficient to piece in the macro block uses the OFB pattern of AES to encrypt);
else continue;
The open source software Xvid that MEPG-4 encoder of the present invention is selected for use is mainly based on common PC processor, compare with DSP and to be very different, therefore can not simply code be put into compilation run on the DSP platform, must carry out reasonable disposition to the CCS compiler, and transplant and effectively to compile at the DSP platform, CCS (CodeComposer Studio) provided the software that is used for developing the DSP program by Texas Instrument, and it provides a complete Integrated Development Environment; Secondly, not through the code efficiency of optimizing arrangement extremely low (about 25 seconds codings of QCIF format video one frame), must be optimized processing, could improve its video coding frame per second on the DSP platform at this code through experimental verification.Fig. 3 just is based on the MPEG-4 encoder software optimization flow chart of DSP platform, realizes with transplanting with to project level compiler, memory, Cache buffer memory and code optimization by the code compiling.The compiling of code in the step 01 at first will be write the .cmd file, and the concrete storage address of system storage configuration and program and data is defined and illustrates; Use-l links the library file that needs use; And reasonable disposition CCS compiler; Code in the step 01 is transplanted to redefine the partial data type and is write the inttypes.h file again; Then Debugging message such as printf a large amount of in the program code are closed with conditional compilation instruction ifdef...else...endif with the calculating (Floating-point Computation) of calculating PSNR.Step 02 project level Compiler Optimization can CCS 2.20 the PBC option constantly to each the compiler option (as-mw,-pm,-o3,-mt etc.) make up, preferably, in the code chain termination process, certain arrangement is carried out in the code segment link in proper order, and the cache miss (Cache missing) that code call is brought when can the minimizing program carrying out improves executing efficiency.Step 03 memory optimization, C6416DSP is had memory space is divided into the L2CACHE of 256K and the L2SRAM of 768K on the sheet of 1Mbyte, data commonly used and code etc. are placed on the on-chip memory L2SRAM, but simultaneously outside SDRAM are set at efficient high-speed cache (Cacheable) to improve visit.Step 04Cache cache optimization, the ram in slice of C6416DSP adopts 2 grades of cache structures, and program and data have separately independently high-speed cache.The 1st grade of program cache in the sheet is called L1P, and the 1st grade of data cache is called L1D, and the 2nd grade of memory of program and data sharing is called L2.
L1P adopts direct mapping structure (Direct mapped cache), and row (line) size is 32B, can buffer memory 512 groups, and common 16KB.If L1P is hit in the finger visit of getting of CPU, will return the Fetch Packet that needs the monocycle.
If do not hit L1P, that hit is L2, and for C64x, CPU will get clogged 0~7 cycle, and concrete numerical value depends on degree of parallelism and the residing at that time flow beat of carrying out bag.If also do not hit L2, then CPU will get clogged, and obtain corresponding Fetch Packet up to L2 from external memory space, send into L1P, send into CPU again.
L1D adopts two-way group associative structure (2-way set associative cache), and the row size is 64B, can buffer memory 128 groups.If the data access of CPU hits L1D, will return the data that need the monocycle.If do not hit L1D, that hit is L2, and CPU will get clogged 2~8 cycles.If also do not hit L2, CPU will get clogged, and obtain corresponding data up to L2 from external memory space, send into L1D, send into CPU again.Although for C64x, L1D and L1P provide a kind of stream treatment mechanism of cache miss, be called misspipeline disappearance flowing water, blocking period in the time of can reducing the 1st grade of cache miss, but because the CPU congestion situations that cache miss causes takes place, can improve the circulation step value by the size of cache line in order to reduce as far as possible; The frequent circulation of carrying out should can be put the L1P high-speed cache into as far as possible; Should take the double word alignment to raise the efficiency when store data or storage allocation.Step 05 code optimization again can be by using the TI built-in function, rewrite the C code, using linear compilation and data-moving optimization method to raise the efficiency.
Output feedback (OFB) pattern among the MPEG-4 cryptographic algorithm AES is applicable to the application that must avoid error propagation.It can encrypt the grouping of various sizes, but different is, as feedback be the output of encrypting block function E, but not ciphertext.
The OFB that is used for n bit groupings password has two versions usually.The ISO version needs the feedback of n bit, and early stage version needs the feedback of r<n bit.Because what use in the literary composition is r<n feedback, therefore only introduces the latter.This algorithm is as shown in Figure 4, and is specific as follows:
Be input as the key K of k bit, the clear packets x of IV of n bit (IV is the initial vector of n bit) and r bit 1... x u(1≤r≤n).Produce r bit ciphertext block c 1... c u
Encrypt: 1) I 1← IV, for 1≤j≤u, given clear packets x j2) O j← E k(I j) (I jBe the value of shift register), the output of calculating the grouping ciphertext; Wherein, E kBe meant among the block cipher E with the key K to be the encryption function of parameter, and E k -1Then expression deciphering.3) t j← O jThe r bit of the leftmost side; 4) c j ← x j ⊕ t j , The ciphertext group c of transmission r bit j5) I J+1← 2 rI j+ t jMod 2 n, with the t of output jMove into the right-hand member of shift register.
Deciphering: I 1← IV.For 1≤j≤u, to the c that receives jCalculate: x j ← c j ⊕ t j , T wherein j, O jAnd I jCalculating as implied above.
The operating characteristic of OFB pattern is: the value that 1) changes IV under identical plaintext can obtain a different ciphertext output; 2) key stream is independent of expressly; 3) arbitrary ciphertext character c of one or more bit mistake is arranged jOnly can influence the deciphering of this character, c jCertain bit position make mistakes and also make mistakes causing reducing relevant position expressly; 4) the OFB pattern can be recovered from ciphertext bit mistake, but can can't realize motor synchronizing after losing the ciphertext bit, because lose the layout that the ciphertext bit can destroy key stream.
The present invention is based on the OFB pattern of 128 block length AES, so except need are maintained secrecy to key, 128 initialization vector in the shift register that also needs protection.Therefore the distribution of initialization vector and key can adopt public key system to encrypt then because its data volume has only 256.Detailed process is:
Step 1: client sends session and sets up request.
Step 2: server end is received session foundation request back checking client's legitimacy.If the verification passes, then utilize the PKI of client that AES key and initialization vector are encrypted, send to client then; If disabled user's interrupt requests then.
Step 3: receiving end is utilized the private key of himself, and the ciphertext of receiving is decrypted, and obtains AES key and initialization vector, sends acknowledge message then.
Step 4: after receiving the client acknowledge message, server end uses corresponding AES key and initialization vector video is encrypted and to be encoded and send, and receiving end is then utilized AES key and initialization vector that video flowing is decrypted and decoded.
This MPEG AES has the little advantage of expense; can carry out certain protection to the MPEG-4 video; and have certain ability of resisting error propagation, and be adapted at interference networks, under the conditions such as wireless environment the lower video content of some significance levels is protected.

Claims (2)

1. the video encryption method based on Advanced Encryption Standard is characterized in that this method comprises the steps:
The first step: video coding handled making it on fixed-point dsp SDK platform, to realize, specifically as follows to the video coding treatment step:
11) code compiling and transplanting: the type double precision data are used instead the long categorical data, instruction Debugging message of the printf in the program code and Floating-point Computation are closed with the conditional compilation instruction, and recompilate;
12) project level Compiler Optimization: utilize the compiler interface option to call software pipeline, the software pipeline circulation feedback of highest level, increase the concurrency that software translating becomes the Digital Signal Processing code; Link makes dispositions in proper order to code segment simultaneously, and the cache miss that code call was brought when the minimizing program was carried out improves executing efficiency;
13) memory optimization: the second level memory of 1 Mbytes memory space is divided into the second level cache memory of 256 kilobytes and second level static RAM two parts of 768 kilobytes, data and code commonly used are placed on the static RAM of the on-chip memory second level, the external sync dynamic random access memory are set at cacheable to improve access efficiency;
14) cache memory cache optimization: the capable size of first order program high-speed cache is 32 and adopts direct mapping structure, the capable size of first order data high-speed buffer memory is 64 and adopts two-way group associative structure to improve the circulation step value, first order program high-speed cache is hit in the finger visit of getting of central processing unit, and the monocycle is returned the Fetch Packet that needs; If do not hit first order program high-speed cache, what hit is second level memory, carries out the degree of parallelism of bag and the cycle that flow beat decision central processing unit gets clogged; Otherwise central processing unit is blocked to second level memory and obtains corresponding Fetch Packet from external memory space, after sending into first order program high-speed cache, send into central processing unit again, take the double word alignment when store data or storage allocation, the central processing unit congestion situations that reduces to cause because of cache miss takes place;
15) carry out code optimization: use the image processing function library, this function is the assembly code of manual layout streamline,
Rewrite the C code: carry out packing data for the ease of the Digital Signal Processing compiler and handle, cycling quadruple in the program is launched, to improve flowing water efficient, for the circulation of iterations in compilation time the unknown, utilize bit arithmetic to launch, make compiler use the packing data technology to carry out stream treatment
Use linear compilation: C64x series digit signal processor in video encoder, use during the half-pix interpolation dotpu4, subabs4 command calculations absolute error and; The SPACK2 instruction is used for image reconstruction; Carry out the LDNDW instruction that pixel value reads when carrying out estimation in reference image frame, data do not satisfy the problem of double word alignment in the solution reference picture;
Data-moving: the use direct memory access that utilizes chip to support the storehouse to provide carries out function and the multichannel enhancement mode direct memory access (DMA) of employing that internal storage data transmits, the realization view data is moved, there is copy in the moving data for the treatment of in the synchronous DRAM in the cache memory of the second level, before the data-moving, the moving data for the treatment of in second level cache memory and the synchronous DRAM is carried out consistency operation, avoid program running to make mistakes;
Second step: video is encrypted with the output feedback mode of Advanced Encryption Standard: the frame format in the video is judged, if video object plane is an intra-frame encoding mode, then use the output feedback mode of Advanced Encryption Standard to encrypt to 8 * 8 direct current difference coefficient; Otherwise if video object plane is the intra-coded macroblock in inter prediction encoding pattern and the interframe bi-directional predictive coding pattern, then the direct current difference coefficient to piece in the macro block uses the output feedback mode of Advanced Encryption Standard to encrypt;
The 3rd step: send with decryption step as follows to encrypted video:
31) client sends session and sets up request;
32) server end receives that session sets up request back checking client's legitimacy, if the verification passes, then utilizes the PKI of client that Advanced Encryption Standard key and initialization vector are encrypted, and sends to client then, if disabled user's interrupt requests then;
33) client is utilized the private key of himself, and the ciphertext of receiving is decrypted, and obtains Advanced Encryption Standard key and initialization vector, sends acknowledge message then;
34) receive the client acknowledge message after, server end uses corresponding Advanced Encryption Standard key and initialization vector video is encrypted and to be encoded and send, client is then utilized Advanced Encryption Standard key and initialization vector that video flowing is decrypted and is decoded.
2. the video encryption method based on Advanced Encryption Standard as claimed in claim 1, it is characterized in that this method step 32 in the 3rd step), step 33), step 34) Advanced Encryption Standard be output feedback mode, the clear packets and the initial vector that are used for given bit, the output of calculating the grouping ciphertext.
CNB2008101226809A 2008-06-06 2008-06-06 Video encryption method based on Advanced Encryption Standard Expired - Fee Related CN100551056C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2008101226809A CN100551056C (en) 2008-06-06 2008-06-06 Video encryption method based on Advanced Encryption Standard

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2008101226809A CN100551056C (en) 2008-06-06 2008-06-06 Video encryption method based on Advanced Encryption Standard

Publications (2)

Publication Number Publication Date
CN101304525A CN101304525A (en) 2008-11-12
CN100551056C true CN100551056C (en) 2009-10-14

Family

ID=40114197

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2008101226809A Expired - Fee Related CN100551056C (en) 2008-06-06 2008-06-06 Video encryption method based on Advanced Encryption Standard

Country Status (1)

Country Link
CN (1) CN100551056C (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102843555B (en) * 2011-06-24 2017-07-14 中兴通讯股份有限公司 A kind of intra-frame prediction method and system
CN105162580A (en) * 2015-07-30 2015-12-16 苏州中科启慧软件技术有限公司 Lightweight stream cipher technology VHO based on OFB mode and block cipher VH
CN105652691A (en) * 2016-02-24 2016-06-08 中国地质大学(武汉) Power electronic control simulation system
CN105939484B (en) * 2016-06-14 2019-02-26 深圳创维数字技术有限公司 A kind of the encryption playback method and its system of audio-video
EP3407528A1 (en) * 2017-05-24 2018-11-28 Koninklijke Philips N.V. Cryptographic device and method
CN108650224B (en) * 2018-04-02 2022-02-25 广东地球村计算机系统股份有限公司 Password distribution method and data forwarding system thereof
JP6987707B2 (en) * 2018-06-28 2022-01-05 ルネサスエレクトロニクス株式会社 Semiconductor devices, image recognition systems
CN108833944A (en) * 2018-07-09 2018-11-16 中国联合网络通信集团有限公司 Method of video distribution
CN110800301A (en) * 2018-09-30 2020-02-14 深圳市大疆创新科技有限公司 Control method and device of coding equipment and storage medium
CN109947680A (en) * 2019-01-16 2019-06-28 佛山市顺德区中山大学研究院 A kind of software speed of service optimization method based on DSP
CN111639350B (en) * 2020-05-16 2023-01-31 中信银行股份有限公司 Cipher service system and encryption method

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
AES在MPEG-4视频加密中的应用. 陈勇,沙爱军.电力系统通信,第27卷第160期. 2006
AES在MPEG-4视频加密中的应用. 陈勇,沙爱军.电力系统通信,第27卷第160期. 2006 *
AES算法及其在DSP中优化实现. 章登义,毛从武,李永忠.计算机工程与科学,第27卷第9期. 2005
AES算法及其在DSP中优化实现. 章登义,毛从武,李永忠.计算机工程与科学,第27卷第9期. 2005 *

Also Published As

Publication number Publication date
CN101304525A (en) 2008-11-12

Similar Documents

Publication Publication Date Title
CN100551056C (en) Video encryption method based on Advanced Encryption Standard
CN103546750B (en) H.264 video encryption method based on region of interest
CN102905133A (en) Video stream-oriented hybrid encoding and encrypting method
US11012742B2 (en) Video scrambling method and device with adaptive mode selection, network camera and readable storage medium
CN100426859C (en) Selective encryption algorithm aiming at network video
CN102843558A (en) H.264/AVC (Advanced Video Coding) compressed domain video encryption/decryption device and encryption/decryption method thereof
Yang et al. Using M-ary decomposition and virtual bits for visually meaningful image encryption
Wang et al. Hash key-based video encryption scheme for H. 264/AVC
CN105051747B (en) Coding/decoding method, solution code system and non-transitory computer-readable medium
CN103747279A (en) Cloud storage and sharing coded video encryption and access control strategy updating method
CN104093029A (en) Video encryption algorithm based on new spatiotemporal chaos system
CN101790085A (en) Implementation method of family video monitoring system based on DaVinci technology
CN107077873A (en) Sample metadata is coupled with media sample
CN103856786A (en) Streaming media video encryption method and device based on H.264
CN100571395C (en) A kind of based on the encryption method of video flowing H.264
CN101489123B (en) Digital video content fast protection and deprotection method
Yuan et al. On the security of encrypted jpeg image with adaptive key generated by invariant characteristic
CN105491399A (en) Image processing apparatus and control method thereof
CN100518280C (en) Video encrypting/deciphering device and encrypting/deciphering method
Hong et al. The study of selective encryption of motion vector based on the S-Box for the security improvement in the process of video
CN107294946A (en) Data protection method
CN201663660U (en) Data encryption and data decryption system of digital video
DK2485488T3 (en) Media decoder and a decoding method which allows for the tracking of the media decoder
Jeong et al. A generic partial encryption scheme for low-power mobile devices
Wang et al. Parallel algorithm of IDCT with GPUs and CUDA for large-scale video quality of 3G

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20091014

Termination date: 20140606