CN110035319A - A kind of encryption and decryption method of audio, video data, device and playback equipment - Google Patents

A kind of encryption and decryption method of audio, video data, device and playback equipment Download PDF

Info

Publication number
CN110035319A
CN110035319A CN201910263400.4A CN201910263400A CN110035319A CN 110035319 A CN110035319 A CN 110035319A CN 201910263400 A CN201910263400 A CN 201910263400A CN 110035319 A CN110035319 A CN 110035319A
Authority
CN
China
Prior art keywords
data
frame
audio
feature
encryption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910263400.4A
Other languages
Chinese (zh)
Other versions
CN110035319B (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.)
Anhui Wenxiang Information Technology Co Ltd
Original Assignee
Beijing Wen Xiang Information Technology Co Ltd
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 Beijing Wen Xiang Information Technology Co Ltd filed Critical Beijing Wen Xiang Information Technology Co Ltd
Priority to CN201910263400.4A priority Critical patent/CN110035319B/en
Publication of CN110035319A publication Critical patent/CN110035319A/en
Application granted granted Critical
Publication of CN110035319B publication Critical patent/CN110035319B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/172Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • H04N21/4394Processing of audio elementary streams involving operations for analysing the audio stream, e.g. detecting features or characteristics in audio streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4408Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving video stream encryption, e.g. re-encrypting a decrypted video stream for redistribution in a home network

Abstract

The present invention discloses encryption and decryption method, device and the playback equipment of a kind of audio, video data, and wherein encryption method includes: acquisition audio/video flow data, and to audio/video flow data encoding;Feature frame data are extracted from the audio/video flow data after coding;Obtain the encryption rule of the feature frame data of present frame;According to the encryption rule of the feature frame data of present frame, feature frame data are encrypted frame by frame until the feature frame data of tail frame complete encryption.The present invention is real-time encrypted to encoded audio/video flow data frame by frame using the encryption rule of the feature frame data of present frame, largely, the safety of audio/video flow data can be increased, in order to avoid audio/video flow data are parsed easily, meanwhile excessive datarams are occupied without being related to complicated Encryption Algorithm, therefore, data encryption memory can be also saved, and then the transmission speed of audio/video flow data can be improved.

Description

