[go: up one dir, main page]

CN111813965A - Encryption method, decryption method, storage medium and electronic equipment for multimedia file - Google Patents

Encryption method, decryption method, storage medium and electronic equipment for multimedia file Download PDF

Info

Publication number
CN111813965A
CN111813965A CN202010405693.8A CN202010405693A CN111813965A CN 111813965 A CN111813965 A CN 111813965A CN 202010405693 A CN202010405693 A CN 202010405693A CN 111813965 A CN111813965 A CN 111813965A
Authority
CN
China
Prior art keywords
data
audio
video
frame
encrypted
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
CN202010405693.8A
Other languages
Chinese (zh)
Other versions
CN111813965B (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.)
Beijing Didi Infinity Technology and Development Co Ltd
Original Assignee
Beijing Didi Infinity Technology and Development 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 Didi Infinity Technology and Development Co Ltd filed Critical Beijing Didi Infinity Technology and Development Co Ltd
Priority to CN202010405693.8A priority Critical patent/CN111813965B/en
Publication of CN111813965A publication Critical patent/CN111813965A/en
Application granted granted Critical
Publication of CN111813965B publication Critical patent/CN111813965B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/41Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C5/00Registering or indicating the working of vehicles
    • G07C5/08Registering or indicating performance data other than driving, working, idle, or waiting time, with or without registering driving, working, idle or waiting time
    • G07C5/0841Registering performance data
    • G07C5/085Registering performance data using electronic data carriers
    • G07C5/0866Registering performance data using electronic data carriers the electronic data carrier being a digital video recorder in combination with video camera

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Storage Device Security (AREA)

Abstract

The invention provides an encryption method, a decryption method, a storage medium and electronic equipment of a multimedia file, wherein the encryption method comprises the following steps: acquiring audio/video data frame by frame and coding each frame of audio/video data according to the encryption information to obtain audio/video coded data; fusing the encrypted data information with the N frame of audio/video coding data to obtain N frame of audio/video updating data; the encrypted data information includes encryption information; sequentially storing the other frames of audio/video coding data and the Nth frame of audio/video updating data to obtain an encrypted multimedia file; the remaining frame audio/video data is audio/video data other than the nth frame audio/video data. Therefore, the encrypted data information and the N-th frame of audio/video coded data are stored together, the storage of the encrypted data information cannot be influenced even if abnormal power failure and abnormal card pulling occur, and the normal decryption and playing operation of the multimedia file can be ensured.

Description

