CN112492352A - Video encryption and decryption method and device, electronic equipment and storage medium - Google Patents

Video encryption and decryption method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112492352A
CN112492352A CN202011290857.3A CN202011290857A CN112492352A CN 112492352 A CN112492352 A CN 112492352A CN 202011290857 A CN202011290857 A CN 202011290857A CN 112492352 A CN112492352 A CN 112492352A
Authority
CN
China
Prior art keywords
encryption
algorithm
video
encrypted
decryption
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.)
Pending
Application number
CN202011290857.3A
Other languages
Chinese (zh)
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 Muhua Information Technology Co ltd
Original Assignee
Beijing Muhua Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Muhua Information Technology Co ltd filed Critical Beijing Muhua Information Technology Co ltd
Priority to CN202011290857.3A priority Critical patent/CN112492352A/en
Publication of CN112492352A publication Critical patent/CN112492352A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2347Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving video stream encryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the application provides a video encryption and decryption method and device, electronic equipment and a storage medium, and relates to the technical field of video encryption and decryption. The encryption method comprises the steps of obtaining video data to be encrypted; setting a current algorithm version number corresponding to a current encryption algorithm; encrypting the video data by using the current encryption algorithm to generate a cipher text segment; randomly generating an encryption identifier according to a preset length; the encryption identifier, the encrypted text segment and the current algorithm version number are combined to generate a video file, and by adding an encryption method of the encryption identifier and the algorithm version number, more encryption algorithms can be dynamically expanded, so that the encryption security is enhanced, the decryption algorithm can be quickly obtained according to the algorithm version number, the encryption and decryption efficiency is improved, and the problems of low security and low encryption and decryption efficiency of the existing method are solved.

Description