A kind of encryption and decryption method of audio, video data, device and playback equipment
Technical field
The present invention relates to audio-video security technology areas, and in particular to a kind of encryption and decryption method of audio, video data, dress It sets and playback equipment.
Background technique
With the rapid development of network and multimedia technology, more and more audio, video datas start wide on the internet General application, meanwhile, also with the continuous enhancing of the Copyright Awareness of people, people begin to focus on the copyright protection to audio, video data And safe and secret problem.Therefore, the encipherment protection of audio, video data is more and more important in internet communication transmission.
The cipher mode of audio, video data in currently available technology is usually to the complete of the audio-video document recorded Portion's data information is encrypted simultaneously as a whole, and therefore, the total data of the audio-video document uses identical close Key carries out safeguard protection, it is clear that and its safety is poor, also, as the data volume of the audio-video document of recording is increasing, because This, required encryption times also can be elongated, and encryption efficiency is caused to reduce.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of encryption method of audio, video data, to solve in the prior art Audio, video data cipher mode, safety is poor, the lower problem of encryption efficiency.
According in a first aspect, including the following steps: the embodiment of the invention provides a kind of encryption method of audio, video data
Audio/video flow data are obtained, and to the audio/video flow data encoding;
Feature frame data are extracted from the audio/video flow data after the coding;
Obtain the encryption rule of the feature frame data of present frame;
According to the encryption rule of the feature frame data of the present frame, the feature frame data are encrypted frame by frame Until the feature frame data of tail frame complete encryption.
With reference to first aspect, in first aspect first embodiment, the feature frame data for obtaining present frame Encryption rule the step of further include:
Obtain the size of data of the feature frame data of the present frame;
Obtain the first encryption identification that the feature frame data of the former frame of the present frame generate;
Obtain the identification byte digit of first encryption identification;
Preset byte is set and is aligned digit;
According to calculate the size of data, the identification byte digit with the preset byte and be aligned digit and, generation Second encryption identification of the feature frame data of the present frame.
With reference to first aspect or first aspect first embodiment states characteristic frame in first aspect second embodiment Data include: intracoded frame, forward prediction frame and bi-directional predicted frames.
First embodiment with reference to first aspect, in first aspect third embodiment, the identification byte digit is 32 or 64 or 128 or 256.
According to second aspect, the embodiment of the invention provides a kind of decryption methods of audio, video data, comprising:
Obtain encrypted feature frame data;
Obtain the decryption rule of the feature frame data of present frame;
According to the decryption rule of the feature frame data of the present frame, the feature frame data are decrypted frame by frame Until the feature frame data of tail frame complete decryption;
The feature frame data after the decryption are decoded to obtain the audio/video flow data.
In conjunction with second aspect, in second aspect first embodiment, the feature frame data for obtaining present frame Decryption rule step further include:
Obtain the size of data of the feature frame data of the present frame;
Obtain the first decryption mark that the feature frame data of the former frame of the present frame generate;
Obtain the identification byte digit of the first decryption mark;
Preset byte is set and is aligned digit;
According to calculate the size of data, the identification byte digit with the preset byte and be aligned digit and, generation For decrypting the second decryption mark of the feature frame data of the present frame.
In conjunction with second aspect or second aspect first embodiment, in second aspect second embodiment, the feature Frame data include: intracoded frame, forward prediction frame and bi-directional predicted frames.
In conjunction with second aspect first embodiment, in second aspect third embodiment, the characteristic frame data include: Intracoded frame, forward prediction frame and bi-directional predicted frames.
According to the third aspect, the embodiment of the present invention provides a kind of encryption device of audio, video data, comprising:
First obtains module, for obtaining audio/video flow data, and to the audio/video flow data encoding;
Extraction module, for extracting feature frame data from the audio/video flow data after the coding;
Second obtains module, the encryption rule of the feature frame data for obtaining present frame;
Encrypting module, for the encryption rule of the feature frame data according to the present frame, to the feature frame number Encryption is completed according to the feature frame data encrypted frame by frame until tail frame.
According to fourth aspect, the embodiment of the present invention provides a kind of decryption device of audio, video data, comprising:
Third obtains module, for obtaining encrypted feature frame data;
4th obtains module, the decryption rule of the feature frame data for obtaining present frame;
Deciphering module, for the decryption rule of the feature frame data according to the present frame, to the feature frame number Decryption is completed according to the feature frame data being decrypted frame by frame until tail frame;
Decoder module, for being decoded to obtain the audio-video fluxion to the feature frame data after the decryption According to.
According to the 5th aspect, the embodiment of the present invention provides a kind of storage medium, is stored thereon with computer instruction, the instruction Audio, video data described in any one embodiment of first aspect or first aspect is realized when being executed by processor The step of encryption method;Or, realizing audio-video number described in any one embodiment of second aspect or second aspect According to decryption method the step of.
According to the 6th aspect, the embodiment of the present invention provides a kind of playback equipment, including memory, processor and is stored in On reservoir and the computer program that can run on a processor, the processor realizes first aspect or the when executing described program The step of encryption method of audio, video data described in one side any embodiment;Or, realizing second aspect or second aspect The step of decryption method of audio, video data described in any embodiment.
Technical solution of the embodiment of the present invention, has the advantages that
The present invention provides encryption and decryption method, device and the playback equipment of a kind of audio, video data, wherein encryption method, It include: acquisition audio/video flow data, and to audio/video flow data encoding;Characteristic frame is extracted from the audio/video flow data after coding Data;Obtain the encryption rule of the feature frame data of present frame;According to the encryption rule of the feature frame data of present frame, to feature Frame data are encrypted frame by frame until the feature frame data of tail frame complete encryption.The present invention utilizes the feature frame data of present frame Encryption rule is real-time encrypted to encoded audio/video flow data frame by frame, largely, can increase audio/video flow data Safety, in order to avoid audio/video flow data are parsed easily, meanwhile, the Encryption Algorithm without being related to complicated occupies excessive data Therefore memory can also save data encryption memory, and then the transmission speed of audio/video flow data can be improved.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below Attached drawing is some embodiments of the present invention, for those of ordinary skill in the art, before not making the creative labor It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 is the first pass figure of the encryption method of audio, video data in the embodiment of the present invention;
Fig. 2 is the second flow chart of the encryption method of audio, video data in the embodiment of the present invention;
Fig. 3 is the arrangement architecture of the feature frame data in the embodiment of the present invention;
Fig. 4 is the first pass figure of the decryption method of audio, video data in the embodiment of the present invention;
Fig. 5 is the second flow chart of the decryption method of audio, video data in the embodiment of the present invention;
Fig. 6 is the structural block diagram of the encryption device of audio, video data in the embodiment of the present invention;
Fig. 7 is the structural block diagram of the decryption device of audio, video data in the embodiment of the present invention;
Fig. 8 is the hardware structural diagram of the playback equipment in the embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those skilled in the art are not having Every other embodiment obtained under the premise of creative work is made, shall fall within the protection scope of the present invention.
Embodiment 1
The embodiment of the present invention provides a kind of encryption method of audio, video data, as shown in Figure 1, including the following steps:
Step S1: audio/video flow data are obtained, and to audio/video flow data encoding.Audio/video flow data herein indicate benefit It is being recorded with stream media equipment and continuous audio data and/or video data, not stream media equipment has recorded Audio, video data.Therefore, the audio/video flow data in the present embodiment are the audio data and/video data of real-time recording, such as: Audio/video flow data can be MP3 audio data or MP4 video data.In order to which audio/video flow data can preferably carry out data Transmission, needs to encode audio and video data streams, i.e., audio/video flow data is transformed into the coded data of binary form, this Coding in embodiment uses h264 coded format, adds after being encoded in real time to audio/video flow data using h264 coded format It is close.
Step S2: feature frame data are extracted from the audio/video flow data after coding.Feature frame data herein are in frame Coded frame, forward prediction frame and bi-directional predicted frames, wherein intracoded frame is the I frame in h264 coded format, forward prediction frame For the P frame in h264 format, bi-directional predicted frames are the B frame in h264 coded format.I frame, P frame and B frame are as audio/video flow Key frame extracts the I frame, P frame and B frame of every frame audio/video flow data according to the frame identification for analyzing every frame audio/video flow data. Feature frame data are as the important information in audio/video flow data, as long as effectively being encrypted to these important informations, so that it may The safety for ensuring audio/video flow data is encrypted without the whole content information to audio/video flow data, therefore, very In big degree, the data encryption size of audio/video flow data can be reduced, is conducive to the transmission speed for improving data.
Step S3: the encryption rule of the feature frame data of present frame is obtained.Encryption rule herein is the encryption of present frame Mode.
In one embodiment, above-mentioned steps S3 is during execution, as shown in Fig. 2, may particularly include following step It is rapid:
Step S31: the size of data of the feature frame data of present frame is obtained.Audio/video flow data are to arrange frame by frame in sequence It is listed in frame frequency queue, therefore, extracted feature frame data are also to arrange frame by frame in sequence from audio/video flow data. As shown in figure 3, audio/video flow data arrange in sequence in frame frequency queue, and such as: No. 5 feature frame data in Fig. 3 are made For the feature frame data of present frame, if the size of data of No. 5 feature frame data is Size, the data of No. 5 feature frame data Size is 1000KB, i.e. Size5=1000KB.
Step S32: the first encryption identification that the feature frame data of the former frame of present frame generate is obtained.Such as: No. 5 features For frame data as current frame data, the feature frame data of former frame are No. 4 feature frame data, obtain No. 4 feature frame data The first encryption identification generated, the first encryption identification can be different types of letter or number or different types of word Female or number combinatorics on words.
Step S33: the identification byte digit of the first encryption identification is obtained.The identification byte digit of first encryption identification can be with It is 32 or 64 or 128 or 256, preferably 32, the identification byte digit of certain first encryption identification can also be 64 Position or 128 or 256, still, digit is higher, and the size of datarams occupied will be bigger, so, select suitable word Byte length of the section number as the first encryption identification, in order to avoid the excessive influence audio/video flow of the size of data of the first encryption identification Data transmission.
Step S34: setting preset byte is aligned digit.Preset byte alignment digit herein is in order to real on memory space The digit of existing byte data alignment and setting, i.e. the alignment value of specified data structural body or class.Predetermined word in the present embodiment Section alignment digit is 2n, n >=3, the preferred n=3 of the present embodiment, i.e., preferred preset byte alignment digit is 8, it is, of course, also possible to be 16, it is still, on the other hand suitable also for the size of guarantee data on the one hand for byte data alignment, therefore it is preferred that predetermined word Section alignment digit is 8.
Step S35: according to calculate size of data, the first encryption identification be aligned with preset byte digit and, generate currently Second encryption identification of the feature frame data of frame.Such as: the first encryption identification is the characteristic frame of the former frame of No. 5 feature frame data The mark that data generate, i.e. No. 4 feature frame data key identifications generated, and the size of data Size of No. 5 feature frame data5 =1000KB, it is 8 that preset byte, which is aligned digit, and the identification byte digit of the first encryption identification is 32, therefore according to calculating 1000+8+ 32=1040, i.e. the second encryption identification are 1040.Such as: the first encryption identification is the feature of the former frame of No. 2 feature frame data The mark of the generation of frame data, i.e. No. 1 feature frame data key identification generated, and the size of data of No. 2 feature frame data Size2=500KB, it is 8 that preset byte, which is aligned digit, and the identification byte digit of the first encryption identification is 32, therefore according to calculating 500 + 8+32=540, i.e. the second encryption identification are 540.
The process of the second encryption identification, as the feature frame data of present frame are generated according to above-mentioned steps S31- step S35 Encryption rule.The encryption rule is based on the close SM4ECB mode encryption of state, and encryption rule adaptation exists in audio/video flow data Every frame data of all frame data in recording process, i.e. audio/video flow data can be encrypted in this manner, i.e., after The encryption identification of the feature frame data of one frame relies on the encryption identification of the feature frame data of its former frame, advises according to such encryption Then make audio/video flow data that there is stronger safety, using the encryption rule in the present embodiment in audio/video flow data Every frame feature frame data are encrypted, so that all feature frame data are not easy to be resolved, enhance audio/video flow data Safety.
Step S4: according to the encryption rule of the feature frame data of present frame, to feature frame data encrypted frame by frame until The feature frame data of tail frame complete encryption.
Specifically, such as: in Fig. 3, the identification byte digit of the first encryption identification that No. 1 feature frame data generate is 32, and the size of data of No. 2 feature frame data, Size2=500KB, it is 8 that preset byte, which is aligned digit, and No. 2 feature frame data As present frame, then the encryption identification of No. 2 feature frame data is 500+8+32=540.And so on, by No. 3 feature frame data As present frame, the feature frame data of former frame are No. 2 feature frame data, and the identification byte digit of No. 2 encryption identifications 540 It also is 32, the size of data of No. 3 feature frame data, Size3=700KB, then the encryption identification of No. 3 feature frame data is 700+ 8+32=740.And so on, using No. 4 feature frame data as present frame, the feature frame data of former frame are No. 3 characteristic frames Data, and the identification byte digit of No. 4 encryption identifications 740 is also 32, the size of data of No. 3 feature frame data, Size3= 900KB, then the encryption identification of No. 4 feature frame data is 900+8+32=940.And so on, using No. 5 feature frame data as working as The feature frame data of previous frame, former frame are No. 4 feature frame data, and the identification byte digit of No. 4 encryption identifications 940 is also 32 Position, the size of data of No. 5 feature frame data, Size3=100KB, then the encryption identification of No. 5 feature frame data is 1000+8+32 =1040.According to such cipher mode, the encryption identification of the feature frame data of a later frame relies on the feature frame data of its former frame Encryption identification, to feature frame data in Fig. 3 encrypted frame by frame until tail frame N frame complete encryption, it is ensured that in real time record The audio/video flow data of system are not easy to be cracked, and significantly enhance the safety of audio/video flow data, meanwhile, compared to tradition to Whole audio, video datas of recording are encrypted using same key based on complicated Encryption Algorithm, largely, it is possible to reduce The size of data of audio-video Stream Data Transmission.
The encryption method of audio, video data in the embodiment of the present invention utilizes the encryption rule of the feature frame data of present frame It is real-time encrypted to encoded audio/video flow data frame by frame, largely, the safety of audio/video flow data can be increased, In case audio/video flow data are parsed easily, meanwhile, the Encryption Algorithm without being related to complicated occupies excessive datarams, because This, can also save data encryption memory, and then the transmission speed of audio/video flow data can be improved.
Embodiment 2
The embodiment of the present invention provides a kind of decryption method of audio, video data, as shown in Figure 4, comprising:
Step S41: encrypted feature frame data are obtained.Encrypted feature frame data are encrypted all frames herein Feature frame data, that is, increased the feature frame data of all frames of upper key.
Step S42: the decryption rule of the feature frame data of present frame is obtained.Decryption rule herein is the decryption of present frame Mode.
In one embodiment, above-mentioned steps S42 is during execution, as shown in figure 5, may particularly include following step It is rapid:
Step S51: the size of data of the feature frame data of present frame is obtained.Audio/video flow data are to arrange frame by frame in sequence It is listed in frame frequency queue, therefore, extracted feature frame data are also to arrange frame by frame in sequence from audio/video flow data. As shown in figure 3, audio/video flow data arrange in sequence in frame frequency queue, and such as: No. 5 feature frame data in Fig. 3 are made For the feature frame data of present frame, if the size of data of No. 5 feature frame data is Size5, the data of No. 5 feature frame data Size is 1000KB, i.e. Size5=1000KB.
Step S52: the first decryption mark that the feature frame data of the former frame of present frame generate is obtained.Such as: No. 5 features For frame data as current frame data, the feature frame data of former frame are No. 4 feature frame data, obtain No. 4 feature frame data The the first decryption mark generated, the first decryption mark can be different types of letter or number or different types of word Female or number combinatorics on words.
Step S53: the identification byte digit of the first decryption mark is obtained.The identification byte digit of first decryption mark can be with It is 32 or 64 or 128 or 256, preferably 32, the identification byte digit of certain first decryption mark can also be 64 Position or 128 or 256, still, digit is higher, and the size of datarams occupied will be bigger, so, select suitable word Byte length of the section number as the first decryption mark, in order to avoid the excessive influence audio/video flow of size of data of the first decryption mark Data transmission.
Step S54: setting preset byte is aligned digit.Preset byte alignment digit herein is in order to real on memory space The digit of existing byte data alignment and setting, i.e. the alignment value of specified data structural body or class.Predetermined word in the present embodiment Section alignment digit is 2n, n >=3, the preferred n=3 of the present embodiment, i.e., preferred preset byte alignment digit is 8, it is, of course, also possible to be 16, it is still, on the other hand suitable also for the size of guarantee data on the one hand for byte data alignment, therefore it is preferred that predetermined word Section alignment digit is 8.
Step S55: according to calculate size of data, identification byte digit be aligned with preset byte digit and, generation is used for Decrypt the second decryption mark of the feature frame data of present frame.Such as: present frame is No. 5 feature frame data, No. 5 feature frame data Size of data Size5=1000KB, the feature frame data of former frame are No. 4 feature frame data, and No. 4 feature frame data generate First decryption mark identification byte digit 32, preset byte be aligned digit be 8, i.e., the data of No. 5 feature frame data are big Small, identification byte digit and preset byte alignment digit and be 1040, i.e., second decryption be identified as 1040, data store Spatially, it needs that 1040 the second decryption mark is decrypted.It is identified according to the first decryption that No. 4 feature frame data generate The size of data of identification byte digit, preset byte alignment digit and No. 5 feature frame data, reverse moving characteristic frame data Byte location is decrypted to obtain encoded audio/video flow data to the second decryption mark in turn.
According to the process of above-mentioned steps S51- step S55 the second decryption mark generated, as the feature frame number of present frame According to decryption rule.The decryption rule is based on the close SM4ECB mode decryption of state, which adapts in audio/video flow data Every frame data of all frame data in recording process, i.e. audio/video flow data can be decrypted in this manner, i.e., The solution of decryption mark to the feature frame data of its former frame is relied on the decryption of the decryption mark of the feature frame data of a later frame It is close, quickly feature frame data can be decrypted in this manner.
Step S43: according to present frame feature frame data decryption rule, to feature frame data be decrypted frame by frame until The feature frame data of tail frame complete decryption.Specifically, such as: in Fig. 3, the first decryption mark that No. 1 feature frame data generate Identification byte digit be 32, and the size of data of No. 2 feature frame data, Size2=500KB, preset byte alignment digit are 8, and No. 2 feature frame data as present frame, then the decryption of No. 2 feature frame data is identified as 500+8+32=540, deposits in data Storage spatially, needs that 540 the second decryption mark is decrypted.And so on, using No. 3 feature frame data as present frame, The feature frame data of its former frame are No. 2 feature frame data, and the identification byte digit of No. 2 decryption marks 540 is also 32,3 The size of data of number feature frame data, Size3=700KB, then the decryption of No. 3 feature frame data is identified as 700+8+32=740, On data space, need that 740 the second decryption mark is decrypted.And so on, using No. 4 feature frame data as Present frame, the feature frame data of former frame are No. 3 feature frame data, and the identification byte digit of No. 4 decryption marks 740 is also 32, the size of data of No. 3 feature frame data, Size3=900KB, then the decryption of No. 4 feature frame data is identified as 900+8+32 =940, on data space, need that 940 the second decryption mark is decrypted.And so on, by No. 5 feature frame numbers It is No. 4 feature frame data according to the feature frame data as present frame, former frame, and the identifier word section of No. 4 decryption marks 940 Number is also 32, the size of data of No. 5 feature frame data, Size3=100KB, then the decryption of No. 5 feature frame data is identified as 1000+8+32=1040 on data space needs that 1040 the second decryption mark is decrypted.According to such solution Close mode, i.e. the decryption mark of the feature frame data of a later frame relies on the decryption mark of the feature frame data of its former frame, to Fig. 3 The N frame completion decryption until tail frame is decrypted in middle feature frame data frame by frame, can fast implement to encoded audio-video fluxion According to decoding, it is ensured that be the safety with audio/video flow data.
Step S44: the feature frame data after decryption are decoded to obtain audio/video flow data.To with binary system after decryption The feature frame data of form storage are decoded, and can be restored audio-video picture when recording, be used stream media playing device It can normal play.
Embodiment 3
The embodiment of the present invention provides a kind of encryption device of audio, video data, as shown in Figure 6, comprising:
First obtains module 61, for obtaining audio/video flow data, and to audio/video flow data encoding.
Extraction module 62, for extracting feature frame data from the audio/video flow data after coding.
Second obtains module 63, the encryption rule of the feature frame data for obtaining present frame.
Encrypting module 64 carries out feature frame data for the encryption rule of the feature frame data according to present frame frame by frame It encrypts until the feature frame data of tail frame complete encryption.
The encryption device of audio, video data in the embodiment of the present invention, in Fig. 6, second obtains module 63 further include:
First acquisition submodule 631, the size of data of the feature frame data for obtaining present frame;
Second acquisition submodule 632, the first encryption mark generated for obtaining the feature frame data of former frame of present frame Know;
Third acquisition submodule 633, for obtaining the identification byte digit of the first encryption identification;
First setting submodule 634, is aligned digit for this setting preset byte;
Submodule 635 is generated, for being aligned digit with preset byte according to calculating size of data, identification byte digit With generate the second encryption identification of the feature frame data of present frame.
The encryption device of audio, video data in the embodiment of the present invention, characteristic frame data include: intracoded frame, pre- forward Survey frame and bi-directional predicted frames.
The encryption device of audio, video data in the embodiment of the present invention, identification byte digit are 32 or 64 or 128 Or 256.
The encryption device of audio, video data in the embodiment of the present invention utilizes the encryption rule of the feature frame data of present frame It is real-time encrypted to encoded audio/video flow data frame by frame, largely, the safety of audio/video flow data can be increased, In case audio/video flow data are parsed easily, meanwhile, the Encryption Algorithm without being related to complicated occupies excessive datarams, because This, can also save data encryption memory, and then the transmission speed of audio/video flow data can be improved.
Embodiment 4
The decryption device of audio, video data in the embodiment of the present invention, as shown in fig. 7, comprises:
Third obtains module 71, for obtaining encrypted feature frame data.
4th obtains module 72, the decryption rule of the feature frame data for obtaining present frame.
Deciphering module 73 carries out feature frame data for the decryption rule of the feature frame data according to present frame frame by frame It decrypts until the feature frame data of tail frame complete decryption.
Decoder module 74, for being decoded to obtain audio/video flow data to the feature frame data after decryption.
The decryption device of audio, video data in the embodiment of the present invention, in Fig. 7, the 4th obtains module 72 further include:
First acquisition submodule 721, the size of data of the feature frame data for obtaining present frame;
Second acquisition submodule 722, the first solution secret mark generated for obtaining the feature frame data of former frame of present frame Know;
Third acquisition submodule 723, for obtaining the first decryption character learning section number;
Second setting submodule 724, for obtaining default alignment digit;
Submodule 725 is decrypted, for being aligned digit with preset byte according to calculating size of data, identification byte digit With, decrypt present frame feature frame data generate second decryption mark.
The decryption device of audio, video data in the embodiment of the present invention, characteristic frame data include: intracoded frame, pre- forward Survey frame and bi-directional predicted frames.
The decryption device of audio, video data in the embodiment of the present invention, identification byte digit are 32 or 64 or 128 Or 256.
The decryption device of audio, video data in the embodiment of the present invention, based on decryption rule, i.e., to the characteristic frame of a later frame The decryption of the decryption mark of data relies on the decryption of the decryption mark to the feature frame data of its former frame, in this manner can be fast Feature frame data are decrypted in speed.
Embodiment 5
The embodiment of the present invention provides a kind of storage medium, is stored thereon with computer instruction, which is executed by processor The step of method in Shi Shixian embodiment 1 or embodiment 2.Audio/video flow data, characteristic frame are also stored on the storage medium The identification byte digit, pre- of data, the encryption rule of the feature frame data of present frame, the first encryption identification, the first encryption identification If byte-aligned digit, decryption rule etc..Wherein, storage medium can be magnetic disk, CD, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), flash memory (Flash Memory), hard disk (Hard Disk Drive, abbreviation: HDD) or solid state hard disk (Solid-State Drive, SSD) etc.;Institute State the combination that storage medium can also include the memory of mentioned kind.
It is that can lead to it will be understood by those skilled in the art that realizing all or part of the process in above-described embodiment method Computer program is crossed to instruct relevant hardware and complete, program can be stored in a computer-readable storage medium, the journey Sequence is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, storage medium can for magnetic disk, CD, read-only deposit Store up memory body (ROM) or random access memory (RAM) etc..
Embodiment 6
The embodiment of the present invention provides a kind of playback equipment, as shown in figure 8, including memory 820, processor 810 and storage On memory 820 and the computer program that can run on processor 810, processor 810 realize embodiment 1 when executing program Or in embodiment 2 the step of method.
Fig. 8 is a kind of hardware knot of playback equipment of the processing method of execution list items operation provided in an embodiment of the present invention Structure schematic diagram, as shown in figure 8, the playback equipment includes one or more processors 810 and memory 820, with one in Fig. 8 For processor 810.
The playback equipment for executing the processing method of list items operation can also include: input unit 830 and output device 840。
Processor 810, memory 820, input unit 830 and output device 840 can pass through bus or other modes It connects, in Fig. 8 for being connected by bus.
Processor 810 can be central processing unit (Central Processing Unit, CPU).Processor 810 may be used also Think other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, The combination of the chips such as discrete hardware components or above-mentioned all kinds of chips.
Obviously, the above embodiments are merely examples for clarifying the description, and does not limit the embodiments.It is right For those of ordinary skill in the art, can also make on the basis of the above description it is other it is various forms of variation or It changes.There is no necessity and possibility to exhaust all the enbodiments.And it is extended from this it is obvious variation or It changes still within the protection scope of the invention.