Encryption method, decryption method, storage medium and electronic equipment for multimedia file
Technical Field
The invention relates to the technical field of multimedia data security, in particular to an encryption method, a decryption method, a storage medium and electronic equipment for a multimedia file.
Background
The technical problem of safe storage and transmission of multimedia files is involved in a plurality of fields, the multimedia files comprise a plurality of format types, and the recorded files obtained by the automobile data recorder on the market are also stored by adopting an MP4 format type widely. The MP4 format file is a multimedia file format using MPEG-4, and is also a video compression and packaging format. As shown in fig. 1, the MP4 format file is composed of a number of data blocks in a tree-like manner, each data block containing different information. In the figure, an ftyp box describes a file type; the moov box contains metadata information of the media; the mdat box contains audio-video data information. Referring to fig. 1, taking a storage process of MP4 format files in a drive recorder as an example, a storage process of MP4 format files will be described:
after the audio and video acquisition element starts recording, writing an ftyp box into Flash and generating an mp4.tmp temporary file under the ftyp box; writing the moov box into the memory and generating metadata information record under the moov box; in the recording process, audio and video data acquired by the audio and video acquisition element are written into the mdat box after being coded, the storage operation of the audio and video data in the mdat box is recorded in the mp4.tmp file, and simultaneously, the metadata information record in the moov box is updated. In the recording process or at the end of recording, in order to ensure the security of the recorded audio/video data, encryption processing needs to be performed on each frame of audio/video data or all frames of audio/video data, and at this time, metadata information record under the moov box records the composition of the encrypted data together. And then, writing the metadata information record carrying the encrypted data under the moov box and the audio and video data under the moov box into Flash together and storing the data, thereby obtaining a complete recording file.
In an actual use scene, due to abnormal power failure of the automobile data recorder, abnormal card pulling of the memory card and other operations, the recording process is abnormally ended, files stored in Flash only include data in an ftyp box and an mdat box, and data in an moov box are not normally stored, so that files stored in Flash lack of encrypted data, and normal decryption and playing operations of subsequent files are affected.
Disclosure of Invention
The embodiment of the invention aims to provide an encryption method, a decryption method, a storage medium and electronic equipment for multimedia files, so as to solve the problems that recording files are lost and cannot be normally decrypted when recording is interrupted in the encryption method in the prior art.
One aspect of the present invention provides a method for encrypting a multimedia file, comprising the steps of:
acquiring audio/video data frame by frame and coding each frame of audio/video data according to the encryption information to obtain audio/video coded data;
fusing the encrypted data information with the N frame of audio/video coding data to obtain N frame of audio/video updating data; the encrypted data information comprises the encryption information; wherein N is more than or equal to 1 and less than or equal to Nth,NthIs an encrypted frame threshold;
sequentially storing the other frames of audio/video coding data and the Nth frame of audio/video updating data to obtain an encrypted multimedia file; the rest frames of audio/video data are audio/video data except the Nth frame of audio/video data.
One aspect of the present invention provides a method for decrypting a multimedia file, comprising the steps of:
acquiring the N frame of audio/video updating data in the encrypted multimedia file;
obtaining encrypted data information and N frame audio/video coding data according to the N frame audio/video updating data, and obtaining encrypted information according to the encrypted data information;
and decoding the audio/video coded data of the rest frames and the audio/video coded data of the Nth frame according to the encryption information to obtain the audio/video data of each frame.
One aspect of the present invention further provides a storage medium, where program instructions are stored in the storage medium, and a computer reads the program instructions and executes any one of the methods for encrypting a multimedia file provided by the present invention.
One aspect of the present invention further provides a storage medium, where program instructions are stored in the storage medium, and a computer reads the program instructions and executes any one of the methods for decrypting a multimedia file provided by the present invention.
One aspect of the present invention further provides an electronic device, including at least one memory and at least one processor, where the at least one memory stores program instructions, and the at least one processor reads the program instructions to perform:
acquiring audio/video data frame by frame and coding each frame of audio/video data according to the encryption information to obtain audio/video coded data;
fusing the encrypted data information with the N frame of audio/video coding data to obtain N frame of audio/video updating data; the encrypted data information comprises the encryption information; wherein N is more than or equal to 1 and less than or equal to Nth,NthIs an encrypted frame threshold;
sequentially storing the other frames of audio/video coding data and the Nth frame of audio/video updating data to obtain an encrypted multimedia file; the rest frames of audio/video data are audio/video data except the Nth frame of audio/video data.
One aspect of the present invention provides an electronic device, including at least one memory and at least one processor, where the at least one memory stores program instructions, and the at least one processor reads the program instructions to perform:
acquiring the N frame of audio/video updating data in the encrypted multimedia file;
obtaining encrypted data information and N frame audio/video coding data according to the N frame audio/video updating data, and obtaining encrypted information according to the encrypted data information;
and decoding the audio/video coded data of the rest frames and the audio/video coded data of the Nth frame according to the encryption information to obtain the audio/video data of each frame.
Compared with the prior art, the technical scheme provided by the embodiment of the invention at least has the following beneficial effects:
according to the encryption method, the decryption method, the storage medium and the electronic equipment of the multimedia file, the encryption data information is directly fused with the N-th frame of audio/video coding data and then stored, and as the acquisition, the coding processing and the storage of each frame of audio/video data are carried out in real time, the encryption data information and the N-th frame of audio/video coding data are stored together, the encryption data information does not need to be stored in another data block until the recording process of the multimedia file is normally finished, the storage of the encryption data information cannot be influenced even if the power is abnormally cut off and the card is abnormally pulled out, and the normal decryption and playing operation of the multimedia file can be guaranteed.
Drawings
FIG. 1 shows the data block composition of MP4 format multimedia file;
fig. 2 is a schematic view of an application scenario of the encryption method for multimedia files according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for encrypting a multimedia file according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a method for decrypting a multimedia file according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a hardware connection relationship of an electronic device according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware connection relationship of an electronic device according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be further described with reference to the accompanying drawings. In the description of the present invention, it should be noted that the terms "first", "second", and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The technical schemes in the following embodiments provided by the invention can be combined with each other unless contradictory to each other, and technical features in different schemes can be replaced with each other.
As shown in fig. 2, an application example of the method provided by the following embodiment of the present invention is shown, where the automobile data recorder includes an audio collecting element 101, a video collecting element 102, an automobile data recorder main control element 103, and a storage element 104, the automobile data recorder collects audio/video data through the audio collecting element 101 and the video collecting element 102, and then sends the audio/video data to the automobile data recorder main control element 103, and encodes and encrypts the audio/video data, and then the audio/video data may be stored in the storage element 104, and the storage element 104 may be an SD card or the like. The download terminal 105 can download the recorded audio/video data from the storage element 104 to the local, decode and decrypt the audio/video data according to the corresponding protocol so as to be able to play.
One aspect of the present invention provides an encryption method for a multimedia file, which is applied in a processing element having a signal processing function, such as a driving recorder master control element 103, as shown in fig. 3, and includes the following steps:
s101: and acquiring audio/video data frame by frame and coding each frame of audio/video data according to the encryption information to obtain audio/video coded data. Wherein the audio data is collected by using an audio collecting element 101 such as shown in fig. 2, the video data is collected by using a video collecting element 102 such as shown in fig. 2, the audio/video data can be collected in real time, and the driving recorder main control element 103 can acquire the collected audio data and video data from the audio collecting element 101 and the video collecting element 102 frame by frame in real time. The encryption information is used to encrypt the audio/video data, and may be random characters or the like.
S102: fusing the encrypted data information with the N frame of audio/video coding data to obtain N frame of audio/video updating data; the encrypted data information comprises the encryption information; wherein N is more than or equal to 1 and less than or equal to Nth,NthFor encrypting frame thresholds, in which NthThe setting can be performed according to the actual situation, for example, 10 is selected, the encrypted data information and any frame data in the previous 10 frame data can be stored together, and it is not necessary to store the encrypted data information in other data blocks of the multimedia file separately, and it is also not necessary to wait until the audio acquisition element 101 and the video acquisition element 102 complete the recording process. Wherein N isthCan be obtained by the following steps: n is a radical ofth=Tth/Tc(ii) a Wherein, TthIs the shortest effective time length, T, of the multimedia filecIs the sampling period of the audio/video data. For example, the duration of the multimedia file should exceed at least half a minute, i.e. the shortest effective duration is half a minute, and if the duration of the multimedia file is less than half a minute, the multimedia file is considered to be not availableFor reference, and a sampling period of 1s, then N is presentth30/1 is 30, at this time, the encrypted data information can be added to any frame of audio/video data in the previous 30 frames, and the storage of the encrypted data information can be ensured to be completed within the valid duration. Preferably, N is 1, so that the encrypted data information can be stored with the first frame of audio/video data at the first time, further ensuring that the encrypted data information is not lost.
S103: sequentially storing the other frames of audio/video coding data and the Nth frame of audio/video updating data to obtain an encrypted multimedia file; the rest frames of audio/video data are audio/video data except the Nth frame of audio/video data.
Tables 1 and 2 give examples of the format of the nth frame of audio/video update data and the format of the remaining frames of audio/video encoded data, each frame of audio/video encoded data includes a media data identifier, a media data length and media data information, and the media data length and the total number of data identifiers of the audio/video encoded data are consistent; the encrypted data information comprises an encrypted identifier, an encrypted data length and the encrypted information, and the encrypted data length is consistent with the total number of the data identifiers of the encrypted data information; the nth frame of audio/video update data includes the encryption flag, the encryption data length, the encryption information, the media data flag, the media data length, and the media data information arranged in sequence.
TABLE 1 format of the N frame audio/video update data
Figure BDA0002491218990000061
TABLE 2 format of the remaining frames of audio/video encoded data
Media data identification Media data length Media data information
“audio” Int type Variable
“video” Int type Variable
Comparing table 1 and table 2, the nth frame of audio/video update data includes media data information in the same format as the rest of the frames of audio/video encoded data, and in addition, includes content related to the encrypted information. The encryption identifiers are all 'encrypt', the length of the encrypted data is represented by 'Int type' data, and the encryption information is variable data, such as randomly generated characters. In the media data identifier, Audio represents the Audio data type, and Video represents the Video data type. The length of the media data is represented by Int type data, and the media data information is determined according to the information contained in the actually collected audio frame and video frame. The position of the encrypted data information and the specific content of the contained encrypted information can be quickly determined by configuring the data identification, and the position of the media data and the contained data content can also be quickly determined, so that the data processing efficiency is improved.
In the above arrangement, the encrypted data information can be stored together with the audio/video frame data within a very short time period from the start of the initial stage of the recording process. For a vehicle event data recorder, the conditions of power failure and the like caused by collision possibly exist in a vehicle, audio/video data under the conditions are responsible for judgment, and service scenes such as field restoration and the like are very important.
Another aspect of the present invention provides a method for decrypting a multimedia file, which can be applied to the downloading terminal 105 shown in fig. 2, as shown in fig. 4, and includes the following steps:
s201: and acquiring the N-th frame of audio/video updating data in the encrypted multimedia file, wherein the N-th frame of audio/video data contains encrypted data information. Preferably, N is 1, so that the encrypted data information can be stored with the first frame of audio/video data at the first time, further ensuring that the encrypted data information is not lost.
S202: and obtaining encrypted data information and N frame audio/video coding data according to the N frame audio/video updating data, and obtaining encrypted information according to the encrypted data information. In the encoding process, as shown in table 1 and table 2, the format of the nth frame of audio/video update data and the format examples of the remaining frames of audio/video encoded data are given, so that the encrypted data information can be obtained as follows: determining an encryption identifier in the audio/video updating data of the Nth frame, taking a data identifier adjacent to the encryption identifier as an encryption data length, taking a data identifier adjacent to the encryption data length as the encryption information, and keeping the total number of the data identifiers of the encryption data information consistent with the encryption data length; and determining a media data identifier in the audio/video updating data of the Nth frame, taking a data identifier adjacent to the back of the media data identifier as a media data length, taking a data identifier adjacent to the back of the media data length as media data information, and keeping the total number of the data identifiers of the audio/video coding data consistent with the media data length.
S203: and decoding the audio/video coded data of the rest frames and the audio/video coded data of the Nth frame according to the encryption information to obtain the audio/video data of each frame.
The data based on which the encryption method and the decryption method are provided by the scheme corresponds to the adopted encryption information, the coding mode and the decoding mode. In the above scheme of the present invention, the key point is that the encrypted data information is stored along with the nth frame of audio/video data, so that when recording is affected by abnormal power failure or abnormal card pulling, the encrypted data information can be obtained by parsing in the stored audio/video data, and thus the stored audio/video data is decrypted without affecting the repair and normal play of the audio/video data at a later stage. The specific encoding algorithm, encryption algorithm, decoding algorithm, decryption algorithm, etc. are not the improvement point of the present invention, and will not be described in detail herein.
Still another aspect of the present invention provides a storage medium, wherein the storage medium stores program instructions, and a computer reads the program instructions and executes the method for encrypting a multimedia file according to any one of the above aspects.
Still another aspect of the present invention provides a storage medium, in which program instructions are stored, and a computer reads the program instructions and executes the method for decrypting a multimedia file according to any one of the above aspects.
Yet another aspect of the present invention provides an electronic device, as shown in fig. 5, including at least one memory 202 and at least one processor 201, the apparatus may further include: an input device 203 and an output device 204. The processor 201, memory 202, input device 203, and output device 204 may be connected by a bus or other means. At least one memory 202 stores program instructions, and at least one processor 201 reads the program instructions and executes:
acquiring audio/video data frame by frame and coding each frame of audio/video data according to the encryption information to obtain audio/video coded data; fusing the encrypted data information with the N frame of audio/video coding data to obtain N frame of audio/video updating data; the encrypted data information comprises the encryption information; wherein N is more than or equal to 1 and less than or equal to Nth,NthIs an encrypted frame threshold; encoding the rest of the frame audio/videoThe code data and the N-th frame of audio/video updating data are stored in sequence to obtain an encrypted multimedia file; the rest frames of audio/video data are audio/video data except the Nth frame of audio/video data. According to the scheme, the encrypted data information is directly fused with the N-th frame of audio/video coding data and then stored, and because the acquisition, coding processing and storage of each frame of audio/video data are carried out in real time, the encrypted data information and the N-th frame of audio/video coding data are stored together without storing the encrypted data information in another data block until the recording process of the multimedia file is normally finished, the storage of the encrypted data information cannot be influenced even if the power is abnormally cut off and the card is abnormally pulled out, and the normal decryption and playing operation of the multimedia file can be ensured.
In the above scheme, at least one of the processors 201 performs the step of fusing the encrypted data information with the nth frame of audio/video encoded data to obtain the nth frame of audio/video updated data: n is 1. Thus, the encrypted data information can be stored with the audio/video data of the first frame at the first time, and further, the encrypted data information is not lost.
In the above scheme, at least one of the processors 201 performs the step of fusing the encrypted data information with the nth frame of audio/video encoded data to obtain the nth frame of audio/video updated data, where N isthThe method comprises the following steps: n is a radical ofth=Tth/Tc(ii) a Wherein, TthIs the shortest effective time length, T, of the multimedia filecIs the sampling period of the audio/video data. For example, the duration of the multimedia file should exceed at least half a minute, i.e. the shortest effective duration is half a minute, if the duration of the multimedia file is less than half a minute, it is considered as having no reference meaning, and the sampling period is 1s, then N is the timeth30/1 is 30, at this time, the encrypted data information can be added to any frame of audio/video data in the previous 30 frames, and the storage of the encrypted data information can be ensured to be completed within the valid duration.
In the above scheme, at least one of the processors 201 performs the step of fusing the encrypted data information with the nth frame of audio/video encoded data to obtain the nth frame of audio/video updated data: each frame of audio/video coded data comprises a media data identifier, a media data length and media data information, and the media data length is consistent with the total number of the data identifiers of the audio/video coded data; the encrypted data information comprises an encrypted identifier, an encrypted data length and the encrypted information, and the encrypted data length is consistent with the total number of the data identifiers of the encrypted data information; the nth frame of audio/video update data includes the encryption flag, the encryption data length, the encryption information, the media data flag, the media data length, and the media data information arranged in sequence. The position of the encrypted data information and the specific content of the contained encrypted information can be quickly determined by configuring the data identification, and the position of the media data and the contained data content can also be quickly determined, so that the data processing efficiency is improved.
Another aspect of the present invention also provides an electronic device, as shown in fig. 6, including at least one memory 302 and at least one processor 301, where the apparatus may further include: an input device 303 and an output device 304. The processor 301, memory 302, input device 303, and output device 304 may be connected by a bus or other means. The at least one memory 302 stores program instructions, and the at least one processor 301 reads the program instructions to perform: acquiring the N frame of audio/video updating data in the encrypted multimedia file; obtaining encrypted data information and N frame audio/video coding data according to the N frame audio/video updating data, and obtaining encrypted information according to the encrypted data information; and decoding the audio/video coded data of the rest frames and the audio/video coded data of the Nth frame according to the encryption information to obtain the audio/video data of each frame. In the scheme, the encrypted data information is stored along with the N-th frame of audio/video data, so that when recording is affected by abnormal power failure, abnormal card pulling and the like, the encrypted data information can be obtained by analyzing the stored audio/video data, the stored audio/video data is decrypted, and the repair and normal playing of the audio/video data in the later period are not affected.
In the above scheme, at least one of the processors 301 executes the step of obtaining the nth frame of audio/video update data in the encrypted multimedia file: n is 1. Thus, the encrypted data information can be stored with the audio/video data of the first frame at the first time, and further, the encrypted data information is not lost.
In the above solution, at least one of the processors 301 performs the steps of obtaining the encrypted data information and the nth frame audio/video encoding data according to the nth frame audio/video update data, and obtaining the encrypted information according to the encrypted data information includes: determining an encryption identifier in the audio/video updating data of the Nth frame, taking a data identifier adjacent to the encryption identifier as an encryption data length, taking a data identifier adjacent to the encryption data length as the encryption information, and keeping the total number of the data identifiers of the encryption data information consistent with the encryption data length; and determining a media data identifier in the audio/video updating data of the Nth frame, taking a data identifier adjacent to the back of the media data identifier as a media data length, taking a data identifier adjacent to the back of the media data length as media data information, and keeping the total number of the data identifiers of the audio/video coding data consistent with the media data length. The position of the encrypted data information and the specific content of the contained encrypted information can be quickly determined by inquiring the data identification, and the position of the media data and the contained data content can also be quickly determined, so that the data processing efficiency is improved.
Finally, it should be noted that: the above examples are only used to illustrate the technical solutions of the present invention, but not to limit the present invention; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (16)