Video encryption and decryption method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of video encryption and decryption technologies, and in particular, to a video encryption and decryption method and apparatus, an electronic device, and a storage medium.
Background
In the course of course video resource transmission, in order to avoid leakage of course video resources, the video needs to be encrypted and decrypted by using an encryption and decryption algorithm to improve the security of course video resource transmission, but the security of the existing single encryption and decryption algorithm is lower.
Disclosure of Invention
The embodiment of the application aims to provide a video encryption and decryption method, a video encryption and decryption device, electronic equipment and a storage medium, more encryption and decryption algorithms can be dynamically expanded by adding an encryption identifier and an algorithm version number, so that the encryption security is enhanced, the decryption algorithm can be quickly obtained according to the algorithm version number, the encryption and decryption efficiency is improved, and the problems of low security and low encryption and decryption efficiency of the existing method are solved.
The embodiment of the application provides a video encryption method, which comprises the following steps:
acquiring video data to be encrypted;
setting a current algorithm version number corresponding to a current encryption algorithm;
encrypting the video data by using the current encryption algorithm to generate a cipher text segment;
randomly generating an encryption identifier according to a preset length;
combining the encrypted identification, the cryptographic segment, and the current algorithm version number to generate a video file.
In the implementation process, the encrypted identifier, the ciphertext section and the current algorithm version number are combined to form the video file, the encrypted identifier is generated randomly, the security is improved by adding additional information to the ciphertext section, the decryption algorithm can be quickly acquired according to the algorithm version number, the decryption efficiency is improved, and the problems that the existing method is low in security and low in encryption and decryption efficiency are solved.
Further, the randomly generating the encrypted identifier according to the preset length includes:
receiving the length of a preset encryption identifier;
and randomly generating any character string according to the length so as to take the character string as an encryption identifier.
In the implementation process, the length of the encrypted identifier can be set, any character string with the length can be generated, the any character string is used as the encrypted identifier, the encryption security is further improved, and the length of the encrypted identifier can be dynamically adjusted according to needs.
Further, the method further comprises:
if the size of the video data is larger than a set value, replacing the current encryption algorithm with a second encryption algorithm with smaller time complexity;
and acquiring a corresponding second algorithm version number according to the second encryption algorithm so as to add the second algorithm version number to the ciphertext section generated by using the second encryption algorithm.
In the implementation process, the encryption algorithm can be replaced according to the size of the video data so as to improve the encryption and decryption efficiency, and meanwhile, the dynamic upgrade of the encryption and decryption algorithm is realized by replacing the algorithm version number, so that the method has better safety and flexibility.
The embodiment of the present application further provides a video decryption method, where the method includes:
reading a video file;
judging whether an encryption identifier exists or not to determine whether the video file is an encrypted file or not;
if so, acquiring encryption algorithm information of the encrypted file to match a corresponding decryption algorithm;
acquiring a ciphertext segment according to the encryption identifier and the decryption algorithm;
and decrypting the encrypted text segment by using the decryption algorithm to obtain video data.
In the implementation process, whether the video file is the encrypted file can be determined by detecting whether the video file has the encryption identifier, if so, the encrypted file segment can be quickly obtained through the encryption identifier and the encryption algorithm information, the video data can be obtained by decrypting the encrypted file segment, the decryption efficiency is improved, the encryption identifier and the encryption algorithm information are transmitted together, the video file transmission safety is improved, and the problems that the safety of the existing method is low and the encryption and decryption efficiency is low are solved.
Further, the determining whether there is an encryption identifier to determine whether the video file is an encrypted file includes:
detecting a video file according to the length and the position of a preset encryption identifier so as to determine whether the video file has the encryption identifier;
and if so, the video file is an encrypted file.
In the implementation process, whether the video file is an encrypted file can be determined by detecting whether the identifier is encrypted at the corresponding position of the video file.
Further, the obtaining of the encryption algorithm information of the encrypted file to match a corresponding decryption algorithm includes:
reading a current algorithm version number in the video file according to a preset position;
and matching the corresponding decryption algorithm according to the current algorithm version number.
In the implementation process, the corresponding matching algorithm can be quickly obtained through the current algorithm version number for decryption, and the current algorithm version number and the ciphertext segment form a video file together, so that the safety can be improved.
An embodiment of the present application further provides a video encryption apparatus, where the apparatus includes:
the data acquisition module is used for acquiring video data to be encrypted;
the version number setting module is used for setting a current algorithm version number corresponding to the current encryption algorithm;
the ciphertext segment generating module is used for encrypting the video data by using the current encryption algorithm to generate a ciphertext segment;
the identification generation module is used for randomly generating an encrypted identification according to a preset length;
and the video file generation module is used for combining the encrypted identifier, the encrypted text segment and the current algorithm version number to generate a video file.
In the implementation process, the encryption identification and the current algorithm version number of the current encryption algorithm are added at two ends of the generated ciphertext section to form a video file for transmission, so that the security can be improved, meanwhile, the corresponding encryption algorithm is used for encryption as required, and the corresponding decryption algorithm can be quickly matched according to the algorithm version number during decryption, so that the efficiency is improved, and the problems of low security and low encryption and decryption efficiency of the existing method are solved.
An embodiment of the present application further provides a video decryption apparatus, where the apparatus includes:
the reading module is used for reading the video file;
the judgment module is used for judging whether an encryption identifier exists or not so as to determine whether the video file is an encrypted file or not;
the decryption algorithm obtaining module is used for obtaining the encryption algorithm information of the encrypted file to match with the corresponding decryption algorithm if the video file is the encrypted file;
the encrypted text segment acquisition module is used for acquiring the encrypted text segment according to the encryption identifier and the encryption algorithm information;
and the decryption module is used for decrypting the encrypted text segment by using the decryption algorithm so as to obtain video data.
In the implementation process, the corresponding decryption algorithm can be quickly matched through the encryption algorithm information, the decryption efficiency is improved, and the security is improved by acquiring the encrypted text segment through the encryption identifier and the encryption algorithm information.
An embodiment of the present application further provides an electronic device, where the electronic device includes a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to make the computer device execute the video encryption method described in any one of the above.
An embodiment of the present application further provides a readable storage medium, where computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the method for encrypting a video is performed according to any one of the foregoing methods.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a flowchart of a video encryption algorithm provided in an embodiment of the present application;
fig. 2 is a flowchart of an encryption algorithm replacement according to an embodiment of the present application;
fig. 3 is a flowchart of randomly generating an encrypted identifier according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a video file provided in an embodiment of the present application;
FIG. 5 is a flowchart of decryption provided by an embodiment of the present application;
FIG. 6 is a flowchart of a process for determining an encrypted file according to an embodiment of the present application;
fig. 7 is a block diagram of a video encryption apparatus according to an embodiment of the present application;
fig. 8 is a block diagram illustrating a detailed structure of a video encryption apparatus according to an embodiment of the present disclosure;
fig. 9 is a block diagram of a video decryption apparatus according to an embodiment of the present application;
fig. 10 is a block diagram illustrating a specific structure of a video decryption apparatus according to an embodiment of the present application.
Icon:
100-a data acquisition module; 200-a version number setting module; 201-encryption algorithm replacing module; 202-version number obtaining module; 300-ciphertext fragment generating module; 400-an identity generation module; 401-length setting module; 402-a string generation module; 500-video file generation module; 610-a reading module; 620-judgment module; 621-an identity detection module; 622-encrypted file determination module; 630-decryption algorithm obtaining module; 631-version number reading module; 632-algorithm matching module; 640-ciphertext fragment obtaining module; 650-decryption module.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Example 1
Referring to fig. 1, fig. 1 is a flowchart of a video encryption algorithm according to an embodiment of the present disclosure. The method is applied to the course video resource transmission process, needs to carry out encryption transmission on the course video resource in order to prevent the course video resource from leaking, can carry out decryption quickly after a receiving end such as a mobile phone receives the course video, reduces decryption time and improves decryption efficiency. The method specifically comprises the following steps:
step S100: acquiring video data to be encrypted;
step S200: setting a current algorithm version number corresponding to a current encryption algorithm;
on one hand, the version number of the current algorithm can be customized, and the randomness of the version number of the current algorithm is enhanced, so that the probability of obtaining a decryption algorithm through the version number of the current algorithm is reduced (the version number of the current algorithm is transmitted to a receiving end along with an encrypted file), and the safety is improved; in addition, the length of the version number of the current algorithm can be dynamically adjusted according to needs, for example, the length of the version number of the current algorithm can be adjusted at intervals, and the safety can also be improved.
On the other hand, the method of increasing the algorithm version number during encryption may also dynamically expand more encryption algorithms, that is, different encryption algorithms are changed at any time as required, thereby further enhancing the security of encryption, as shown in fig. 2, for changing the flow chart of the encryption algorithm, the method further includes:
step S201: if the size of the video data is larger than a set value, replacing the current encryption algorithm with a second encryption algorithm with smaller time complexity;
step S202: and acquiring a corresponding second algorithm version number according to the second encryption algorithm so as to add the second algorithm version number to the ciphertext section generated by using the second encryption algorithm.
When the file of the video data is large, if the common encryption algorithms such as AES, DES and the like are adopted, the efficiency is obviously reduced, and therefore, when the video data is small, the first algorithm which is time-consuming and complex is adopted; when the video data is large, a simpler second algorithm which takes shorter time is adopted, so that the encryption and decryption efficiency and the security are balanced. For example, a plurality of gradient thresholds can be set according to the size of different video data, and when an encryption algorithm corresponding to time complexity is adopted within a certain set value range, the encryption and decryption efficiency and security of the algorithm are balanced, and the encryption security can be improved by dynamically replacing the algorithm.
Therefore, an appropriate encryption algorithm needs to be used according to the size of the video data to improve the encryption and decryption efficiency, and particularly, under the condition that a mobile phone terminal decrypts larger video data, the efficiency of the encryption and decryption algorithm needs to be improved, correspondingly, the algorithm version number is correspondingly changed, the algorithm version number carried in the video file received by the receiving terminal is also changed accordingly, the probability of obtaining the encrypted text segment in the video file is reduced, and therefore the safety is improved, not only is the efficiency improved, but also the safety is improved, in addition, the encryption and decryption algorithm is dynamically adjusted according to the requirement, and the flexibility of the algorithm use is enhanced.
Step S300: encrypting the video data by using the current encryption algorithm to generate a cipher text segment;
illustratively, the video data is encrypted by using, for example, a symmetric encryption algorithm and a key corresponding to the current algorithm version number to generate a ciphertext fragment.
Step S400: randomly generating an encryption identifier according to a preset length;
as shown in fig. 3, a flowchart for randomly generating an encrypted identifier may specifically include:
step S401: receiving the length of a preset encryption identifier;
step S402: and randomly generating any character string according to the length so as to take the character string as an encryption identifier.
Illustratively, the length of the encrypted identifier is predefined and can be replaced, that is, the length of the encrypted identifier can be dynamically adjusted as required, and the uncertainty of the length of the encrypted identifier enhances the security; after the length of the encrypted identifier is defined, an arbitrary character string is randomly generated and used as the encrypted identifier, and the security is further enhanced.
Step S500: combining the encrypted identification, the cryptographic segment, and the current algorithm version number to generate a video file.
As shown in fig. 4, which is a schematic structural diagram of a video file, an encryption identifier and a current algorithm version number may be added at two ends of a ciphertext segment, and extra information is added at the head and tail ends of the ciphertext segment, so that a layer of obstruction is added for malicious decryption behavior, thereby improving security; in order to further improve the security, the position relationship among the encrypted text segment, the encrypted identifier and the current algorithm version number can be changed randomly so as to further improve the security.
Decrypting the video file at the receiving end, as shown in fig. 5, which is a decryption flowchart, may specifically include the following steps:
step S610: reading a video file;
step S620: judging whether an encryption identifier exists or not to determine whether the video file is an encrypted file or not;
as shown in fig. 6, which is a flowchart of a determination process of an encrypted file, step S620 may specifically include:
step S621: detecting a video file according to the length and the position of a preset encryption identifier so as to determine whether the video file has the encryption identifier;
step S622: and if so, the video file is an encrypted file.
For example, if the encryption flag is set at the left end of the ciphertext fragment, the first 16 bytes (preset length) of the video file are read, whether the encryption flag exists can be determined, if so, the video file is an encrypted file, and if not, the video file is regarded as an unencrypted video, and the decryption operation is stopped.
Step S630: if so, acquiring encryption algorithm information of the encrypted file to match a corresponding decryption algorithm;
the step may specifically include:
step S631: reading a current algorithm version number in the video file according to a preset position;
step S632: and matching the corresponding decryption algorithm according to the current algorithm version number.
If the preset position is the tail end of the video file, reading the last 4 bytes of the video file, analyzing the last 4 bytes into the current algorithm version number of the current encryption algorithm, and matching the current algorithm version number with the corresponding decryption algorithm.
Step S640: acquiring a cipher text segment according to the encryption identifier and the encryption algorithm information;
step S650: and decrypting the encrypted text segment by using the decryption algorithm to obtain video data.
As described above, after the encryption identifier and the current algorithm version number are obtained, the first 16 bytes and the second 4 bytes of the video file can be cut off to obtain the ciphertext segment, and the ciphertext segment is decrypted by using the matched decryption algorithm to obtain the video data.
Example 2
An embodiment of the present application provides a video encryption apparatus, as shown in fig. 7, which is a block diagram of a structure of the video encryption apparatus, and the apparatus includes:
a data obtaining module 100, configured to obtain video data to be encrypted;
a version number setting module 200, configured to set a current algorithm version number corresponding to a current encryption algorithm;
a ciphertext fragment generating module 300, configured to encrypt the video data by using the current encryption algorithm to generate a ciphertext fragment;
an identifier generating module 400, configured to randomly generate an encrypted identifier according to a preset length;
a video file generating module 500, configured to combine the encrypted identifier, the encrypted segment, and the current algorithm version number to generate a video file.
As shown in fig. 8, which is a specific block diagram of a video encryption apparatus, the identifier generating module 400 includes:
a length setting module 401, configured to receive a length of a preset encryption identifier;
a character string generating module 402, configured to randomly generate an arbitrary character string according to the length, so as to use the character string as an encrypted identifier.
The device also includes:
an encryption algorithm replacing module 201, configured to replace a current encryption algorithm with a second encryption algorithm with a smaller time complexity if the size of the video data is larger than a set value;
a version number obtaining module 202, configured to obtain a corresponding second algorithm version number according to the second encryption algorithm, so as to add the second algorithm version number to the ciphertext fragment generated by using the second encryption algorithm.
The encryption identification and the current algorithm version number of the current encryption algorithm are added at two ends of the generated ciphertext section to form a video file for transmission, so that the security can be improved, meanwhile, the corresponding encryption algorithm is used for encryption as required, and the corresponding decryption algorithm can be quickly matched according to the algorithm version number during decryption, so that the efficiency is improved, and the problems of lower security and lower encryption and decryption efficiency of the existing method are solved.
An embodiment of the present application provides a video decryption apparatus, as shown in fig. 9, which is a block diagram of a structure of the video decryption apparatus, and the apparatus includes:
a reading module 610, configured to read a video file;
a judging module 620, configured to judge whether there is an encryption identifier to determine whether the video file is an encrypted file;
a decryption algorithm obtaining module 630, configured to, if the video file is an encrypted file, obtain encryption algorithm information of the encrypted file to match a corresponding decryption algorithm;
a ciphertext fragment obtaining module 640, configured to obtain a ciphertext fragment according to the encryption identifier and the encryption algorithm information;
and a decryption module 650, configured to decrypt the encrypted segment using the decryption algorithm to obtain video data.
As shown in fig. 10, which is a specific block diagram of the video decryption apparatus, the determining module 620 includes:
the identifier detection module 621 is configured to detect a video file according to a length and a position of a preset encryption identifier, so as to determine whether the video file has the encryption identifier;
and the encrypted file determining module 622, if the encrypted identifier exists, the video file is an encrypted file.
The decryption algorithm obtaining module 630 includes:
a version number reading module 631, configured to read a current algorithm version number in the video file according to a preset position;
and an algorithm matching module 632, configured to match a corresponding decryption algorithm according to the current algorithm version number.
The corresponding decryption algorithm can be quickly matched through the encryption algorithm information, the decryption efficiency is improved, the ciphertext section is intercepted through detecting the encryption identification and the version number of the encryption algorithm, the ciphertext section is decrypted, the encryption identification and the version number of the encryption algorithm are arranged, the safety is improved, meanwhile, the version number of the encryption algorithm can be quickly matched with the decryption algorithm, and the decryption efficiency is improved.
An embodiment of the present application further provides an electronic device, where the electronic device includes a memory and a processor, the memory is used for storing a computer program, and the processor runs the computer program to enable the computer device to execute the video encryption method according to any one of embodiments 1.
An embodiment of the present application further provides a readable storage medium, where computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the method for encrypting a video according to any one of embodiments 1 is performed.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A method for video encryption, the method comprising:
acquiring video data to be encrypted;
setting a current algorithm version number corresponding to a current encryption algorithm;
encrypting the video data by using the current encryption algorithm to generate a cipher text segment;
randomly generating an encryption identifier according to a preset length;
combining the encrypted identification, the cryptographic segment, and the current algorithm version number to generate a video file.
2. The video encryption method according to claim 1, wherein the randomly generating the encryption identifier according to the preset length comprises:
receiving the length of a preset encryption identifier;
and randomly generating any character string according to the length so as to take the character string as an encryption identifier.
3. The video encryption method of claim 1, wherein the method further comprises:
if the size of the video data is larger than a set value, replacing the current encryption algorithm with a second encryption algorithm with smaller time complexity;
and acquiring a corresponding second algorithm version number according to the second encryption algorithm so as to add the second algorithm version number to the ciphertext section generated by using the second encryption algorithm.
4. A method for video decryption, the method comprising:
reading a video file;
judging whether an encryption identifier exists or not to determine whether the video file is an encrypted file or not;
if so, acquiring encryption algorithm information of the encrypted file to match a corresponding decryption algorithm;
acquiring a cipher text segment according to the encryption identifier and the encryption algorithm information;
and decrypting the encrypted text segment by using the decryption algorithm to obtain video data.
5. The video decryption method of claim 4, wherein the determining whether there is an encryption flag to determine whether the video file is an encrypted file comprises:
detecting a video file according to the length and the position of a preset encryption identifier so as to determine whether the video file has the encryption identifier;
and if so, the video file is an encrypted file.
6. The video decryption method of claim 4, wherein the obtaining of the encryption algorithm information of the encrypted file to match the corresponding decryption algorithm comprises:
reading a current algorithm version number in the video file according to a preset position;
and matching the corresponding decryption algorithm according to the current algorithm version number.
7. A video encryption apparatus, characterized in that the apparatus comprises:
the data acquisition module is used for acquiring video data to be encrypted;
the version number setting module is used for setting a current algorithm version number corresponding to the current encryption algorithm;
the ciphertext segment generating module is used for encrypting the video data by using the current encryption algorithm to generate a ciphertext segment;
the identification generation module is used for randomly generating an encrypted identification according to a preset length;
and the video file generation module is used for combining the encrypted identifier, the encrypted text segment and the current algorithm version number to generate a video file.
8. A video decryption apparatus, characterized in that the apparatus comprises:
the reading module is used for reading the video file;
the judgment module is used for judging whether an encryption identifier exists or not so as to determine whether the video file is an encrypted file or not;
the decryption algorithm obtaining module is used for obtaining the encryption algorithm information of the encrypted file to match with the corresponding decryption algorithm if the video file is the encrypted file;
the encrypted text segment acquisition module is used for acquiring the encrypted text segment according to the encryption identifier and the encryption algorithm information;
and the decryption module is used for decrypting the encrypted text segment by using the decryption algorithm so as to obtain video data.
9. An electronic device, characterized in that the electronic device comprises a memory for storing a computer program and a processor for executing the computer program to cause the computer device to perform the video encryption method according to any one of claims 1 to 3.
10. A readable storage medium having stored thereon computer program instructions which, when read and executed by a processor, perform the video encryption method of any one of claims 1 to 3.
CN202011290857.3A 2020-11-17 2020-11-17 Video encryption and decryption method and device, electronic equipment and storage medium Pending CN112492352A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011290857.3A CN112492352A (en) 2020-11-17 2020-11-17 Video encryption and decryption method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011290857.3A CN112492352A (en) 2020-11-17 2020-11-17 Video encryption and decryption method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112492352A true CN112492352A (en) 2021-03-12