Claims (12)

1. a kind of encryption method of audio, video data, which comprises the steps of:
Audio/video flow data are obtained, and to the audio/video flow data encoding;
Feature frame data are extracted from the audio/video flow data after the coding;
Obtain the encryption rule of the feature frame data of present frame;
According to the encryption rule of the feature frame data of the present frame, to the feature frame data encrypted frame by frame until The feature frame data of tail frame complete encryption.
2. the encryption method of audio, video data according to claim 1, which is characterized in that described to obtain the described of present frame The step of encryption rule of feature frame data further include:
Obtain the size of data of the feature frame data of the present frame;
Obtain the first encryption identification that the feature frame data of the former frame of the present frame generate;
Obtain the identification byte digit of first encryption identification;
Preset byte is set and is aligned digit;
According to calculate the size of data, the identification byte digit with the preset byte and be aligned digit and, described in generation Second encryption identification of the feature frame data of present frame.
3. the encryption method of -2 described in any item audio, video datas according to claim 1, which is characterized in that the feature frame number According to including: intracoded frame, forward prediction frame and bi-directional predicted frames.
4. the encryption method of audio, video data according to claim 2, which is characterized in that the identification byte digit is 32 Position or 64 or 128 or 256.
5. a kind of decryption method of audio, video data characterized by comprising
Obtain encrypted feature frame data;
Obtain the decryption rule of the feature frame data of present frame;
According to the present frame the feature frame data decryption rule, to the feature frame data decrypted frame by frame until The feature frame data of tail frame complete decryption;
The feature frame data after the decryption are decoded to obtain the audio/video flow data.
6. the decryption method of audio, video data according to claim 5, which is characterized in that described to obtain the described of present frame The step of the decryption rule of feature frame data further include:
Obtain the size of data of the feature frame data of the present frame;
Obtain the first decryption mark that the feature frame data of the former frame of the present frame generate;
Obtain the identification byte digit of the first decryption mark;
Preset byte is set and is aligned digit;
According to calculate the size of data, the identification byte digit with the preset byte and be aligned digit and, generation is used for Decrypt the second decryption mark of the feature frame data of the present frame.
7. according to the decryption method of the described in any item audio, video datas of claim 5-6, which is characterized in that the feature frame number According to including: intracoded frame, forward prediction frame and bi-directional predicted frames.
8. the decryption method of audio, video data according to claim 6, which is characterized in that the identification byte digit is 32 Position or 64 or 128 or 256.
9. a kind of encryption device of audio, video data characterized by comprising
First obtains module, for obtaining audio/video flow data, and to the audio/video flow data encoding;
Extraction module, for extracting feature frame data from the audio/video flow data after the coding;
Second obtains module, the encryption rule of the feature frame data for obtaining present frame;
Encrypting module, for the encryption rule of the feature frame data according to the present frame, to the feature frame data by Frame is encrypted until the feature frame data of tail frame complete encryption.
10. a kind of decryption device of audio, video data characterized by comprising
Third obtains module, for obtaining encrypted feature frame data;
4th obtains module, the decryption rule of the feature frame data for obtaining present frame;
Deciphering module, for the feature frame data according to the present frame decryption rule, to the feature frame data by Frame is decrypted until the feature frame data of tail frame complete decryption;
Decoder module, for being decoded to obtain the audio/video flow data to the feature frame data after the decryption.
11. a kind of storage medium, is stored thereon with computer instruction, which is characterized in that the realization when instruction is executed by processor The step of encryption method of the described in any item audio, video datas of claim 1-4;Or, realizing any one of claim 5-8 institute The step of decryption method for the audio, video data stated.
12. a kind of playback equipment including memory, processor and stores the calculating that can be run on a memory and on a processor Machine program, which is characterized in that the processor realizes the described in any item audio-video numbers of claim 1-4 when executing described program According to encryption method the step of;Or, the step of realizing the decryption method of the described in any item audio, video datas of claim 5-8.
CN201910263400.4A 2019-04-02 2019-04-02 Audio and video data encryption and decryption methods and devices and playing equipment Active CN110035319B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910263400.4A CN110035319B (en) 2019-04-02 2019-04-02 Audio and video data encryption and decryption methods and devices and playing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910263400.4A CN110035319B (en) 2019-04-02 2019-04-02 Audio and video data encryption and decryption methods and devices and playing equipment