1. A method for encrypting a multimedia file, comprising the steps of:
acquiring audio/video data frame by frame and coding each frame of audio/video data according to the encryption information to obtain audio/video coded data;
fusing the encrypted data information with the N frame of audio/video coding data to obtain N frame of audio/video updating data; the encrypted data information comprises the encryption information; wherein N is more than or equal to 1 and less than or equal to Nth,NthIs an encrypted frame threshold;
sequentially storing the other frames of audio/video coding data and the Nth frame of audio/video updating data to obtain an encrypted multimedia file; the rest frames of audio/video data are audio/video data except the Nth frame of audio/video data.
2. The method for encrypting the multimedia file according to claim 1, wherein the step of fusing the encrypted data information with the nth frame of audio/video encoding data to obtain the nth frame of audio/video update data comprises: n is 1.
3. The method for encrypting the multimedia file according to claim 1, wherein in the step of fusing the encrypted data information with the N-th frame of audio/video encoding data to obtain the N-th frame of audio/video update data, NthThe method comprises the following steps:
Nth=Tth/Tc
wherein, TthIs the shortest effective time length, T, of the multimedia filecIs the sampling period of the audio/video data.
4. The method for encrypting the multimedia file according to any one of claims 1 to 3, wherein in the step of fusing the encrypted data information with the N-th frame of audio/video encoded data to obtain the N-th frame of audio/video updated data:
each frame of audio/video coded data comprises a media data identifier, a media data length and media data information, and the media data length is consistent with the total number of the data identifiers of the audio/video coded data;
the encrypted data information comprises an encrypted identifier, an encrypted data length and the encrypted information, and the encrypted data length is consistent with the total number of the data identifiers of the encrypted data information;
the nth frame of audio/video update data includes the encryption flag, the encryption data length, the encryption information, the media data flag, the media data length, and the media data information arranged in sequence.
5. A method for decrypting a multimedia file, comprising the steps of:
acquiring the N frame of audio/video updating data in the encrypted multimedia file;
obtaining encrypted data information and N frame audio/video coding data according to the N frame audio/video updating data, and obtaining encrypted information according to the encrypted data information;
and decoding the audio/video coded data of the rest frames and the audio/video coded data of the Nth frame according to the encryption information to obtain the audio/video data of each frame.
6. The method for decrypting the multimedia file according to claim 5, wherein the step of obtaining the audio/video update data of the nth frame in the encrypted multimedia file comprises: n is 1.
7. The method for decrypting the multimedia file according to claim 5 or 6, wherein the step of obtaining the encrypted data information and the N-th frame of audio/video encoding data according to the N-th frame of audio/video updating data comprises:
determining an encryption identifier in the audio/video updating data of the Nth frame, taking a data identifier adjacent to the encryption identifier as an encryption data length, taking a data identifier adjacent to the encryption data length as the encryption information, and keeping the total number of the data identifiers of the encryption data information consistent with the encryption data length;
and determining a media data identifier in the audio/video updating data of the Nth frame, taking a data identifier adjacent to the back of the media data identifier as a media data length, taking a data identifier adjacent to the back of the media data length as media data information, and keeping the total number of the data identifiers of the audio/video coding data consistent with the media data length.
8. A storage medium, wherein program instructions are stored in the storage medium, and a computer reads the program instructions and executes the method for encrypting the multimedia file according to any one of claims 1 to 4.
9. A storage medium, wherein program instructions are stored in the storage medium, and a computer reads the program instructions and executes the method for decrypting a multimedia file according to any one of claims 5 to 7.
10. An electronic device, comprising at least one memory and at least one processor, wherein the at least one memory stores program instructions, and the at least one processor reads the program instructions and executes:
acquiring audio/video data frame by frame and coding each frame of audio/video data according to the encryption information to obtain audio/video coded data;
fusing the encrypted data information with the N frame of audio/video coding data to obtain N frame of audio/video updating data; the encrypted data information comprises the encryption information; wherein N is more than or equal to 1 and less than or equal to Nth,NthIs an encrypted frame threshold;
sequentially storing the other frames of audio/video coding data and the Nth frame of audio/video updating data to obtain an encrypted multimedia file; the rest frames of audio/video data are audio/video data except the Nth frame of audio/video data.
11. The electronic device of claim 10, wherein at least one of the processors performs the step of fusing the encrypted data information with the nth frame of audio/video encoded data to obtain nth frame of audio/video update data by: n is 1.
12. The electronic device of claim 10, wherein at least one of the processors performs the step of fusing the encrypted data information with the nth frame of audio/video encoding data to obtain nth frame of audio/video update data, N beingthThe method comprises the following steps:
Nth=Tth/Tc
wherein, TthIs the shortest effective time length, T, of the multimedia filecIs the sampling period of the audio/video data.
13. The electronic device according to any of claims 10-12, wherein at least one of the processors performs the step of fusing the encrypted data information with the N frame of audio/video encoded data to obtain N frame of audio/video update data:
each frame of audio/video coded data comprises a media data identifier, a media data length and media data information, and the media data length is consistent with the total number of the data identifiers of the audio/video coded data;
the encrypted data information comprises an encrypted identifier, an encrypted data length and the encrypted information, and the encrypted data length is consistent with the total number of the data identifiers of the encrypted data information;
the nth frame of audio/video update data includes the encryption flag, the encryption data length, the encryption information, the media data flag, the media data length, and the media data information arranged in sequence.
14. An electronic device, comprising at least one memory and at least one processor, wherein the at least one memory stores program instructions, and the at least one processor reads the program instructions and executes:
acquiring the N frame of audio/video updating data in the encrypted multimedia file;
obtaining encrypted data information and N frame audio/video coding data according to the N frame audio/video updating data, and obtaining encrypted information according to the encrypted data information;
and decoding the audio/video coded data of the rest frames and the audio/video coded data of the Nth frame according to the encryption information to obtain the audio/video data of each frame.
15. The electronic device of claim 14, wherein at least one of the processors performs the step of obtaining audio/video update data of an nth frame in the encrypted multimedia file by: n is 1.
16. The method for decrypting the multimedia file according to claim 14 or 15, wherein the at least one processor performs the steps of obtaining the encrypted data information and the N frame audio/video encoding data according to the N frame audio/video update data, and obtaining the encrypted information according to the encrypted data information comprises:
determining an encryption identifier in the audio/video updating data of the Nth frame, taking a data identifier adjacent to the encryption identifier as an encryption data length, taking a data identifier adjacent to the encryption data length as the encryption information, and keeping the total number of the data identifiers of the encryption data information consistent with the encryption data length;
and determining a media data identifier in the audio/video updating data of the Nth frame, taking a data identifier adjacent to the back of the media data identifier as a media data length, taking a data identifier adjacent to the back of the media data length as media data information, and keeping the total number of the data identifiers of the audio/video coding data consistent with the media data length.
CN202010405693.8A 2020-05-14 2020-05-14 Encryption method and decryption method for multimedia file, storage medium and electronic device Active CN111813965B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010405693.8A CN111813965B (en) 2020-05-14 2020-05-14 Encryption method and decryption method for multimedia file, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010405693.8A CN111813965B (en) 2020-05-14 2020-05-14 Encryption method and decryption method for multimedia file, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN111813965A true CN111813965A (en) 2020-10-23
CN111813965B CN111813965B (en) 2024-06-21