Family

ID=74931410

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011290857.3A Pending CN112492352A (en) 2020-11-17 2020-11-17 Video encryption and decryption method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112492352A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225329A (en) * 2022-06-21 2022-10-21 中国电信股份有限公司 File verification data generation method and device, electronic equipment and readable storage medium
WO2023178792A1 (en) * 2022-03-24 2023-09-28 平安科技(深圳)有限公司 Ciphertext data storage method and apparatus, and device and storage medium
CN117707585A (en) * 2024-02-05 2024-03-15 广州市赛科自动化控制设备有限公司 Remote software upgrading method, system and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108156479A (en) * 2016-12-06 2018-06-12 创盛视联数码科技(北京)有限公司 Video cloud platform video playing uri encipher-decipher methods
CN109474423A (en) * 2018-12-10 2019-03-15 平安科技(深圳)有限公司 Data encryption/decryption method, server and storage medium
CN110012319A (en) * 2018-01-04 2019-07-12 武汉斗鱼网络科技有限公司 A kind of method for authenticating and device of video flowing address
US20190238795A1 (en) * 2018-02-01 2019-08-01 Mstar Semiconductor, Inc. Method and system encrypting and decrypting audio/video file
CN110430446A (en) * 2019-07-26 2019-11-08 东软集团股份有限公司 Method for processing video frequency, device, equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108156479A (en) * 2016-12-06 2018-06-12 创盛视联数码科技(北京)有限公司 Video cloud platform video playing uri encipher-decipher methods
CN110012319A (en) * 2018-01-04 2019-07-12 武汉斗鱼网络科技有限公司 A kind of method for authenticating and device of video flowing address
US20190238795A1 (en) * 2018-02-01 2019-08-01 Mstar Semiconductor, Inc. Method and system encrypting and decrypting audio/video file
CN109474423A (en) * 2018-12-10 2019-03-15 平安科技(深圳)有限公司 Data encryption/decryption method, server and storage medium
CN110430446A (en) * 2019-07-26 2019-11-08 东软集团股份有限公司 Method for processing video frequency, device, equipment and computer readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023178792A1 (en) * 2022-03-24 2023-09-28 平安科技(深圳)有限公司 Ciphertext data storage method and apparatus, and device and storage medium
CN115225329A (en) * 2022-06-21 2022-10-21 中国电信股份有限公司 File verification data generation method and device, electronic equipment and readable storage medium
CN117707585A (en) * 2024-02-05 2024-03-15 广州市赛科自动化控制设备有限公司 Remote software upgrading method, system and storage medium
CN117707585B (en) * 2024-02-05 2024-05-03 广州市赛科自动化控制设备有限公司 Remote software upgrading method, system and storage medium

