CN114286130A - Video encryption method, video processing method and device and electronic equipment - Google Patents
Video encryption method, video processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN114286130A CN114286130A CN202111641602.1A CN202111641602A CN114286130A CN 114286130 A CN114286130 A CN 114286130A CN 202111641602 A CN202111641602 A CN 202111641602A CN 114286130 A CN114286130 A CN 114286130A
- Authority
- CN
- China
- Prior art keywords
- media data
- video
- video file
- ciphertext
- file
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000003672 processing method Methods 0.000 title claims description 27
- 238000012545 processing Methods 0.000 claims abstract description 24
- 238000013475 authorization Methods 0.000 description 10
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 238000004590 computer program Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
Images
Landscapes
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The application discloses a video encryption method, a video processing device and electronic equipment. The video encryption method comprises the following steps: acquiring a video file to be encrypted; acquiring plaintext media data according to the video file, and encrypting the plaintext media data to obtain ciphertext media data; and replacing the plaintext media data with the ciphertext media data to obtain an encrypted video file of the video file. In the embodiment of the application, the video file can be protected by encrypting the media data in the video file, the whole video file is not required to be encrypted, only the media data in the video file is encrypted, the memory resources occupied in the encryption process are less, and the processing efficiency is high.
Description
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a video encryption method, a video processing device, and an electronic device.
Background
With the development of network technology, the transmission of video files is greatly facilitated. Therefore, in order to protect the video file, it is generally necessary to encrypt the video file and transmit the encrypted video file. After the user acquires the video file, the video file is decrypted and then played.
However, when the video file is encrypted or decrypted as a whole, the occupied memory resource is related to the size of the video file, and when the video file is large, the memory resource is greatly occupied in the encryption or decryption process. Therefore, it is an urgent technical problem to reduce the memory resources occupied by video encryption and decryption and to improve the encryption and decryption efficiency.
Disclosure of Invention
In view of the foregoing problems in the prior art, the present application provides a video encryption method, a video processing apparatus, and an electronic device, and the technical solution adopted in the embodiments of the present application is as follows:
in one aspect, the present application provides a video encryption method, including:
acquiring a video file to be encrypted;
acquiring plaintext media data according to the video file, and encrypting the plaintext media data to obtain ciphertext media data;
and replacing the plaintext media data with the ciphertext media data to obtain an encrypted video file of the video file.
In some embodiments, said obtaining plaintext media data from said video file comprises:
obtaining each video block file according to the video file;
and acquiring corresponding video frame data according to each video block file to acquire the plaintext media data.
In some embodiments, the encrypting the plaintext media data to obtain ciphertext media data includes:
obtaining a symmetric key;
and based on the symmetric key, encrypting the plaintext media data by using an encryption algorithm to obtain the ciphertext media data.
In some embodiments, the method further comprises:
acquiring an encryption key file, wherein the encryption key file is generated by encrypting the symmetric key by a server;
and uploading the encrypted video file and the encrypted key file to a server for storage.
In another aspect, an embodiment of the present application provides a video processing method, including:
receiving a video playing request;
acquiring an encrypted video file from a server by using a first thread according to the video playing request, and acquiring ciphertext media data according to the encrypted video file;
acquiring a corresponding symmetric key from a server by using a second thread, and decrypting the ciphertext media data to obtain plaintext media data;
and replacing the plaintext media data with the ciphertext media data by using the first thread so as to play a video according to the video playing request.
On the other hand, the embodiment of the present application further provides a processing method, including:
receiving a video file acquisition request of a client, and sending a corresponding video file to the client according to the video file acquisition request so that the client can read ciphertext media data in the video file;
and receiving a decryption request of the client for the ciphertext media data, and sending the symmetric key to the client.
In some embodiments, when receiving a file reading request from a client, the method further includes: and verifying the client to determine whether the client has the acquisition right.
On the other hand, an embodiment of the present application provides a video encryption apparatus, including:
the acquisition module is configured to acquire a video file to be encrypted;
the encryption module is configured to acquire plaintext media data according to the video file and encrypt the plaintext media data to obtain ciphertext media data;
and the processing module is configured to replace the plaintext media data with the ciphertext media data to obtain an encrypted video file of the video file.
In another aspect, an embodiment of the present application provides a video processing apparatus, including:
the receiving module is configured to receive a video playing request;
the acquisition module is configured to acquire an encrypted video file from a server by using a first thread according to the video playing request and acquire ciphertext media data according to the encrypted video file;
the decryption module is configured to acquire a corresponding symmetric key from the server by using a second thread, and decrypt the ciphertext media data to obtain plaintext media data;
and the playing module is configured to replace the plaintext media data with the ciphertext media data by using the first thread so as to play a video according to the video playing request.
On the other hand, an embodiment of the present application provides an electronic device, which at least includes a memory and a processor, where the memory stores a program, and the processor implements the steps of the video encryption method provided in any of the above embodiments when executing the program on the memory; or, implementing the steps of the video processing method as provided in any of the above embodiments; alternatively, the steps of the processing method as provided in any of the above embodiments are implemented.
In the embodiment of the application, the media data in the video file is encrypted, so that the video file can be protected, the whole video file is not required to be encrypted, less memory resources are occupied in the encryption and decryption processes, and the processing efficiency is high.
Drawings
Fig. 1 is a schematic view of a client and a server according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a video encryption method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a video processing method according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of a processing method according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a video encryption apparatus according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a video processing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Various aspects and features of the present application are described herein with reference to the drawings.
It will be understood that various modifications may be made to the embodiments of the present application. Accordingly, the foregoing description should not be construed as limiting, but merely as exemplifications of embodiments. Those skilled in the art will envision other modifications within the scope and spirit of the application.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and, together with a general description of the application given above and the detailed description of the embodiments given below, serve to explain the principles of the application.
These and other characteristics of the present application will become apparent from the following description of alternative forms of embodiment, given as non-limiting examples, with reference to the attached drawings.
It is also to be understood that although the present application has been described with reference to some specific examples, those skilled in the art are able to ascertain many other equivalents to the practice of the present application.
The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely exemplary of the application, which can be embodied in various forms. Well-known and/or repeated functions and constructions are not described in detail to avoid obscuring the application of unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present application in virtually any appropriately detailed structure.
The specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the application.
In the process of implementing the inventive concept of the present application, the inventor finds that, in the related art, when a video file is encrypted and decrypted as a whole, especially for a larger video file, for example, a video file with a size of several hundreds of MB to several GB, the encryption and decryption process occupies a larger memory resource, the processing process is also slower, the efficiency is low, the user waiting time is long, and the experience is poor.
Therefore, in the video encryption method provided by the embodiment of the application, the encrypted video file is obtained by encrypting the media data in the video file, the video file can be protected without encrypting the whole video file, the memory resource required in the encryption process is reduced, the encryption speed is increased, and the user experience is good. In the video processing process, when a video playing request is received and ciphertext media data are obtained from an encrypted video file, the ciphertext media data are decrypted and can be correspondingly played when plaintext media data are obtained, the decryption process does not need to wait for the decryption of the whole video file to be completed, the memory resources required by the decryption process are less, the processing efficiency is high, the decryption and the playing can be carried out simultaneously, and the user experience is good.
The method is applied between the client and the server of the electronic equipment. The electronic device may include, but is not limited to, a mobile phone, a tablet computer, a computer, and the like, and the client may be an application program capable of decoding, encrypting, decrypting, playing, and the like a video file, so as to encrypt and decrypt media data in the video file and play the video file. Specifically, the video encryption method and the video processing method of the embodiment of the application can be applied to a client of an electronic device. The server may include, but is not limited to, a physical server, a cloud server, a distributed processing system, and the like, and provides a database service, a storage and distribution service of video files, a data encryption and decryption service, and the like for the client.
Fig. 1 shows a schematic view of a client and a server according to an embodiment of the present application. It is understood that the form and number of the terminal devices, the communication networks and the servers in fig. 1 are only illustrative, and any number and any form of the terminal devices, the communication networks and the servers can be selected according to actual needs, which is not limited in this application.
Referring to fig. 1, a client a installed on a terminal device 1a and a client B installed on a terminal device 1B may each be communicatively connected to a server 2 via a communication network. The client A acquires plaintext media data from a video file to be encrypted, encrypts the plaintext media data to obtain ciphertext media data, and then replaces the plaintext media data with the ciphertext media data to obtain an encrypted video file. After the encryption is completed, the client a may upload the encrypted video file to the server 2 and store the encrypted video file on the server 2. When the client A or the client B receives a video playing request, the corresponding encrypted video file is obtained from the server 2, when the ciphertext media data are read from the encrypted video file, a decryption key is requested from the server 2, the ciphertext media data are decrypted by using the decryption key, and the plaintext media data are obtained, so that the client A or the client B can decode the plaintext media data to obtain corresponding original data information, and render and play the original data information.
The following describes a technical solution of an embodiment of the present application.
Fig. 2 shows a schematic flow chart of a video encryption method of the present application. As shown in fig. 2, the video encryption method of the present application includes the following steps S110 to S130:
s110, obtaining a video file to be encrypted.
In this application, the format of the video file may include, but is not limited to: mp4, rmvb, wmv, etc. In this step, the user obtains the video file to be encrypted on the terminal device through the client, and the corresponding video file is selected from the video files locally stored in the terminal device through the client according to the user's needs and actual conditions. Or according to the request of the user, acquiring the corresponding video file from other terminal equipment or the server, and selecting the video file through the client to acquire the video file to be encrypted required by the user.
And S120, acquiring plaintext media data according to the video file, and encrypting the plaintext media data to obtain ciphertext media data.
According to the embodiment of the application, the metadata and the media data are included in the video file. The media data includes video data or audio data to be actually played. Metadata is a numerical value that describes the basic characteristics and attributes of the media data itself.
In this step, after the client acquires the video file to be encrypted, the video file is decoded to acquire plaintext media data in the video file. In the process of generating a video file, sampling is usually performed according to a predetermined time, and a sample block corresponding to media data is obtained and stored, so that the video file usually consists of a plurality of video block files. For example, a video file in mp4 format generally consists of several container units box with data encapsulated therein, and the container units can be nested, that is, the container units can contain other container units. When a container unit contains a box of media data and corresponding metadata corresponding to a sample block, the container unit is a video block file, and the video block file can be decoded and played by a corresponding mp4 playing application.
Thus, in some embodiments, obtaining plaintext media data from a video file may be implemented as steps S121-S122 as follows:
s121, obtaining each video block file according to the video file;
and S122, acquiring corresponding video frame data according to each video block file to acquire the plaintext media data.
The present embodiment is directed to reading a video file and acquiring media data contained therein. In this embodiment, the data information in the video file is read by the client to obtain each video block file. Still taking the example of the mp4 format video file as an example, the client reads the first container unit after acquiring the video file. When a track box representing an audio track or a video track is read from data contained in the first container unit, one or more corresponding audio sample blocks or video sample blocks sample may be obtained according to basic information of the audio track or the video track recorded by the track box, that is, video frame data corresponding to the first container unit is obtained, where the video frame data are plaintext media data in a video file. And the client sequentially reads down according to the video file, acquires corresponding video frame data from the second container unit, and acquires all plaintext media data in the video file until acquiring the video frame data corresponding to the last container unit.
In step S120, after the client acquires the plaintext media data from the video file, the client encrypts the plaintext media data to acquire ciphertext media data, so as to protect the plaintext media data.
In some embodiments, encrypting the plaintext media data may be implemented as steps S123-S124 as follows:
s123, obtaining a symmetric key;
and S124, encrypting the plaintext media data by using an encryption algorithm based on the symmetric key to obtain the ciphertext media data.
The present embodiment is directed to implementing encryption processing on plaintext media data. In this embodiment, the user may generate a random number string, character string, various symbols, or the like, or various combinations thereof, or the like, through encryption software on the terminal device to use as the symmetric key. Or the user can also obtain the symmetric key by using the encryption lock, and can also request the server to obtain the symmetric key. The manner of obtaining the key and the type of the key are not limited in this application. After the client side obtains the symmetric key, the plaintext media data are encrypted by adopting a preset encryption algorithm based on the symmetric key, and ciphertext media data are obtained. The encryption algorithm can be set in the client according to the needs of the user. In some specific applications, the client may be pre-configured with a plurality of encryption algorithms for the user to select when encryption is required.
In some implementations, the key used to encrypt the plaintext media data described above may also take the form of an asymmetric key. For example, the client responsible for encryption may be encrypted using a private key and the client responsible for decryption may be decrypted using a corresponding public key.
In some implementations, the keys used for different video chunk files may not be the same. That is, there may be data obtained by encrypting each corresponding video block with a plurality of keys in one encrypted video file. The realization mode is favorable for improving the safety of the video file in the encryption and decryption process, especially in the decryption and other processing processes to a certain extent.
S130, replacing the plaintext media data with the ciphertext media data to obtain an encrypted video file of the video file.
In this step, the client puts the ciphertext media data into the video file at the position of the plaintext media data, and replaces the plaintext media data with the ciphertext media data, thereby obtaining the encrypted video file. In some specific applications, when the client acquires the corresponding first video frame data from the first container unit, the client may encrypt the first video frame data by using the first symmetric key to obtain first ciphertext video frame data, which is ciphertext media data. And then the client replaces the first video frame data with the first ciphertext video frame data, puts the first ciphertext video frame data into the path where the first video frame data is located, and replaces the first video frame data in the first container unit with the first ciphertext video frame data, so that the encryption process of the first video frame data of the first container unit is realized. In turn, when the first container unit further includes the second video frame data, the client may encrypt the second video frame data by using the second symmetric key, and after obtaining the second ciphertext video frame data, use the second ciphertext video frame data for the second video frame data until the video frame data in the first container unit is completely encrypted. And then, the client sequentially reads the data of the next container unit in the video file and encrypts the video frame data in the next container unit until the video frame data in the last container unit of the video file is encrypted, so that the encrypted video file is obtained.
In some specific applications, the client uploads the encrypted video file and the symmetric key to the server for storage, and the user or other users can correspondingly obtain the encrypted video file and the symmetric key from the server when needing to play the video file. In some practical applications, the user side may set corresponding authorization information for the encrypted video file according to the authorized condition, generate a corresponding authorization file according to the authorization information, and store the authorization file and the encrypted video file in the server together. Therefore, when the server receives the acquisition request of the encrypted video file sent by the client, the server can correspondingly verify the client according to the authorization information in the authorization file, and the server can send the corresponding encrypted video file to the client after the verification is passed.
The first symmetric key and the second symmetric key used herein and other symmetric keys involved in the encryption process of each video frame data may be the same, so as to increase the decryption speed in the video encryption and video playing processes. Of course, the symmetric keys may be set to be different or partially different according to actual needs and choices of users, so as to improve the difficulty of decrypting video frame data in the video playing process, and prevent the first symmetric key from being cracked, thereby playing the entire video file.
In some embodiments, to further protect the symmetric key used in the video encryption process, the client sends an encryption request to the server and sends the symmetric key to the server. And after receiving the encryption request and the symmetric key, the server adopts a preset encryption algorithm to operate the symmetric key to obtain encryption key data, and sends the encryption key data to the client. The server correspondingly saves the encrypted record for decrypting the corresponding encrypted key file according to the decryption request of the user. And after receiving the encryption key data, the client stores the encryption key data to generate an encryption key file. The encryption algorithm may be determined according to the setting of the server or the selection of the user, which is not limited in the present application. And then, the client uploads the encrypted video file and the encrypted key file to the server together, and the encrypted video file and the encrypted key file are stored through the server.
On the other hand, an embodiment of the present application provides a video processing method, as shown in fig. 3, including the following steps S210 to 240:
s210, receiving a video playing request;
s220, acquiring an encrypted video file from a server by using a first thread according to the video playing request, and acquiring ciphertext media data according to the encrypted video file;
s230, acquiring a corresponding symmetric key from the server by using a second thread, and decrypting the ciphertext media data to obtain plaintext media data;
s240, replacing the plaintext media data with the ciphertext media data by using the first thread so as to play a video according to the video playing request.
The video processing method of the embodiment is applied to the client. The following describes in detail a processing method of the server side.
When a client receives a video playing request submitted by a user, a first thread is started, and corresponding video file identification information is determined according to the playing request. And then, the client generates a video file acquisition request according to the video file identification information and the client identification information, and sends the video file acquisition request to the server to request for acquiring the corresponding encrypted video file.
And when the server receives the video file acquisition request, acquiring the video file identification information and the corresponding client information according to the video file acquisition request. And then, determining an encrypted video file requested by the client from the database according to the video file identification information, and then sending the encrypted video file to the corresponding client according to the client identification information. In some practical applications, after determining the encrypted video file requested by the client, the server queries whether the encrypted video file is associated with an authorization file. When the authorization file exists, the server verifies the identification information of the client according to the authorization information in the application file, and the video file is sent to the client after the verification is passed. The authorization information includes at least licensor information, licensed client information, license expiration date, and the like.
After the client side obtains the encrypted video file, data in the encrypted video file are read through the first thread. And when the client reads the ciphertext media data, determining the mark information corresponding to the ciphertext media data, and sending a decryption request to the server according to the mark information corresponding to the ciphertext media data.
And after receiving the decryption request, the server determines a corresponding symmetric key according to the corresponding mark information of the ciphertext media data and returns the symmetric key to the client. In some practical applications, before the server returns the symmetric key, it is first queried whether the symmetric key has a corresponding encryption record, so as to determine whether the symmetric key is an encryption key file. And if the encryption record exists, the symmetric key is encrypted, and in this case, the server needs to decrypt the encryption key file by adopting a corresponding operation method according to the encryption record, so as to obtain the symmetric key of the plaintext required by the client.
And after the client side obtains the symmetric key, starting a second thread, and decrypting the ciphertext media data through the second thread to obtain plaintext media data. And then replacing the ciphertext video data with the plaintext media data through the first thread, and decoding and playing the plaintext media data.
On the other hand, the embodiment of the present application further provides a processing method, as shown in fig. 4, including the following steps S310 to S320:
receiving a video file acquisition request of a client, and sending a corresponding video file to the client according to the video file acquisition request so that the client can read ciphertext media data in the video file;
and receiving a decryption request of the client for the ciphertext media data, and sending the symmetric key to the client.
The embodiment is applied to the server side, and specific reference may be made to the implementation manner in the embodiment of the video file processing method when the description is performed in combination with the server side, which is not described herein again.
On the other hand, the embodiment of the present application provides a video encryption apparatus 10, as shown in fig. 5, including:
an obtaining module 101 configured to obtain a video file to be encrypted;
the encryption module 102 is configured to obtain plaintext media data according to the video file, encrypt the plaintext media data, and obtain ciphertext media data;
the processing module 103 is configured to replace the plaintext media data with the ciphertext media data to obtain an encrypted video file of the video file.
The video encryption device in the embodiment of the present application can implement the steps of the video encryption method mentioned in any embodiment of the present application through the configured functional modules thereof. Therefore, for implementation of the video processing apparatus provided in the embodiment of the present application, reference may be made to implementation of the video encryption method provided in the present application, and details are not described herein again.
On the other hand, the embodiment of the present application provides a video processing apparatus 20, as shown in fig. 6, including:
a receiving module 201 configured to receive a video playing request;
the obtaining module 202 is configured to obtain an encrypted video file from a server according to the video playing request by using a first thread, and obtain ciphertext media data according to the encrypted video file;
the decryption module 203 is configured to acquire a corresponding symmetric key from the server by using a second thread, and decrypt the ciphertext media data to obtain plaintext media data;
the playing module 204 is configured to replace the plaintext media data with the ciphertext media data by using the first thread, so as to play a video according to the video playing request.
The video encryption device in the embodiment of the present application can implement the steps of the video processing method mentioned in any embodiment of the present application through the configured functional modules thereof. Therefore, for implementation of the video processing apparatus provided in the embodiment of the present application, reference may be made to implementation of the video processing method provided in the present application, and details are not described herein again.
On the other hand, the embodiment of the present application provides an electronic device, which at least includes a memory 901, a processor 902, and a bus (not shown), where a schematic structural diagram of the electronic device may be as shown in fig. 7, the memory 901 stores machine-readable instructions executable by the processor 902, when the electronic device is running, the processor 902 and the memory 901 communicate via the bus, and the machine-readable instructions, when executed by the processor, implement the steps of the video encryption method provided in any of the above embodiments; or, implementing the steps of the video processing method as provided in any of the above embodiments; alternatively, the steps of the processing method as provided in any of the above embodiments are implemented.
When the present embodiment is applied to a terminal side, the electronic device may include, but is not limited to, a mobile phone, a tablet computer, a computer, and other terminal devices, an application program for performing an encryption operation or a processing operation on a video file is provided on the memory 901, and a user of the electronic device may implement the steps of the video encryption method provided in any embodiment of the present application, or implement the steps of the video processing method provided in any embodiment of the present application by performing an operation on the application program.
When the embodiment is applied to a server side, the electronic device may include, but is not limited to, a physical server, a cloud server, a distributed processing system, or the like, an application program for managing and distributing a video file or a key file is provided on the memory 901, and a user of the electronic device may implement the steps of the processing method provided in any embodiment of the present application through a server side through direct or indirect communication connection between a terminal and the server.
Since the electronic device described in the embodiment of the present application is an electronic device provided with a memory for implementing the video encryption method, the video processing method, or the processing method disclosed in the embodiment of the present application, based on the video encryption method, the video processing method, or the processing method described in the embodiment of the present application, those skilled in the art can understand the structure and the variation of the electronic device described in the embodiment of the present application, and thus, no further description is given here.
The embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions in the computer-readable storage medium are executed, the steps of the video encryption method provided in any of the above embodiments are implemented; or, implementing the steps of the video processing method as provided in any of the above embodiments; alternatively, the steps of the processing method as provided in any of the above embodiments are implemented.
It will be apparent to one skilled in the art that embodiments of the present application may be provided as methods, electronic devices, computer-readable storage media, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied in the medium. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
The processor may be a general purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof. A general purpose processor may be a microprocessor or any conventional processor or the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
The readable storage medium may be a magnetic disk, an optical disk, a DVD, a USB, a Read Only Memory (ROM), a Random Access Memory (RAM), etc., and the specific form of the storage medium is not limited in this application.
The above embodiments are only exemplary embodiments of the present application, and are not intended to limit the present application, and the protection scope of the present application is defined by the claims. Various modifications and equivalents may be made by those skilled in the art within the spirit and scope of the present application and such modifications and equivalents should also be considered to be within the scope of the present application.
Claims (10)
1. A method for video encryption, comprising:
acquiring a video file to be encrypted;
acquiring plaintext media data according to the video file, and encrypting the plaintext media data to obtain ciphertext media data;
and replacing the plaintext media data with the ciphertext media data to obtain an encrypted video file of the video file.
2. The method of claim 1, wherein said retrieving plaintext media data from said video file comprises:
obtaining each video block file according to the video file;
and acquiring corresponding video frame data according to each video block file to acquire the plaintext media data.
3. The method of claim 1, wherein the encrypting the plaintext media data to obtain ciphertext media data comprises:
obtaining a symmetric key;
and based on the symmetric key, encrypting the plaintext media data by using an encryption algorithm to obtain the ciphertext media data.
4. The method of claim 3, further comprising:
acquiring an encryption key file, wherein the encryption key file is generated by encrypting the symmetric key by a server;
and uploading the encrypted video file and the encrypted key file to a server for storage.
5. A video processing method, comprising:
receiving a video playing request;
acquiring an encrypted video file from a server by using a first thread according to the video playing request, and acquiring ciphertext media data according to the encrypted video file;
acquiring a corresponding symmetric key from a server by using a second thread, and decrypting the ciphertext media data to obtain plaintext media data;
and replacing the plaintext media data with the ciphertext media data by using the first thread so as to play a video according to the video playing request.
6. A method of processing, comprising:
receiving a video file acquisition request of a client, and sending a corresponding video file to the client according to the video file acquisition request so that the client can read ciphertext media data in the video file;
and receiving a decryption request of the client for the ciphertext media data, and sending the symmetric key to the client.
7. The method of claim 6, wherein when receiving a file reading request from a client, the method further comprises: and verifying the client to determine whether the client has the acquisition right.
8. A video encryption apparatus, comprising:
the acquisition module is configured to acquire a video file to be encrypted;
the encryption module is configured to acquire plaintext media data according to the video file and encrypt the plaintext media data to obtain ciphertext media data;
and the processing module is configured to replace the plaintext media data with the ciphertext media data to obtain an encrypted video file of the video file.
9. A video processing apparatus, comprising:
the receiving module is configured to receive a video playing request;
the acquisition module is configured to acquire an encrypted video file from a server by using a first thread according to the video playing request and acquire ciphertext media data according to the encrypted video file;
the decryption module is configured to acquire a corresponding symmetric key from the server by using a second thread, and decrypt the ciphertext media data to obtain plaintext media data;
and the playing module is configured to replace the plaintext media data with the ciphertext media data by using the first thread so as to play a video according to the video playing request.
10. An electronic device comprising at least a memory and a processor, the memory having a program stored thereon, characterized in that the processor, when executing the program on the memory, realizes the steps of the method according to any of claims 1-4, or claim 5, or claim 6-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111641602.1A CN114286130A (en) | 2021-12-29 | 2021-12-29 | Video encryption method, video processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111641602.1A CN114286130A (en) | 2021-12-29 | 2021-12-29 | Video encryption method, video processing method and device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114286130A true CN114286130A (en) | 2022-04-05 |
Family
ID=80878032
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111641602.1A Pending CN114286130A (en) | 2021-12-29 | 2021-12-29 | Video encryption method, video processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114286130A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117177017A (en) * | 2023-10-27 | 2023-12-05 | 成方金融科技有限公司 | Video processing method, device, equipment and medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060034677A (en) * | 2006-04-04 | 2006-04-24 | 한국정보통신대학교 산학협력단 | Method for protecting scalable video coding contents and its apparatus |
CN101258750A (en) * | 2005-07-14 | 2008-09-03 | 高通股份有限公司 | Method and apparatus for encrypting/decrypting multimedia content to allow random access |
CN108235060A (en) * | 2018-03-12 | 2018-06-29 | 上海哔哩哔哩科技有限公司 | Video-encryption playback method, system and the storage medium obscured based on parameter set |
CN110611830A (en) * | 2019-09-29 | 2019-12-24 | 腾讯科技(深圳)有限公司 | Video processing method, device, equipment and medium |
CN112104895A (en) * | 2020-11-17 | 2020-12-18 | 浙江岩华文化科技有限公司 | Video encryption and decryption method, server, set top box plug-in and video playing system |
-
2021
- 2021-12-29 CN CN202111641602.1A patent/CN114286130A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101258750A (en) * | 2005-07-14 | 2008-09-03 | 高通股份有限公司 | Method and apparatus for encrypting/decrypting multimedia content to allow random access |
KR20060034677A (en) * | 2006-04-04 | 2006-04-24 | 한국정보통신대학교 산학협력단 | Method for protecting scalable video coding contents and its apparatus |
CN108235060A (en) * | 2018-03-12 | 2018-06-29 | 上海哔哩哔哩科技有限公司 | Video-encryption playback method, system and the storage medium obscured based on parameter set |
CN110611830A (en) * | 2019-09-29 | 2019-12-24 | 腾讯科技(深圳)有限公司 | Video processing method, device, equipment and medium |
CN112104895A (en) * | 2020-11-17 | 2020-12-18 | 浙江岩华文化科技有限公司 | Video encryption and decryption method, server, set top box plug-in and video playing system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117177017A (en) * | 2023-10-27 | 2023-12-05 | 成方金融科技有限公司 | Video processing method, device, equipment and medium |
CN117177017B (en) * | 2023-10-27 | 2024-01-23 | 成方金融科技有限公司 | Video processing method, device, equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11238165B2 (en) | File encryption method, file decryption method, electronic device, and storage medium | |
KR101603136B1 (en) | Support for short cryptoperiods in template mode | |
US8225411B2 (en) | Contents management system, and contents management device | |
CN101651714B (en) | Downloading method and related system and equipment | |
US20130283051A1 (en) | Persistent License for Stored Content | |
WO2017071512A1 (en) | Cloud storage and cloud download methods for multimedia data and related devices | |
CA2623430A1 (en) | System and method for software tamper detection | |
CN101073238A (en) | Protection of digital data content | |
CN109151507B (en) | Video playing system and method | |
KR100982515B1 (en) | Apparatus and method for constraining the count of access to digital contents using a hash chain | |
CN111698576B (en) | Information encryption method, decryption method, server, client, and medium | |
JPWO2007007764A1 (en) | License management apparatus and method | |
US11698987B2 (en) | Storage drive protection using file system level encryption | |
CN103562924A (en) | Information processing device, information processing method, and program | |
CN102413380A (en) | Information processor, information processing method, and program | |
KR20140129178A (en) | Enabling delivery of protected content using unprotected delivery services | |
CN114286130A (en) | Video encryption method, video processing method and device and electronic equipment | |
CN113014956B (en) | Video playing method and device | |
CN111865891B (en) | Data transmission method, user terminal, electronic equipment and readable storage medium | |
US20110123023A1 (en) | Apparatus for video encryption by randomized block shuffling and method thereof | |
CN108769748B (en) | Information processing method and related equipment | |
EP1552420A1 (en) | Method for managing metadata | |
CN107613317A (en) | A kind of method, storage medium and intelligent television for playing local cipher media | |
JP2019071552A (en) | Encryption communication method, encryption communication system, key issuing device, and program | |
US8656499B1 (en) | Client-side bit-stripping system and method |
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 | ||
CB02 | Change of applicant information |
Address after: 100193 5th floor 510, No. 5 Building, East Yard, No. 10 Wangdong Road, Northwest Haidian District, Beijing Applicant after: Beijing Shendun Technology Co.,Ltd. Address before: 100193 5th floor 510, No. 5 Building, East Yard, No. 10 Wangdong Road, Northwest Haidian District, Beijing Applicant before: BEIJING SENSESHIELD TECHNOLOGY Co.,Ltd. |
|
CB02 | Change of applicant information | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220405 |
|
RJ01 | Rejection of invention patent application after publication |