Family

ID=72847695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010405693.8A Active CN111813965B (en) 2020-05-14 2020-05-14 Encryption method and decryption method for multimedia file, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN111813965B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113660442A (en) * 2021-08-31 2021-11-16 广州盈可视电子科技有限公司 Video repairing method and device, electronic equipment and readable medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030188182A1 (en) * 2002-03-29 2003-10-02 Jun Sato Data structure of multimedia file format, encrypting method and device thereof, and decrypting method and device thereof
JP2004007533A (en) * 2002-03-29 2004-01-08 Toshiba Corp Data structure of multimedia file format, encryption method and apparatus thereof, and decryption method and apparatus thereof
CN1997146A (en) * 2006-12-20 2007-07-11 四川长虹电器股份有限公司 A method for encryption of MP4 multi-media data content
CN101969545A (en) * 2010-09-08 2011-02-09 中兴通讯股份有限公司 Encryption method and device of multimedia file
EP2779537A1 (en) * 2013-03-14 2014-09-17 Openwave Mobility, Inc. A method, apparatus and computer program for encoding data of a media file
CN110035319A (en) * 2019-04-02 2019-07-19 北京文香信息技术有限公司 A kind of encryption and decryption method of audio, video data, device and playback equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030188182A1 (en) * 2002-03-29 2003-10-02 Jun Sato Data structure of multimedia file format, encrypting method and device thereof, and decrypting method and device thereof
JP2004007533A (en) * 2002-03-29 2004-01-08 Toshiba Corp Data structure of multimedia file format, encryption method and apparatus thereof, and decryption method and apparatus thereof
CN1997146A (en) * 2006-12-20 2007-07-11 四川长虹电器股份有限公司 A method for encryption of MP4 multi-media data content
CN101969545A (en) * 2010-09-08 2011-02-09 中兴通讯股份有限公司 Encryption method and device of multimedia file
EP2779537A1 (en) * 2013-03-14 2014-09-17 Openwave Mobility, Inc. A method, apparatus and computer program for encoding data of a media file
CN110035319A (en) * 2019-04-02 2019-07-19 北京文香信息技术有限公司 A kind of encryption and decryption method of audio, video data, device and playback equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
葛龙;廉士国;孙金生;王执铨;: "基于参数敏感性的MP3音频选择加密方案", 计算机应用研究, no. 10 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113660442A (en) * 2021-08-31 2021-11-16 广州盈可视电子科技有限公司 Video repairing method and device, electronic equipment and readable medium
CN113660442B (en) * 2021-08-31 2024-03-19 广州盈可视电子科技有限公司 Video restoration method and device, electronic equipment and readable medium