Publications (2)

Publication Number Publication Date
CN110035319A true CN110035319A (en) 2019-07-19
CN110035319B CN110035319B (en) 2020-05-15

Family

ID=67237331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910263400.4A Active CN110035319B (en) 2019-04-02 2019-04-02 Audio and video data encryption and decryption methods and devices and playing equipment

Country Status (1)

Country Link
CN (1) CN110035319B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111031353A (en) * 2019-12-11 2020-04-17 上海乐相科技有限公司 Video encryption method and device
CN111813965A (en) * 2020-05-14 2020-10-23 北京嘀嘀无限科技发展有限公司 Encryption method, decryption method, storage medium and electronic equipment for multimedia file
CN112333540A (en) * 2020-10-26 2021-02-05 浙江大华技术股份有限公司 Method and device for determining video encryption length
CN114363658A (en) * 2021-12-30 2022-04-15 慧之安信息技术股份有限公司 Method and device for encrypted transmission of audio and video stream

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102867153A (en) * 2012-08-30 2013-01-09 腾讯科技(深圳)有限公司 Methods and devices for encrypting and decrypting video file and mobile terminal
CN103338385A (en) * 2012-02-08 2013-10-02 Vixs系统公司 Video processing system and corresponding method
CN104918243A (en) * 2015-06-15 2015-09-16 上海交通大学 Mobile terminal secrecy system and method based on quantum true random number
CN105790925A (en) * 2014-12-24 2016-07-20 北京奇虎科技有限公司 Data encryption method, data decryption method, data encryption device and data decryption device
CN105850144A (en) * 2013-11-04 2016-08-10 耐瑞唯信有限公司 Device and method to mark digital audio or audio and/or video content
CN106303584A (en) * 2016-08-10 2017-01-04 北京蛙视通信技术股份有限公司 The audio, video data of transmission is carried out encipher-decipher method
CN106533652A (en) * 2015-09-15 2017-03-22 中兴通讯股份有限公司 XTS-SM4-based storage encryption and decryption method and device
CN106878013A (en) * 2017-03-20 2017-06-20 网宿科技股份有限公司 A kind of encryption and decryption method and device of file
CN107276969A (en) * 2016-04-08 2017-10-20 杭州海康威视数字技术股份有限公司 The transmission method and device of a kind of data
US20180295376A1 (en) * 2016-04-03 2018-10-11 Cisco Technology, Inc. Interleaved watermarking
CN108924099A (en) * 2018-06-15 2018-11-30 清华大学深圳研究生院 encryption method, encryption device, encryption performance analysis method and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103338385A (en) * 2012-02-08 2013-10-02 Vixs系统公司 Video processing system and corresponding method
CN102867153A (en) * 2012-08-30 2013-01-09 腾讯科技(深圳)有限公司 Methods and devices for encrypting and decrypting video file and mobile terminal
CN105850144A (en) * 2013-11-04 2016-08-10 耐瑞唯信有限公司 Device and method to mark digital audio or audio and/or video content
CN105790925A (en) * 2014-12-24 2016-07-20 北京奇虎科技有限公司 Data encryption method, data decryption method, data encryption device and data decryption device
CN104918243A (en) * 2015-06-15 2015-09-16 上海交通大学 Mobile terminal secrecy system and method based on quantum true random number
CN106533652A (en) * 2015-09-15 2017-03-22 中兴通讯股份有限公司 XTS-SM4-based storage encryption and decryption method and device
US20180295376A1 (en) * 2016-04-03 2018-10-11 Cisco Technology, Inc. Interleaved watermarking
CN107276969A (en) * 2016-04-08 2017-10-20 杭州海康威视数字技术股份有限公司 The transmission method and device of a kind of data
CN106303584A (en) * 2016-08-10 2017-01-04 北京蛙视通信技术股份有限公司 The audio, video data of transmission is carried out encipher-decipher method
CN106878013A (en) * 2017-03-20 2017-06-20 网宿科技股份有限公司 A kind of encryption and decryption method and device of file
CN108924099A (en) * 2018-06-15 2018-11-30 清华大学深圳研究生院 encryption method, encryption device, encryption performance analysis method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111031353A (en) * 2019-12-11 2020-04-17 上海乐相科技有限公司 Video encryption method and device
CN111813965A (en) * 2020-05-14 2020-10-23 北京嘀嘀无限科技发展有限公司 Encryption method, decryption method, storage medium and electronic equipment for multimedia file
CN112333540A (en) * 2020-10-26 2021-02-05 浙江大华技术股份有限公司 Method and device for determining video encryption length
CN112333540B (en) * 2020-10-26 2022-06-24 浙江大华技术股份有限公司 Method and device for determining video encryption length
CN114363658A (en) * 2021-12-30 2022-04-15 慧之安信息技术股份有限公司 Method and device for encrypted transmission of audio and video stream

