CN108882029B - Video decryption method and device - Google Patents

Video decryption method and device Download PDF

Info

Publication number
CN108882029B
CN108882029B CN201810700092.2A CN201810700092A CN108882029B CN 108882029 B CN108882029 B CN 108882029B CN 201810700092 A CN201810700092 A CN 201810700092A CN 108882029 B CN108882029 B CN 108882029B
Authority
CN
China
Prior art keywords
image
array
frame
offset
gray
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.)
Active
Application number
CN201810700092.2A
Other languages
Chinese (zh)
Other versions
CN108882029A (en
Inventor
周大程
孟超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Galaxy Vr Technology Beiijng Co ltd
Original Assignee
Galaxy Vr Technology Beiijng 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 Galaxy Vr Technology Beiijng Co ltd filed Critical Galaxy Vr Technology Beiijng Co ltd
Priority to CN201810700092.2A priority Critical patent/CN108882029B/en
Publication of CN108882029A publication Critical patent/CN108882029A/en
Application granted granted Critical
Publication of CN108882029B publication Critical patent/CN108882029B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4405Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving video stream decryption

Abstract

The invention discloses a video decryption method and device, and relates to the technical field of computers. One embodiment of the method comprises: receiving a video file, and extracting an image of each frame; acquiring an image at the upper layer in each frame image to convert the upper layer image into a gray array; each frame of image is divided into an upper layer of image and a lower layer of image, namely, the upper layer of image covers the lower layer of image; decrypting the gray level array corresponding to each frame of image to obtain an offset array of each frame of image according to the decrypted gray level array; and moving the image at the lower layer in each frame image according to the offset array of each frame image so as to generate a new video file through the moved lower layer image of each frame. The embodiment can solve the technical problem that no decryption is performed on the VR video in the prior art.

Description

Video decryption method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a video decryption method and apparatus.
Background
At present, more and more people watch VR video, experience the effect of watching that VR video brought. Therefore, the production, distribution and popularization of the VR video are greatly promoted. The VR video refers to a video actually recorded in a field environment by people using a professional VR photography function.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: at present, except for an encryption and decryption scheme of a common video, no special encryption and decryption technology for a VR video exists.
Disclosure of Invention
In view of this, embodiments of the present invention provide a video decryption method and apparatus, which can solve the technical problem in the prior art that no VR video is decrypted.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a video decryption method, including receiving a video file, extracting an image of each frame therein; acquiring an image at the upper layer in each frame image to convert the upper layer image into a gray array; each frame of image is divided into an upper layer of image and a lower layer of image, namely, the upper layer of image covers the lower layer of image; decrypting the gray level array corresponding to each frame of image to obtain an offset array of each frame of image according to the decrypted gray level array; and moving the image at the lower layer in each frame image according to the offset array of each frame image so as to generate a new video file through the moved lower layer image of each frame.
Optionally, the image at the upper layer in each frame of image is a rectangular image, and the rectangular image at the upper layer in each frame of image is overlaid on the upper left portion of the image at the lower layer.
Optionally, acquiring an image at an upper layer in each frame of image to convert the upper layer image into a gray array, including:
the rectangular image is n x 1 in size, and the storage as a gray array is n array values, which correspond to the gray values along the length of the rectangular image.
Optionally, decrypting the gray level array corresponding to each frame of image includes:
extracting a first array value of the gray array;
decrypting the second array value to the last array value in the gray array according to the first array value;
and generating a decrypted gray array by decrypting the obtained array value.
Optionally, obtaining the offset array of each frame of image according to the decrypted gray array includes:
representing each array value in the decrypted gray array as a percentage b of an offset and the whole width of the image after the offset;
and calculating the corresponding offset according to the percentage b between the offset and the whole width of the image after offset, namely [ (the offset is half of the maximum offset)/half of the maximum offset ]. the constant, and finally obtaining the offset array corresponding to the decrypted gray array.
In addition, according to an aspect of the embodiments of the present invention, there is provided a video decryption apparatus, including an obtaining module, configured to receive a video file, and extract an image of each frame therein; acquiring an image at the upper layer in each frame image to convert the upper layer image into a gray array; each frame of image is divided into an upper layer of image and a lower layer of image, namely, the upper layer of image covers the lower layer of image; the decryption module is used for decrypting the gray level array corresponding to each frame of image so as to obtain the offset array of each frame of image according to the decrypted gray level array; and the forming module is used for moving the image at the lower layer in each frame of image according to the offset array of each frame of image so as to generate a new video file through the moved lower layer image of each frame.
Optionally, the image at the upper layer in each frame of image is a rectangular image, and the rectangular image at the upper layer in each frame of image is overlaid on the upper left portion of the image at the lower layer.
Optionally, the acquiring module acquires an image at an upper layer in each frame of image to convert the upper layer image into a gray array, including:
the rectangular image is n x 1 in size, and the storage as a gray array is n array values, which correspond to the gray values along the length of the rectangular image.
Optionally, the decrypting module decrypts the gray array corresponding to each frame of image, including:
extracting a first array value of the gray array;
decrypting the second array value to the last array value in the gray array according to the first array value;
and generating a decrypted gray array by decrypting the obtained array value.
Optionally, the forming module obtains the offset array of each frame of image according to the decrypted gray array, and includes:
representing each array value in the decrypted gray array as a percentage b of an offset and the whole width of the image after the offset;
and calculating the corresponding offset according to the percentage b between the offset and the whole width of the image after offset, namely [ (the offset is half of the maximum offset)/half of the maximum offset ]. the constant, and finally obtaining the offset array corresponding to the decrypted gray array.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any of the video decryption embodiments described above.
According to another aspect of the embodiments of the present invention, there is also provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method of any of the above-described video decryption embodiments.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a video encryption method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a main flow of a video encryption method according to a referential embodiment of the present invention;
fig. 3 is a schematic diagram of main blocks of a video encryption apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a main flow of a video decryption method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a main flow of a video decryption method according to a referential embodiment of the present invention;
fig. 6 is a schematic diagram of main blocks of a video decryption apparatus according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 8 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a method of video encryption according to an embodiment of the present invention, and as shown in fig. 1, the method of video encryption includes:
step S101, receiving a video file, extracting an image of one frame, and dividing the image to move a boundary to obtain an offset array and an offset image.
Wherein the shifted image is an image finally obtained after being subjected to at least two segmentations and shifts.
And S102, acquiring a corresponding gray array according to the offset array so as to encrypt the gray data.
Preferably, at least two random numbers are obtained by the random number generator and added to the preset preliminary key set. And then, selecting one prepared key from the prepared key set as a formal key, and encrypting the gray array through the formal key. Further, at least two random numbers are obtained by using the random number generator for multiple times and added into a preset prepared key set so as to update the prepared key set.
Preferably, each provisioning key is ordered in a set of provisioning keys, each provisioning key having its corresponding sequence number.
Further, when the gray data is encrypted, a serial number of a spare key serving as a main key may be acquired, and the serial number of the main key may be set at the forefront of the encrypted gray array.
Furthermore, at a preset time, the serial numbers corresponding to the spare keys in the spare key set are updated.
And step S103, converting the encrypted gray array into an image and covering the image on the shifted image to generate a new image.
And step S104, when all frames of the video file have corresponding new images, generating a new video file.
Fig. 2 is a video encryption method according to a referential embodiment of the present invention, and as shown in fig. 2, the video encryption method may include:
step S201, receiving a video file, extracting an image of one frame, dividing the image into two blocks, moving a boundary of the division, and recording an offset.
Step S202, repeat step S201 until obtaining the offset array [ a1, a2, a3. ], and save the offset image.
In an embodiment, an offset array [ a1, a2, a3. ], wherein if a1<0, it indicates a left shift or indicates an upward shift; if a1>0, this indicates a rightward movement or a downward movement.
It should be noted that, before encrypting and decrypting the video file, the moving direction sequence, that is, the moving direction in the offset array, is set in advance. For example: the order of presetting the moving direction is as follows: left, right, up, down, left, right … ….
It should be noted that, before encrypting and decrypting the video file, a sequential splitting manner is preset, for example: the preset sequential segmentation mode is as follows: a middle longitudinal split, a right middle longitudinal split, a left middle longitudinal split, and a leftmost middle transverse split … ….
Preferably, a division number may be set, for example, 15 times, so as to obtain an array including 15 numbers.
Preferably, for storage convenience, the value of each datum in the offset array is between 0 and 62.
Step S203, obtaining a corresponding gray array according to the offset array.
As an example, the percentage b of the shift amount to the entire width of the shifted image after each shift needs to be calculated and saved. The specific calculation can then be given by the following formula:
the percentage of the offset to the entire width of the shifted image ═ constant [ (offset-half of maximum offset)/half of maximum offset ] } constant
Wherein, the constant can be 20%.
For example: each data value in the offset array is between 0 and 62, then the offset is 20% of the total width of the image after the offset, b, [ (a-31)/31], where 0 represents a shift of-20% (left or up shift), 31 represents no change, and 62 represents a shift of 20% (right or down shift).
Further, each movement can be represented by a pixel whose gray scale represents the percentage b of the movement. For example: the percentage b is between 0 and 62, and the gray value of one pixel point can be represented as a number between 0 and 62, so that the percentage b of the offset and the whole width of the offset image can be represented by one pixel point.
Preferably, the gray data can be represented by 64-level gray or 256-level gray according to different formats of video.
Step S204, at least two random numbers are obtained by the random number generator and added into a preset preparation key set.
For example: 64 random numbers may be generated.
In step S205, one spare key is selected as a formal key in the spare key set, and a serial number of the spare key is obtained.
Wherein each provisioning key is ordered in the set of provisioning keys, i.e., each provisioning key has its corresponding sequence number.
And S206, encrypting the gray array through the formal key.
For example, an AES encryption algorithm is employed. The AES Encryption algorithm is Advanced Encryption Standard (AES) in cryptography, also called Rijndael Encryption method, and is a block Encryption Standard adopted by the federal government in the united states. Of course, it is also possible to use, for example, the DES algorithm, the asymmetric algorithm RSA, etc.
Step S207, the serial number of the formal key is set at the forefront of the encrypted gray array, and then stored as a rectangular image.
For example, the following steps are carried out: the serial number of the formal key is 20 (20 th), if the gray scale of the point in the set rectangular image has 64 levels, the gray scale of the 1 st point is 20 (serial number), the gray scale of the 2 nd point is the first gray scale data of the encrypted gray scale array, and so on, the rectangular image size is 16x 1.
Step S208, overlay the rectangular image to the upper left part of the shifted image to generate a new image.
As an example, the first row of pixels at the upper end of the rectangular image may be overlaid with the first row of pixels at the upper end of the shifted image, and the first pixel at the first row at the upper end of the rectangular image may be overlaid with the first pixel at the first row at the upper end of the shifted image. For example: the rectangular image size is: 30 x 1, then the first 30 pixels of the first row at the top of the shifted image are covered.
Step S209 determines whether all frames of the video file have been encrypted, if so, step S210 is performed, otherwise, step S201 is returned to.
Step S210, generating a new video file according to a new image corresponding to each frame and publishing the new video file.
In an embodiment, the image proportion of each frame of the new video is distorted, which can seriously affect the viewing experience, especially when the VR video is viewed, so that the VR video is well encrypted. It should be noted that the video encryption method of the present invention can also be applied to commonly used videos.
As another example, step S204 and step S205 may be performed multiple times to update the provisioning keys in the provisioning key set. Furthermore, the serial numbers corresponding to the spare keys in the spare key set can be updated, for example, the keys are replaced every 3 seconds, so that the situation that the key is easy to crack when a single key is used is prevented.
Fig. 3 is a video encryption apparatus according to an embodiment of the present invention, and as shown in fig. 3, the video encryption apparatus 300 includes a segmentation module 301, an encryption module 302, and a generation module 303. The segmentation module 301 receives a video file, extracts an image of one frame, and segments the image to move a boundary, thereby obtaining an offset array and an offset image. The encryption module 302 obtains a corresponding gray array according to the offset array to encrypt the gray data; and converting the encrypted gray array into an image to be covered on the shifted image so as to generate a new image. The generating module 303 generates a new video file when all frames of the video file have corresponding new images.
It should be noted that, in the implementation of the video encryption apparatus of the present invention, details have been described in the above video encryption method, and therefore, the repeated description is not repeated here.
Fig. 4 is a method of video decryption according to an embodiment of the present invention, as shown in fig. 4, the method of video decryption includes:
step S401, receiving a video file, and extracting an image of each frame.
In step S402, an image at the upper layer in each frame image is obtained to convert the upper layer image into a gray array.
And each frame of image is divided into an upper layer image and a lower layer image, namely, the upper layer image is covered on the lower layer image.
Step S403, decrypting the gray array corresponding to each frame of image, so as to obtain the offset array of each frame of image according to the decrypted gray array.
In step S404, the image in the lower layer in each frame of image is moved according to the offset array of each frame of image, so as to generate a new video file through the moved lower layer image of each frame.
Fig. 5 is a video decryption method according to a referential embodiment of the present invention, and as shown in fig. 5, the video decryption method may include:
step S501, receiving a video file, and extracting an image of one frame.
In step S502, a rectangular image at an upper layer in the frame image is acquired.
Preferably, the rectangular image at the upper layer in the frame image is overlaid on the upper left portion of the image at the lower layer.
Step S503, storing the rectangular image as a gray array, and extracting a first array value of the gray array.
As an example, if the size of the rectangular image is n × 1, then the storage as a gray array is n array values, and the n array values correspond to gray values in the length direction of the rectangular image, so that the rectangular image can be converted into a gray array.
Step S504, according to the first array value, the second array value to the last array value in the gray array are decrypted.
Preferably, the first array value is used as a key for decryption by the same algorithm as used for encryption. For example, if the AES algorithm is used for encryption, the AES algorithm is used for decryption. Of course, it is also possible to use, for example, the DES algorithm, the asymmetric algorithm RSA, etc.
Step S505, a decrypted gray array is generated by decrypting the obtained array value.
It can be seen that the decrypted gray array has one array value less than the gray array before decryption, i.e. the first array value in the gray array before decryption is less.
Step S506, a corresponding offset array is obtained according to the decrypted gray array.
In an embodiment, each shift during encryption can be represented by a pixel, and the gray scale of the pixel represents the offset of the shift as a percentage b of the entire width of the shifted image. Therefore, each array value in the decrypted gray array can be directly expressed as a percentage b of an offset to the entire width of the image after the offset when decrypting.
Further, according to the percentage b between the offset and the whole width of the image after offset, which is [ (offset-half of the maximum offset)/half of the maximum offset ]. times constant, the corresponding offset is calculated, and finally, the offset array corresponding to the decrypted gray-scale array is obtained.
Wherein, the constant can be 20%. And the maximum offset is determined when encryption is performed.
In step S507, the image in the lower layer in the frame image is moved according to the offset array.
In an embodiment, an offset array [ a1, a2, a3. ], wherein if a1<0, it indicates a left shift or indicates an upward shift; if a1>0, this indicates a rightward movement or a downward movement.
It should be noted that, before encrypting and decrypting the video file, the moving direction sequence, that is, the moving direction in the offset array, is set in advance. For example: the order of presetting the moving direction is as follows: left, right, up, down, left, right … ….
It should be noted that, before encrypting and decrypting the video file, a sequential splitting manner is preset, for example: the preset sequential segmentation mode is as follows: a middle longitudinal split, a right middle longitudinal split, a left middle longitudinal split, and a leftmost middle transverse split … ….
Step S508, determining whether all frames of the video file have been decrypted, if yes, performing step S509, otherwise returning to step S501.
In step S509, a new video file is generated and distributed based on the moved lower layer image of each frame.
Fig. 6 is a video decryption apparatus according to an embodiment of the present invention, and as shown in fig. 6, the video encryption apparatus 600 includes an obtaining module 601, a decryption module 602, and a forming module 603. The obtaining module 601 may receive a video file, extract an image of each frame, and obtain an image at an upper layer in each frame of image, so as to convert the upper layer image into a gray array; and each frame of image is divided into an upper layer image and a lower layer image, namely, the upper layer image is covered on the lower layer image. Then, the decryption module 602 decrypts the gray array corresponding to each frame of image, so as to obtain the offset array of each frame of image according to the decrypted gray array. Finally, the forming module 603 moves the image in the lower layer of each frame of image according to the offset array of each frame of image, so as to generate a new video file through the moved lower layer image of each frame.
It should be noted that, in the implementation of the video decryption apparatus of the present invention, details have been described in the above video decryption method, and therefore, the repeated details are not described herein.
Fig. 7 illustrates an exemplary system architecture 700 to which the video encryption method or video encryption apparatus of embodiments of the present invention may be applied. Or fig. 7 shows an exemplary system architecture 700 to which the video decryption method or video decryption apparatus of the embodiments of the invention may be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 serves to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. The terminal devices 701, 702, 703 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 701, 702, 703. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the video encryption method provided by the embodiment of the present invention is generally executed by the server 705, and accordingly, the video encryption apparatus is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data necessary for the operation of the system 800 are also stored. The CPU801, ROM 802, and RAM803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
To the I/O interface 805, AN input section 806 including a keyboard, a mouse, and the like, AN output section 807 including a network interface card such as a Cathode Ray Tube (CRT), a liquid crystal display (L CD), and the like, a speaker, and the like, a storage section 808 including a hard disk, and the like, and a communication section 809 including a network interface card such as a L AN card, a modem, and the like are connected, the communication section 809 performs communication processing via a network such as the internet, a drive 810 is also connected to the I/O interface 805 as necessary, a removable medium 811 such as a magnetic disk, AN optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted into the storage section 808 as.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. 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 or flowchart illustration, and combinations of blocks in the block diagrams 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.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a partitioning module, an encryption module, and a generation module. Can be described as: a processor includes an acquisition module, a decryption module, and a formation module. Wherein the names of the modules do not in some cases constitute a limitation of the module itself.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: receiving a video file, extracting an image of one frame of the video file, and dividing the image to move a boundary to obtain an offset array and an offset image; acquiring a corresponding gray level array according to the offset array so as to encrypt the gray level data; converting the encrypted gray array into an image to be covered on the shifted image so as to generate a new image; and when all frames of the video file have corresponding new images, generating a new video file.
Alternatively, it comprises: receiving a video file, and extracting an image of each frame; acquiring an image at the upper layer in each frame image to convert the upper layer image into a gray array; each frame of image is divided into an upper layer of image and a lower layer of image, namely, the upper layer of image covers the lower layer of image; decrypting the gray level array corresponding to each frame of image to obtain an offset array of each frame of image according to the decrypted gray level array; and moving the image at the lower layer in each frame image according to the offset array of each frame image so as to generate a new video file through the moved lower layer image of each frame.
According to the technical scheme of the embodiment of the invention, the technical problem that no VR video is encrypted or decrypted in the prior art can be solved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. A video decryption method, comprising:
receiving a video file, and extracting an image of each frame;
acquiring an image at the upper layer in each frame image to convert the upper layer image into a gray array; each frame of image is divided into an upper layer of image and a lower layer of image, namely, the upper layer of image covers the lower layer of image;
decrypting the gray level array corresponding to each frame of image to obtain an offset array of each frame of image according to the decrypted gray level array;
moving the image at the lower layer in each frame image according to the offset array of each frame image so as to generate a new video file through the moved lower layer image of each frame;
obtaining an offset array of each frame image according to the decrypted gray array, including:
representing each array value in the decrypted gray array as a percentage b of an offset and the whole width of the image after the offset;
and calculating the corresponding offset according to the percentage b between the offset and the whole width of the image after offset, namely [ (the offset is half of the maximum offset)/half of the maximum offset ]. the constant, and finally obtaining the offset array corresponding to the decrypted gray array.
2. The method according to claim 1, wherein the image at the upper layer in each frame image is a rectangular image, and the rectangular image at the upper layer in each frame image overlaps an upper left portion of the image at the lower layer.
3. The method of claim 2, wherein acquiring the image at the upper layer in each frame image to convert the upper layer image into a gray array comprises:
the rectangular image is n x 1 in size, and the storage as a gray array is n array values, which correspond to the gray values along the length of the rectangular image.
4. The method of claim 1, wherein decrypting the gray-scale array corresponding to each frame of image comprises:
extracting a first array value of the gray array;
decrypting the second array value to the last array value in the gray array according to the first array value;
and generating a decrypted gray array by decrypting the obtained array value.
5. A video decryption apparatus, comprising:
the acquisition module is used for receiving the video file and extracting the image of each frame; acquiring an image at the upper layer in each frame image to convert the upper layer image into a gray array; each frame of image is divided into an upper layer of image and a lower layer of image, namely, the upper layer of image covers the lower layer of image;
the decryption module is used for decrypting the gray level array corresponding to each frame of image so as to obtain the offset array of each frame of image according to the decrypted gray level array; obtaining an offset array of each frame image according to the decrypted gray array, including: representing each array value in the decrypted gray array as a percentage b of an offset and the whole width of the image after the offset; calculating corresponding offset according to the percentage b of the offset to the whole width of the image after offset, namely [ (the offset is half of the maximum offset)/half of the maximum offset ]. the constant, and finally obtaining an offset array corresponding to the decrypted gray array;
and the forming module is used for moving the image at the lower layer in each frame of image according to the offset array of each frame of image so as to generate a new video file through the moved lower layer image of each frame.
6. The apparatus according to claim 5, wherein the image at the upper layer in each frame image is a rectangular image, and the rectangular image at the upper layer in each frame image is overlaid on the upper left portion of the image at the lower layer.
7. The apparatus of claim 6, wherein the obtaining module obtains an image at an upper layer in each frame of image to convert the upper layer image into a gray array, and comprises:
the rectangular image is n x 1 in size, and the storage as a gray array is n array values, which correspond to the gray values along the length of the rectangular image.
8. The apparatus of claim 5, wherein the decryption module decrypts the gray-scale array corresponding to each frame of image, comprising:
extracting a first array value of the gray array;
decrypting the second array value to the last array value in the gray array according to the first array value;
and generating a decrypted gray array by decrypting the obtained array value.
CN201810700092.2A 2018-06-29 2018-06-29 Video decryption method and device Active CN108882029B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810700092.2A CN108882029B (en) 2018-06-29 2018-06-29 Video decryption method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810700092.2A CN108882029B (en) 2018-06-29 2018-06-29 Video decryption method and device