Similar Documents

Publication Publication Date Title
CN107038383B (en) Data processing method and device
CN112492352A (en) Video encryption and decryption method and device, electronic equipment and storage medium
CN111756717B (en) Information processing method and device
CN106788995B (en) File encryption method and device
CN106599723B (en) File encryption method and device and file decryption method and device
US8744078B2 (en) System and method for securing multiple data segments having different lengths using pattern keys having multiple different strengths
WO2017202025A1 (en) Terminal file encryption method, terminal file decryption method, and terminal
US20160285635A1 (en) Secure communication of data between devices
WO2017065209A1 (en) Information processing system, information processing device, information processing method, and program
CN109274644B (en) Data processing method, terminal and watermark server
WO2012149096A1 (en) Method and system for managing information on mobile devices
KR20170091609A (en) Method and apparatus for encrypting/decrypting data on mobile terminal
CN110221990B (en) Data storage method and device, storage medium and computer equipment
US20230325516A1 (en) Method for file encryption, terminal, electronic device and computer-readable storage medium
EP3623980B1 (en) Ransomware encryption algorithm determination
US11128455B2 (en) Data encryption method and system using device authentication key
CN112532379A (en) File protection method and device
CN105809494A (en) method and system for invoice generation and invoice verification
JP2006285697A (en) File management method and file management system
WO2018059303A1 (en) Method and device for encrypting and decrypting information in short message
CN115694921A (en) Data storage method, device and medium
CN110830252B (en) Data encryption method, device, equipment and storage medium
EP3850514B1 (en) Encryption key seed determination
KR102083415B1 (en) Apparatus and method for decrypting encrypted files
CN101860435B (en) Message sending method and device, message receiving method and device as well as method and device for determining network node

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210312