Also Published As

Publication number Publication date
CN110035319B (en) 2020-05-15

Similar Documents

Publication Publication Date Title
CN110035319A (en) A kind of encryption and decryption method of audio, video data, device and playback equipment
Wu et al. Separable reversible data hiding for encrypted palette images with color partitioning and flipping verification
US20110170687A1 (en) Content decoding apparatus, content decoding method and integrated circuit
WO2005101215A1 (en) Terminal device and copyright protection system
CN1767032B (en) Multi-streaming apparatus and muti-streaming method using temporary storage medium
JP2002244929A (en) Digital copying method and digital content recording device
EP2268020B1 (en) Protection of audio or video data in a playback device
CN1729668A (en) Apparatus and method for processing streams
WO2012031490A1 (en) Multimedia file encryption method and apparatus
CN105611318A (en) Method and system for video encryption playing
CN108769807A (en) A kind of video encryption method based on Android platform
CN102300093A (en) Encrypting method for distributing data file
Torrubia et al. Perceptual cryptography on MPEG Layer III bit-streams
CN100581100C (en) Method and system of playback for preventing skip over special contents fragment in digital media stream
CN106096334A (en) The encryption method of hypermedia data and encryption device, decryption method and deciphering device
CN111954035A (en) Method and device for encrypting video-audio signal stream
CN112887800B (en) Method for PVR encryption protection of set top box
WO2007013611A1 (en) Recording device and recording medium
Kadhim A new audio steganography system based on auto-key generator
JP2006330126A (en) Ciphering processing method and deciphering processing method
CN113051592A (en) File encryption method and device, electronic equipment and storage medium
JP2018007200A (en) Content decryption device, content decryption method, receiver, and program
CN101917623A (en) Tamper-proof encryption method, detection method and device of encoding code stream
CN108632663B (en) Method and system for processing digitized audio/video and subtitles
JP2004109177A (en) Content data recording medium, content data decoder, content data encryption device, method of decoding content data, and method of encrypting content data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200604

Address after: 247100 workshop C2, science and Technology Incubation Park, Jiangnan industrial concentration zone, Chizhou City, Anhui Province

Patentee after: Anhui Wenxiang Information Technology Co.,Ltd.

Address before: 100176 11th Floor, Block B, Zhonghang Technology Plaza, 15 Ronghua South Road, Daxing Economic and Technological Development Zone, Beijing

Patentee before: BEIJING WENXIANG INFORMATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A method, device, and playback device for encrypting and decrypting audio and video data

Granted publication date: 20200515

Pledgee: Anhui Jiangnan Industrial Concentration Zone Construction Investment Development (Group) Co.,Ltd.

Pledgor: Anhui Wenxiang Information Technology Co.,Ltd.

Registration number: Y2024980010826