Publications (2)

Publication Number Publication Date
CN108882029A CN108882029A (en) 2018-11-23
CN108882029B true CN108882029B (en) 2020-07-31

Family

ID=64297264

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810700092.2A Active CN108882029B (en) 2018-06-29 2018-06-29 Video decryption method and device

Country Status (1)

Country Link
CN (1) CN108882029B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109660866A (en) * 2018-12-28 2019-04-19 杭州当虹科技股份有限公司 A kind of decryption of video method based on H5

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077498A (en) * 2013-01-04 2013-05-01 东北林业大学 Image encryption algorithm based on shift transformation
CN104077739A (en) * 2014-07-03 2014-10-01 苏州大学应用技术学院 Color image quick encryption method
CN104537600A (en) * 2014-12-16 2015-04-22 陕西科技大学 Secondary image encrypting and decrypting methods and watermark information tamper area positioning method
CN105208404A (en) * 2015-08-26 2015-12-30 北京新东方迅程网络科技有限公司 Video encryption and decryption method and device
CN105243635A (en) * 2015-08-21 2016-01-13 南昌大学 Image encryption method based on two-dimensional compression perception and chaotic system
CN105830134A (en) * 2013-12-16 2016-08-03 来特荣国际有限公司 Method and device for compressing and expanding image intended for encrypted communication, program, and storage medium
CN106341638A (en) * 2016-07-01 2017-01-18 四川秘无痕信息安全技术有限责任公司 Method for adding watermarks to video for Android equipment production
CN108173640A (en) * 2017-12-11 2018-06-15 上海高顿教育培训有限公司 The character string symmetric cryptography and decryption method of a kind of high security

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7894626B2 (en) * 2007-08-31 2011-02-22 Xerox Corporation System and method for the generation of multiple angle correlation-based digital watermarks

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077498A (en) * 2013-01-04 2013-05-01 东北林业大学 Image encryption algorithm based on shift transformation
CN105830134A (en) * 2013-12-16 2016-08-03 来特荣国际有限公司 Method and device for compressing and expanding image intended for encrypted communication, program, and storage medium
CN104077739A (en) * 2014-07-03 2014-10-01 苏州大学应用技术学院 Color image quick encryption method
CN104537600A (en) * 2014-12-16 2015-04-22 陕西科技大学 Secondary image encrypting and decrypting methods and watermark information tamper area positioning method
CN105243635A (en) * 2015-08-21 2016-01-13 南昌大学 Image encryption method based on two-dimensional compression perception and chaotic system
CN105208404A (en) * 2015-08-26 2015-12-30 北京新东方迅程网络科技有限公司 Video encryption and decryption method and device
CN106341638A (en) * 2016-07-01 2017-01-18 四川秘无痕信息安全技术有限责任公司 Method for adding watermarks to video for Android equipment production
CN108173640A (en) * 2017-12-11 2018-06-15 上海高顿教育培训有限公司 The character string symmetric cryptography and decryption method of a kind of high security