Also Published As

Publication number Publication date
CN111813965B (en) 2024-06-21

Similar Documents

Publication Publication Date Title
US7461406B2 (en) Access control for digital content
EP1503590B1 (en) Access control for digital video stream data
JP4679851B2 (en) Access control for digital content
US20110170687A1 (en) Content decoding apparatus, content decoding method and integrated circuit
US20080260161A1 (en) Terminal Device and Copyright Protection System
JP2006501764A (en) Content playback apparatus and trick mode playback system
CN114285562B (en) Data encryption method and device
GB2404487A (en) Access control for digital storage medium content
JP2009017131A (en) User device and program
CN100585713C (en) Information processing device and information processing method
CN1316821C (en) Data transfer system, data transfer program and video server system
US10284529B2 (en) Information processing apparatus and information processing method
CN110035319A (en) A kind of encryption and decryption method of audio, video data, device and playback equipment
CN111813965B (en) Encryption method and decryption method for multimedia file, storage medium and electronic device
JP4886831B2 (en) Content recording apparatus, reproducing apparatus, editing apparatus and method thereof
US20050038999A1 (en) Access control for digital content
CN114286130A (en) Video encryption method, video processing method and device and electronic equipment
US20060053494A1 (en) Embedded revocation messaging
CN117528149A (en) Key updating method, code stream encryption method, code stream decryption method and related devices
JP2009519649A (en) Encrypting and decrypting content for conditional access
JP5409214B2 (en) Media file repair method, media file creation method, media file playback method and apparatus
KR101041261B1 (en) A system for providing contents using a codec dialm, an apparatus and method for generating / reproducing digital contents, and a computer readable recording medium recording a program for performing the method.
JP3630406B2 (en) Packet processing apparatus, packet processing method and storage medium therefor
JP6664286B2 (en) Video processing apparatus and video processing method
JP5395866B2 (en) Recording / reproducing system, recording apparatus, and reproducing apparatus

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