Video encryption and decryption methods and devices based on reversible cellular automata
By encrypting the attribute information of video files and using multi-level reversible cellular automata for cascade encryption, the problems of insufficient encryption strength and high hardware performance consumption in the existing technology are solved, and efficient and safe video encryption is achieved.
Patent Information
- Application Number
- CN202211424658.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-11-15
AI Technical Summary
Existing video encryption technology has problems such as insufficient encryption strength and high hardware performance consumption, making it difficult to effectively prevent hot links and pirated broadcasts.
A video encryption method based on reversible cellular automata is used to encrypt the file attribute information of the video file, generate a random sequence, and perform cascade encryption through multi-level reversible cellular automata to generate encrypted video files.
It improves encryption efficiency and security, avoids complete encryption of the entire video file, reduces the amount of encrypted data, and enhances encryption strength and hardware performance utilization.
Smart Images

Figure CN116016993B
Abstract
Description
Technical Field
[0001] This article belongs to the field of computer and information service technology, and specifically relates to a video encryption and decryption method and device based on reversible cellular automata. Background Art
[0002] The current video industry, especially online education, long video playback and other playback platforms that value content copyright, all know that video security is a very important basic requirement. Users can get the playback URL of paid videos through a one-time payment, and redistribute the playback URL. This behavior is called hotlinking; users directly download videos to local computers and then upload and distribute them again. This behavior is called pirated broadcasting. Both behaviors will cause serious economic losses to the content copyright holders. Faced with the increasing number of hotlinking and pirated broadcasting, video content platforms need to use certain technical means to protect their content.
[0003] One of the important measures is to encrypt video data. First, the video content anti-hotlink function is implemented during the playback stage. Even if the video content is downloaded locally, the video file itself is encrypted and cannot be maliciously uploaded and distributed again.
[0004] The existing video content desensitization methods mainly include direct file stream encryption and video frame-by-frame transcoding encryption. The method of directly encrypting the file stream must be decrypted using a dedicated player, and the encryption strength is weak. Professional crackers can write tools to extract it instantly. The video frame-by-frame transcoding encryption method must be decrypted using a dedicated player. The encryption process is similar to video transcoding. The above process takes a relatively long encryption time and consumes a lot of hardware performance. Summary of the invention
[0005] In view of the above problems in the prior art, the purpose of this article is to provide a video encryption and decryption method and device based on reversible cellular automata, which can improve the efficiency of encryption.
[0006] In order to solve the above technical problems, the specific technical solutions of this article are as follows:
[0007] On the one hand, this article provides a video encryption method based on a reversible cellular automaton, the method comprising:
[0008] Perform file parsing on the video file to be encrypted to obtain file attribute information of the video file to be encrypted;
[0009] Convert the file attribute information to obtain a preset format sequence;
[0010] Generating a random sequence corresponding to the preset format sequence;
[0011] The preset format sequence and the random sequence are introduced into the multi-level reversible cellular automaton to obtain the encrypted video file.
[0012] Furthermore, the file attribute information at least includes file protocol information, file description information, streaming media header information and decoder information.
[0013] Furthermore, the converting of the file attribute information to obtain a preset format sequence includes:
[0014] Determine the data block content corresponding to the file attribute information;
[0015] The data block content is binary converted to obtain a binary two-value sequence.
[0016] Further, generating a random sequence corresponding to the preset format sequence includes:
[0017] The random sequence is generated by a random number generator, and the length of the random sequence is consistent with the length of the binary sequence.
[0018] Furthermore, the preset format sequence and the random sequence are introduced into a multi-level reversible cellular automation to obtain an encrypted video file, including:
[0019] Using the random sequence and the preset format sequence as initial states of a first-level reversible cellular automaton, and iterating through the first-level reversible cellular automaton to obtain first-level iterative data;
[0020] Using the random sequence and the first-level iterative data as the initial state of a second-level reversible cellular automaton, and iterating through the second-level reversible cellular automaton to obtain second-level iterative data;
[0021] Repeat the above steps, use the random sequence and the previous level iterative data as the initial state of the next level reversible cellular automaton, iterate through the next level reversible cellular automaton until the last level iterative data is obtained, and the last level iterative data is used as the encrypted video file.
[0022] Furthermore, the operation rules of at least two levels of reversible cellular automata in the multi-level reversible cellular automata are different.
[0023] Furthermore, the method further comprises:
[0024] The penultimate iteration data in the last level of the reversible cellular automation is obtained, and the penultimate iteration data is used as the key of the encrypted video file.
[0025] On the other hand, this article also provides a video decryption method based on a reversible cellular automaton, the method comprising:
[0026] Obtaining a video file to be decrypted and a key corresponding to the video file to be decrypted;
[0027] According to the multi-level reversible cellular automaton in the above method, determine a multi-level reversible cellular automaton for a decryption sequence corresponding to the video to be decrypted;
[0028] According to the video file to be decrypted and the key, a decryption process is performed through a multi-level reversible cellular automation of a decryption sequence to obtain a restored video file.
[0029] Furthermore, this article also provides a video encryption device based on a reversible cellular automaton, the device comprising:
[0030] A parsing module, used for parsing the video file to be encrypted to obtain file attribute information of the video file to be encrypted;
[0031] A conversion module, used for converting the file attribute information to obtain a preset format sequence;
[0032] A random sequence generation module, used to generate a random sequence corresponding to the preset format sequence;
[0033] The encryption module is used for bringing a preset format sequence and a random sequence into a multi-level reversible cellular automation to obtain an encrypted video file.
[0034] Finally, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described above when executing the computer program.
[0035] By adopting the above technical scheme, the decryption method and device described in this article perform file parsing on the encrypted video file to obtain the file attribute information of the video file to be encrypted; convert the file attribute information to obtain a preset format sequence; generate a random sequence corresponding to the preset format sequence; bring the preset format sequence and the random sequence into a multi-level reversible cellular automation to obtain the encrypted video file. This article improves the efficiency of encryption and decryption by only encrypting the file attribute information in the video file instead of completely encrypting the entire video file.
[0036] In order to make the above and other purposes, features and advantages of this article more obvious and easy to understand, the following specifically cites preferred embodiments and describes them in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of this article or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of this article. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 A schematic diagram of the steps of a video encryption method based on a reversible cellular automation provided in an embodiment of this invention is shown;
[0039] Figure 2 An embodiment of file protocol information in a video file is shown;
[0040] Figure 3 An embodiment of file description information in a video file is shown;
[0041] Figure 4 An embodiment of media stream information in a video file is shown;
[0042] Figure 5 A schematic diagram of a process of a video encryption method based on a reversible cellular automation provided in an embodiment of this invention is shown;
[0043] Figure 6 A schematic diagram of the steps of a video decryption method based on a reversible cellular automation provided in an embodiment of this invention is shown;
[0044] Figure 7 A schematic diagram of a process of a video decryption method based on a reversible cellular automation provided in an embodiment of this invention is shown;
[0045] Figure 8 A schematic diagram of the structure of a video encryption device based on a reversible cellular automaton provided in an embodiment of this invention is shown;
[0046] Fig. 9 A schematic diagram of the structure of a video decryption device based on a reversible cellular automation provided in an embodiment of this invention is shown;
[0047] Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of this invention is shown.
[0048] Description of the accompanying symbols:
[0049] 110. Parsing module;
[0050] 120. Conversion module;
[0051] 130. Random sequence generation module;
[0052] 140. Encryption module;
[0053] 210. Get module;
[0054] 220. Determine module;
[0055] 230. Decryption module;
[0056] 1002. Computer equipment;
[0057] 1004. Processor;
[0058] 1006. Memory;
[0059] 1008. Driving mechanism;
[0060] 1010, input / output module;
[0061] 1012. Input device;
[0062] 1014. Output device;
[0063] 1016. Presentation equipment;
[0064] 1018. Graphical user interface;
[0065] 1020. Network interface;
[0066] 1022. Communication link;
[0067] 1024. Communication bus. DETAILED DESCRIPTION
[0068] The following will be combined with the drawings in the embodiments of this article to clearly and completely describe the technical solutions in the embodiments of this article. Obviously, the described embodiments are only part of the embodiments of this article, not all of the embodiments. Based on the embodiments of this article, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this article.
[0069] It should be noted that the terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0070] In the prior art, in order to address the video security issue, the original video files need to be desensitized when they are stored, to solve the problem that the encryption strength of the simple file stream is weak and a dedicated player is required to decrypt and play it, and to solve the problem that during the video frame-by-frame transcoding and encryption process, the internal code of the source video needs to be read and the video code is converted into a private video code frame by frame, which is usually rewritten as a private protocol based on H264, which takes a relatively long encryption time and consumes a lot of hardware performance.
[0071] In order to solve the above problems, the embodiments of this article provide a video encryption method based on reversible cellular automata, which can improve the efficiency of video file encryption. Figure 1 This is a schematic diagram of the steps of a video encryption method based on a reversible cellular automation provided in the embodiments of this article. This specification provides the method operation steps described in the embodiments or flowcharts, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or device product is executed, it can be executed in the order of the methods shown in the embodiments or the drawings or in parallel. Specifically, Figure 1 As shown, the method may include:
[0072] S101: parsing a video file to be encrypted to obtain file attribute information of the video file to be encrypted;
[0073] S102: converting the file attribute information to obtain a preset format sequence;
[0074] S103: Generate a random sequence corresponding to the preset format sequence;
[0075] S104: Bringing the preset format sequence and the random sequence into a multi-level reversible cellular automation to obtain an encrypted video file.
[0076] It can be understood that the embodiments of this specification avoid encrypting all the data of the video file by encrypting local information in the video file, that is, the file attribute information of the video file, thereby reducing the amount of encrypted data. At the same time, cascade encryption is performed through a multi-level reversible cellular automation, so that the multiple encryption algorithms used take into account the dependencies of different security factors, thereby having higher security and encryption efficiency.
[0077] In some embodiments of the present specification, the file attribute information includes at least file protocol information, file description information, streaming media header information and decoder information.
[0078] It can be understood that the encryption objects in the embodiments of this specification are all attribute information of video files, rather than specific data information. This can avoid a large amount of encrypted data. The video files can be completely encrypted through file attribute information, which can improve encryption efficiency while ensuring the encryption effect.
[0079] Taking MP4 video files as an example, MP4 files are composed of boxes one by one, and a box can be understood as a data block, such as:
[0080] fytp box: describes the file version, sub-version protocol, compatible protocol and other related information; Moov box: is a container box, which contains many sub-boxes, mainly storing some basic information of the mp4 file.
[0081] Moovbox: The content of this data block contains the macro description information of all media data in this file and the specific information of each media track. This module will be stored after ftyp or at the end of the file according to the device. Specifically, all mvhd blocks (file overall information) in the moov block are converted and encrypted. The movhd block stores the description information of the entire media file, such as creation time, modification time, time measurement scale, playable duration, etc.
[0082] Track Box: records media stream information. There can be one or more tracks in a file, which are independent of each other. Each track contains
[0083] (a) tkhd: contains the streaming media header information
[0084] (b) Mdia: contains the creation time, length information, and playback process information of the video stream, where minf is used to specify stbl. stbl contains the offset, pts, duration, and other information of each sample in the media stream. To play a video file, each sample must be correctly found according to stbl and sent to the decoder.
[0085] In the embodiment of the present specification, a corresponding parsing method can be selected according to the format of the video file to be encrypted to obtain corresponding file attribute information. The selection of the specific parsing method and the parsing process are not described in detail in the embodiment of the present specification.
[0086] In some embodiments of the present specification, converting the file attribute information to obtain a preset format sequence includes:
[0087] Determine the data block content corresponding to the file attribute information;
[0088] The data block content is binary converted to obtain a binary two-value sequence.
[0089] It can be understood that, through binary conversion, data in video format can be converted into a method that is easy to understand, thereby improving the efficiency of data encryption.
[0090] For example, taking the file protocol information as an example, the data block of ftyp (i.e., box block) is obtained by parsing, and the data block stores the file version compatibility protocol of the entire video file, such as Figure 2 As shown in FIG. 1 , an embodiment of a data block of ftyp is shown, and the content of this block I is converted into a binary binary sequence I b :
[0091]
[0092] Where u represents the number of binary bits of the data, R represents the maximum number of rows of the box block, and L represents the maximum number of columns of the box block.
[0093] Take the file description information (such as Moov data block) as an example, which includes multiple mvhd sub-data blocks, such as Figure 3 As shown in FIG. 1 , an embodiment of the mvhd data block is shown, where each mvhd block content M is converted into a binary binary sequence M b :
[0094]
[0095] Where u represents the number of binary bits of the data, R represents the maximum number of rows of the box block, and L represents the maximum number of columns of the box block.
[0096] Take streaming media header information and decoder information (such as track data block) as an example. Figure 4 As shown in FIG. 1 , an embodiment of a track data block is shown, where each track block content T is converted into a binary binary sequence T b :
[0097]
[0098] Where u represents the number of binary bits of the data, R represents the maximum number of rows of the box block, and L represents the maximum number of columns of the box block.
[0099] In some embodiments of this specification, generating a random sequence corresponding to the preset format sequence includes:
[0100] The random sequence is generated by a random number generator, and the length of the random sequence is consistent with the length of the binary sequence.
[0101] By generating a random sequence, the discrete effect of the reversible cellular automation in the iteration process is also improved, ensuring a stronger encryption effect. The random number generator shown is a conventional setting and will not be described in detail in the embodiments of this specification.
[0102] In some embodiments of the present specification, a preset format sequence and a random sequence are introduced into a multi-level reversible cellular automation to obtain an encrypted video file, including:
[0103] Using the random sequence and the preset format sequence as initial states of a first-level reversible cellular automaton, and iterating through the first-level reversible cellular automaton to obtain first-level iterative data;
[0104] Using the random sequence and the first-level iterative data as the initial state of a second-level reversible cellular automaton, and iterating through the second-level reversible cellular automaton to obtain second-level iterative data;
[0105] Repeat the above steps, use the random sequence and the previous level iterative data as the initial state of the next level reversible cellular automaton, iterate through the next level reversible cellular automaton until the last level iterative data is obtained, and the last level iterative data is used as the encrypted video file.
[0106] It can be understood that the multi-level reversible cellular automaton is a cascade coordination relationship, that is, the iterative result of the previous level is the input inscription of the next level, thereby realizing the encryption result of the reversible cellular automaton of the previous level as the initial state of the reversible cellular automaton of the next level, and finally obtaining the encrypted video file. The multiple encryption algorithms used take into account the dependency of different security factors and have high security and encryption efficiency.
[0107] Among them, the cellular automaton is a system that is discrete in time and space. In a certain cellular space, some cellular automata have unique pre-order and post-order states. Based on this feature, the histogram of the image can be encrypted and decrypted.
[0108] For example, taking file protocol information as an example, Figure 5 As shown, the encryption process can be: obtain a random sequence, the elements in the sequence are 0 or 1, the length of the sequence and I b The length of this random sequence is equal to I b As the initial state T of the reversible cellular automaton 00 and T 11 , applying the rules of the first-level reversible cellular automaton, and generating encrypted file information data T through n-1 iterations 1n , then put T 00 and the generated T 1nAs a new initial variable, the second-level reversible cellular automaton is called again to iteratively encrypt and generate file information data T 2n , and so on, calling each level of cellular automation to encrypt the data n times, and finally obtaining the encrypted video file information.
[0109] Taking file description information as an example, the encryption process can be as follows: Get a random sequence, the elements in the sequence are 0 or 1, the length of the sequence and M b The length of this random sequence is equal to M b As the initial state T of the reversible cellular automaton 00 and T 11 , applying the rules of the first-level reversible cellular automaton, and generating encrypted file information data T through n-1 iterations 1n , then put T 00 and the generated T 1n As a new initial variable, the second-level reversible cellular automaton is called again to iteratively encrypt and generate file information data T 2n , and so on, calling each level of cellular automation to encrypt the data n times, and finally obtaining the encrypted video file media data description information.
[0110] Taking the streaming media header information and decoder information as an example, the encryption process can be as follows: Get a random sequence, the elements in the sequence are 0 or 1, the length of the sequence and T b The length of this random sequence is equal to T b As the initial state T of the reversible cellular automaton 00 and T 11 , applying the rules of the first-level reversible cellular automaton, and generating encrypted file information data T through n-1 iterations 1n , then put T 00 and the generated T 1n As a new initial variable, the second-level reversible cellular automaton is called again to iteratively encrypt and generate file information data T 2n , and so on, calling each level of cellular automation to encrypt the data n times, and finally obtaining the encrypted video file media stream information.
[0111] It should be noted that the above encryption process can be an encryption operation for one of the file attribute information, or it can be an encryption operation for at least two of the file attribute information. In this way, by encrypting more video file information, the encryption strength can be guaranteed and the encryption effectiveness can be improved. In addition, during encryption, only part of the information of the video file is actually encrypted (i.e., encryption of part of the data block), which can improve the encryption efficiency. After the encryption is completed, the unencrypted video data and the encrypted information need to be integrated to form a completed encrypted video file.
[0112] The method provided in the embodiments of this specification is only for encryption and desensitization of key information content of the video, thereby improving the efficiency of encryption retrieval; through the random number generator, the efficiency of random sequence extraction is improved; the video index information and video stream header conversion sequence are directly used for encryption conversion, rather than directly using the file stream for CBC conversion or obtaining the image frame in the video, converting it into a grayscale image and then converting it, thereby improving the efficiency of encryption and decryption.
[0113] In the embodiments of this specification, the above encryption process is completed in the encryption terminal, that is, the generating end or sending end of the video. The encryption terminal stores the encryption rules described above. When it is necessary to send a video file to an external receiving end, the video file can be encrypted by the above encryption rules, and then the encrypted video file is sent to the receiving end by the encryption terminal, and the decryption and playback of the video file are completed at the receiving end. Therefore, in order to achieve normal playback of the video, the encryption terminal and the receiving end need to store corresponding encryption rules and decryption rules, that is, the encryption rule is the method described above, and the decryption rule is relative to the encryption rule. Thereby ensuring the consistency of encryption and decryption. As an option, the information transmission mode of the encryption terminal and the receiving end can be wired transmission or wireless transmission, and the specific transmission mode is not limited in the embodiments of this specification. The specific decryption rules will be further described later.
[0114] In the embodiments of the present specification, the operation rules of at least two levels of reversible cellular automata in the multi-level reversible cellular automata are different.
[0115] It can be understood that the multi-level reversible cellular automaton is a reversible cellular automaton of at least two levels, so that the operation rules of at least two levels of reversible cellular automata are different, which can further avoid the dependency between different reversible cellular automata, achieve better discrete effect, and have higher security.
[0116] The number of levels of the reversible cellular automaton can be set according to actual conditions, and optionally can be 10 levels, 100 levels, etc., which is not limited in the embodiments of this specification.
[0117] Furthermore, the number of levels of the reversible cellular automaton can achieve a more secure encryption effect, but will also result in greater network resource consumption. Therefore, reversible cellular automata of different levels can be configured according to the importance of the video file. For example, if the video file is more important, a reversible cellular automaton with more levels can be set, thereby improving the adaptability and pertinence of the encryption rules.
[0118] In the embodiment of this specification, the method further includes:
[0119] The penultimate iteration data in the last level of the reversible cellular automation is obtained, and the penultimate iteration data is used as the key of the encrypted video file.
[0120] It can be understood that the key can be sent to the receiving end of the video together with the encrypted video file, and the receiving end decrypts the encrypted video file according to the key to obtain the original video file. Since the encryption is performed by a reversible cellular automaton, the decryption is also performed by the reversible cellular automaton to ensure the reliability and accuracy of the decryption.
[0121] Therefore, on the basis of receiving the encrypted video file and the key at the receiving end, the embodiment of this specification also provides a video decryption method based on a reversible cellular automation, such as Figure 6 As shown, the method includes:
[0122] Obtaining a video file to be decrypted and a key corresponding to the video file to be decrypted;
[0123] According to the multi-level reversible cellular automaton in the above method, determine a multi-level reversible cellular automaton for a decryption sequence corresponding to the video to be decrypted;
[0124] According to the video file to be decrypted and the key, a decryption process is performed through a multi-level reversible cellular automation of a decryption sequence to obtain a restored video file.
[0125] The encryption process and the decryption process are corresponding, so the accuracy of decryption can be guaranteed. For example:
[0126] Take file protocol information as an example: Figure 7 As shown in Figure 1, the decryption process is the reverse process of the encryption process. The encrypted information and ni-1 iteration data (i.e., key) are used as the initial structure of the reversible cellular automaton. The n-th level reversible cellular automaton is iterated ni-1 times to obtain the initial random sequence T. 00 and T nl, Then T nl Continue to iterate using the n-1th level reversible cellular automaton, and so on until the 1st level reversible cellular automaton, to obtain the plaintext data and the initial random sequence.
[0127] Take the file description information as an example, that is, decrypt the moov data block, decrypt all the encrypted mvhd blocks in the moov block, and the movhd block stores the description information of the entire media file, such as creation time, modification time, time measurement scale, playable duration, etc. Use the nth level reversible cellular automaton to iterate n a-1 Get the initial random sequence T 00 and T nl, and then continue to iterate Tnl using the n-1th level reversible cellular automaton, and so on until the 1st level reversible cellular automaton, to obtain the plaintext data and the initial random sequence.
[0128] Decrypt the track box block: Use the n-th level reversible cellular automaton to iterate n a-1 Get the initial random sequence T 00 and T nl , then T nl Continue to iterate using the n-1th level reversible cellular automaton, and so on until the 1st level reversible cellular automaton, to obtain the plaintext data and the initial random sequence.
[0129] All encrypted modules are finally decrypted through the above process.
[0130] The method provided in the embodiments of this specification is based on an encryption algorithm based on a reversible cellular automaton. Cellular automata have unique advantages in the field of cryptography due to their simple structure, high parallelism and complex computing power. The multiple cascade encryption structure of the algorithm makes full use of the dependencies between different factors to enhance security. For the efficiency of video file processing, only the file information in the video file (i.e., file protocol information and file description information), each media stream header and media stream information in the file, and the decoding format of the stream are encrypted. The method provided in this specification is based on the simplicity of the components of the reversible cellular automaton, the locality of the interaction between the units and the parallelism of information processing, and exhibits the characteristics of global complexity, thereby achieving fast and secure encryption and decryption of video files. The encrypted files have good randomness and scalability, thereby enhancing security.
[0131] The embodiment of this specification also provides a video encryption device based on a reversible cellular automation, such as Figure 8 As shown, the device comprises:
[0132] The parsing module 110 is used to parse the video file to be encrypted to obtain the file attribute information of the video file to be encrypted;
[0133] The conversion module 120 is used to convert the file attribute information to obtain a preset format sequence;
[0134] A random sequence generation module 130, used to generate a random sequence corresponding to the preset format sequence;
[0135] The encryption module 140 is used to bring the preset format sequence and the random sequence into the multi-level reversible cellular automation to obtain the encrypted video file.
[0136] Accordingly, the embodiment of this specification also provides a video decryption device based on a reversible cellular automation, such as Fig. 9 As shown, the device comprises:
[0137] The acquisition module 210 acquires the video file to be decrypted and the key corresponding to the video file to be decrypted;
[0138] The determination module 220 determines a multi-level reversible cellular automation for a decryption sequence corresponding to the video to be decrypted according to the multi-level reversible cellular automation in the above method;
[0139] The decryption module 230 performs decryption processing according to the video file to be decrypted and the key through a multi-level reversible cellular automation of a decryption sequence to obtain a restored video file.
[0140] The beneficial effects achieved by the above-mentioned device are consistent with the beneficial effects achieved by the above-mentioned method, and will not be described in detail in the embodiments of this specification.
[0141] like Fig.10 As shown, a computer device provided in an embodiment of this invention, the apparatus in this invention can be a computer device in this embodiment, and the method of this invention is executed. The computer device 1002 may include one or more processors 1004, such as one or more central processing units (CPUs), and each processing unit may implement one or more hardware threads. The computer device 1002 may also include any memory 1006, which is used to store any kind of information such as code, settings, data, etc. Non-limiting, for example, the memory 1006 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent a fixed or removable component of the computer device 1002. In one case, when the processor 1004 executes an associated instruction stored in any memory or a combination of memories, the computer device 1002 may perform any operation of the associated instruction. The computer device 1002 also includes one or more drive mechanisms 1008 for interacting with any storage, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0142] The computer device 1002 may also include an input / output module 1010 (I / O) for receiving various inputs (via input device 1012) and for providing various outputs (via output device 1014). A specific output mechanism may include a presentation device 1016 and an associated graphical user interface (GUI) 1018. In other embodiments, the input / output module 1010 (I / O), input device 1012, and output device 1014 may not be included, and the computer device 1002 may be used as a computer device in a network. The computer device 1002 may also include one or more network interfaces 1020 for exchanging data with other devices via one or more communication links 1022. One or more communication buses 1024 couple the components described above together.
[0143] The communication link 1022 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 1022 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.
[0144] Corresponds to Figure 1 or Figure 6 The method in this article also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are executed.
[0145] The embodiment of the present invention also provides a computer readable instruction, wherein when the processor executes the instruction, the program therein causes the processor to execute the following Figure 1 or Figure 6 The method shown.
[0146] It should be understood that in the various embodiments of this document, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this document.
[0147] It should also be understood that in the embodiments of this article, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0148] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this article.
[0149] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0150] In the several embodiments provided herein, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.
[0151] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this article.
[0152] In addition, each functional unit in each embodiment of this invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
[0153] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this article is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this article. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0154] Specific embodiments are used in this article to illustrate the principles and implementation methods of this article. The description of the above embodiments is only used to help understand the methods and core ideas of this article. At the same time, for general technicians in this field, according to the ideas of this article, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on this article.
Claims
1. A video encryption method based on reversible cellular automata, characterized in that: The method comprises: Parsing the video file to be encrypted to obtain file attribute information of the video file to be encrypted, wherein the file attribute information at least includes file protocol information, file description information, streaming media header information and decoder information; Convert the file attribute information to obtain a preset format sequence; Generating a random sequence corresponding to the preset format sequence; Bringing the preset format sequence and the random sequence into a multi-level reversible cellular automaton to obtain an encrypted video file, specifically: taking the random sequence and the preset format sequence as the initial state of the first-level reversible cellular automaton, iterating through the first-level reversible cellular automaton to obtain first-level iteration data; Using the random sequence and the first-level iterative data as the initial state of a second-level reversible cellular automaton, and iterating through the second-level reversible cellular automaton to obtain second-level iterative data; Repeat the above steps, use the random sequence and the previous level iterative data as the initial state of the next level reversible cellular automaton, iterate through the next level reversible cellular automaton until the last level iterative data is obtained, and the last level iterative data is used as the encrypted video file; Among them, reversible cellular automata of different levels are configured according to the importance of the video files.
2. The method according to claim 1, characterized in that The converting the file attribute information to obtain a preset format sequence includes: Determine the data block content corresponding to the file attribute information; The data block content is binary converted to obtain a binary two-value sequence.
3. The method according to claim 2, characterized in that The generating a random sequence corresponding to the preset format sequence comprises: The random sequence is generated by a random number generator, and the length of the random sequence is consistent with the length of the binary sequence.
4. The method according to claim 1, characterized in that: The operation rules of at least two levels of reversible cellular automata in the multi-level reversible cellular automata are different.
5. The method according to claim 1, characterized in that The method further comprises: The penultimate iteration data in the last level of the reversible cellular automation is obtained, and the penultimate iteration data is used as the key of the encrypted video file.
6. A video decryption method based on reversible cellular automata, characterized in that: The method comprises: Obtaining a video file to be decrypted and a key corresponding to the video file to be decrypted; According to the multi-level reversible cellular automaton in the method according to any one of claims 1 to 5, determining a multi-level reversible cellular automaton for a decryption sequence corresponding to the video to be decrypted; According to the video file to be decrypted and the key, a decryption process is performed through a multi-level reversible cellular automation of a decryption sequence to obtain a restored video file.
7. A video encryption device based on reversible cellular automata, characterized in that: The device comprises: A parsing module, used for parsing the video file to be encrypted to obtain file attribute information of the video file to be encrypted, wherein the file attribute information at least includes file protocol information, file description information, streaming media header information and decoder information; A conversion module, used for converting the file attribute information to obtain a preset format sequence; A random sequence generation module, used to generate a random sequence corresponding to the preset format sequence; The encryption module is used to bring the preset format sequence and the random sequence into the multi-level reversible cellular automaton to obtain the encrypted video file, specifically: taking the random sequence and the preset format sequence as the initial state of the first-level reversible cellular automaton, iterating through the first-level reversible cellular automaton to obtain the first-level iteration data; Using the random sequence and the first-level iterative data as the initial state of a second-level reversible cellular automaton, and iterating through the second-level reversible cellular automaton to obtain second-level iterative data; Repeat the above steps, use the random sequence and the previous level iterative data as the initial state of the next level reversible cellular automaton, iterate through the next level reversible cellular automaton until the last level iterative data is obtained, and the last level iterative data is used as the encrypted video file; Among them, reversible cellular automata of different levels are configured according to the importance of the video files.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