Also Published As

Publication number Publication date
CN108882029A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
US8345876B1 (en) Encryption/decryption system and method
CN109905227B (en) System and method for multi-value packing scheme for homomorphic encryption
US20200028826A1 (en) Method for Encrypting an Image, Method for Transmitting an Image, Electronic Device and Computer Readable Storage Medium
CN110516462B (en) Method and apparatus for encrypting data
CN108777685B (en) Method and apparatus for processing information
CN111815738B (en) Method and device for constructing map
CN111191255B (en) Information encryption processing method, server, terminal, device and storage medium
CN107844488B (en) Data query method and device
WO2014099521A1 (en) Providing content items for non-standard content item slots
CN110958317A (en) Data processing method and equipment
KR101437843B1 (en) Font processing method for maintaining document layout, and computer-readable recording medium with font processing program for the same
CN108882029B (en) Video decryption method and device
CN113656713B (en) Network resource processing method, device and system
CN114881247A (en) Longitudinal federal feature derivation method, device and medium based on privacy computation
CN108881953B (en) Video encryption method and device
CN110288523B (en) Image generation method and device
CN111161072A (en) Block chain-based random number generation method, equipment and storage medium
CN110765238A (en) Data encryption query method and device
CN112256254A (en) Method and device for generating layout code
CN115209215A (en) Video processing method, device and equipment
CN116010678B (en) Method, device and equipment for inquiring trace
CN115982109B (en) Data synchronization method, device, electronic equipment and computer readable medium
CN112242978A (en) Method and device for processing data
CN110619218B (en) Method and apparatus for generating information
CN116128415B (en) Power equipment information sending method and device, electronic equipment and computer medium

Legal Events

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