CN113179404B - Image encryption method based on motion vector - Google Patents

Image encryption method based on motion vector Download PDF

Info

Publication number
CN113179404B
CN113179404B CN202110466485.3A CN202110466485A CN113179404B CN 113179404 B CN113179404 B CN 113179404B CN 202110466485 A CN202110466485 A CN 202110466485A CN 113179404 B CN113179404 B CN 113179404B
Authority
CN
China
Prior art keywords
video
image
matrix
elliptic curve
encryption
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
CN202110466485.3A
Other languages
Chinese (zh)
Other versions
CN113179404A (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.)
Nanjing University of Posts and Telecommunications
Original Assignee
Nanjing University of Posts and Telecommunications
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 Nanjing University of Posts and Telecommunications filed Critical Nanjing University of Posts and Telecommunications
Priority to CN202110466485.3A priority Critical patent/CN113179404B/en
Publication of CN113179404A publication Critical patent/CN113179404A/en
Application granted granted Critical
Publication of CN113179404B publication Critical patent/CN113179404B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3066Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy involving algebraic varieties, e.g. elliptic or hyper-elliptic curves
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Abstract

A image encryption method based on motion vector, based on DCT transform and quantization, carries on the point-by-point encryption to the residual error matrix of the video compression coding process and the quantization value of the residual error value of the motion vector as the plaintext, in order to eliminate the time relativity and space relativity of the plaintext; based on an elliptic curve encryption algorithm, an elliptic curve encryption formula is optimized, quantized values of an image residual error matrix and a motion vector are mapped to an elliptic curve and encrypted, image information is effectively hidden, the key burden is reduced while the security is ensured, strong encryption advantages are achieved in equipment with limited resources, and the safe transmission of images among the equipment is realized; an embedded DM8127 video processing system is used as a computing platform, so that stable acquisition of high-definition images, effective and rapid image computation, specific application of an elliptic curve encryption algorithm and image display of an IE browser are realized. The invention can realize the safe transmission between two devices and is also suitable for a large-scale safe transmission system with multiple devices.

Description

Image encryption method based on motion vector
Technical Field
The invention belongs to the technical field of digital encryption and embedded systems, and particularly relates to an image encryption method based on a motion vector.
Background
The current encryption technology is mainly divided into two main categories, namely symmetric encryption technology and asymmetric encryption technology. The symmetric encryption technology has a fast encryption speed, but has the disadvantage that the key is large and inconvenient for key management, which not only affects the performance of the device, but also causes the security of the algorithm to be reduced. As for the asymmetric encryption technology, the method has superior performance in the aspect of key management, makes up for the defects of the symmetric encryption technology, and is suitable for protecting the public network security of multiple users. The elliptic curve encryption algorithm (ECC) is an asymmetric encryption method based on an elliptic curve algebraic structure in a finite field, and compared with a non-ECC method, the elliptic curve encryption algorithm can require smaller keys under equivalent security performance, and the computation complexity and the time overhead required by message encryption are smaller. When data needs to be shared in a public network, the equipment with limited resources can utilize the strong encryption advantage of an elliptic curve encryption algorithm, and on the premise of not losing safety, less computing resources are used, so that the data is encrypted at a higher encryption speed, and the real-time transmission of the data is facilitated. This means that elliptic curve cryptography plays an important role in protecting communication environments such as the industrial internet and Wireless Sensor Networks (WSNs). In the correlation research based on the elliptic curve encryption algorithm, the problems of large network load, network performance deterioration and the like caused by huge encryption operation tasks of real-time video transmission are not considered, and on the contrary, the quantized values of the residual error matrix and the motion vector residual error value in the video compression encoding process are used as the plaintext to be encrypted point by point on the basis of DCT (discrete cosine transformation) and quantization, so that the time correlation and the space correlation of the plaintext are eliminated, the plaintext information is better hidden, the encryption operation amount is reduced, the transmission rate between devices is improved, and the device performance is improved.
The heterogeneous multi-core chip DM8127 of the TI is a DM81XX series DaVinci chip with lower power consumption, the core of the chip comprises ARM Cortex-A8 with the main frequency processing capability reaching 1GHz, and C64xDSP which adopts fixed-floating point operation to support various algorithms integrates an ISS image subsystem, an HD-VPSS high-definition Video processing subsystem and VPSS-M3 and Video-M3 which are used for achieving the functions of image acquisition, preprocessing display, coding and decoding and the like. Aiming at the practical application of video monitoring, the DM8127 chip provides an image imaging system, integrates 3D noise reduction, wide dynamic range and strong light inhibition processing technologies, and realizes image signal processing technologies such as face detection, video stabilization, zoom distortion correction and the like. Therefore, the DM 8127-based video analysis platform can realize 1080P and 60 frames/second real-time video output, is favorable for subsequent image processing, and extracts valuable information so as to develop intelligent application to realize high-definition intelligent management. In addition, the DM8127 chip provides rich peripheral interfaces, a rich image processing algorithm library is built in, and a user can rapidly develop a new intelligent video analysis product according to requirements by using a development tool and a software development kit provided by a TI company. In summary, the DM8127 chip, which combines the flexible operability of the ARM, the powerful calculation performance of the DSP, the hardware encoding and decoding functions, etc., is not only suitable for the relevant application scenarios of video monitoring, but also can implement a series of image processing algorithms and develop intelligent functions by virtue of the operation performance of the DSP core.
Disclosure of Invention
The invention aims to provide an image encryption method based on a motion vector in order to overcome the defects of too complex encryption algorithm and difficult key management by taking the image security problem as a basic starting point. The method takes a DM8127 chip with the advantages of high-resolution video output, rich image processing algorithm library, multi-core communication, superior DSP computing performance and the like as a computing platform, based on DCT (discrete cosine transformation) transformation and quantization, utilizes an elliptic curve encryption algorithm with strong encryption performance and small key to encrypt quantized values of a residual matrix and a motion vector residual value in a video compression coding process point by point, eliminates time correlation and space correlation of plaintext, and effectively hides plaintext information so as to realize the safe transmission of image data between a DM8127 video processing system and a PC (personal computer).
An image encryption method based on motion vectors, a DM8127 video processing system is used as a sending end, a PC is used as a receiving end, the encryption process is based on DCT transformation and quantization, and an elliptic curve encryption and decryption algorithm is used as an encryption and decryption method;
based on DCT transformation and quantization, the DM8127 video processing system calculates a residual matrix of a video compression coding process and a residual value of a motion vector, and quantizes the residual value to be used as a plaintext for encryption;
based on an elliptic curve encryption and decryption algorithm, a receiving end PC shares a public key PU to a sending end DM8127 video processing system, and the DM8127 video processing system utilizes the public key PU to map a plaintext onto an elliptic curve and encrypt the plaintext; and finally, the ciphertext is transmitted through the network, the PC receives the ciphertext, decrypts the ciphertext by using the private key PR, displays the video image and realizes the safe transmission of the image between the DM8127 video processing system and the PC.
Further, the DM8127 video processing system includes the following modules: the device comprises a Video acquisition module, a compression coding module and an elliptic curve encryption module, wherein a Cortex-ARM core runs a Linux system to call the running of a VPSS-M3 core, a Video-M3 core and a DSP core and control the realization of the functions of all the modules, wherein in the Video acquisition module, the VPSS-M3 core runs a BIOS operating system to realize the acquisition and the preprocessing of Video images; in the image compression coding module, a Video-M3 core runs a BIOS operating system to receive the preprocessed image data and performs compression coding; in the elliptic curve encryption module, a DSP core runs a BIOS operating system to be responsible for scheduling and specifically executing an encryption algorithm so as to realize plaintext encryption; and finally, the Cortex-ARM core receives the compressed data stream of the Video-M3 core to realize the network transmission of the data stream.
Furthermore, in the video acquisition module, the DM8127 video processing system uses a CMOS image sensor as a video input device; VPSS-M3 receives a starting instruction of a Cortex-ARM core, configures a transmission data format for a COMS image sensor, calls the CMOS image sensor through a CameraLink interface to carry out real-time video acquisition on site, synchronously transmits 1080p video data streams in a YUV format to VPSS-M3 by using a CameraLink protocol, and carries out subsequent inter-core data processing.
Further, in the image compression encoding module, a Video-M3 core initializes parameters, receives a Video stream from a VPSS-M3 core, stores an input Video in a buffer of an h.264 encoder, and the h.264 encoder divides an input image into macroblocks and calculates pixel values of the macroblocks.
Further, in the image compression encoding module, after the h.264 encoder divides the input image into macroblocks and calculates pixel values of the macroblocks, the following operations are performed:
step 1, predicting a difference value;
predicting a current block to be coded according to a coded block according to the time correlation or the space correlation of adjacent blocks, and then coding according to the difference between a predicted value and a true value; the method comprises the steps that by utilizing the spatial correlation of adjacent intra-frame macro blocks, prediction estimation is carried out on a frame to be coded in an intra-frame prediction mode, and an intra-frame coded frame I is generated; using the time correlation of the adjacent macro blocks between frames, adopting an inter-frame prediction mode to carry out motion estimation and motion compensation, and generating a corresponding inter-frame coding frame P, B frame; wherein for an I frame, an original frame pixel matrix is represented by Io, ip represents a linear prediction frame pixel matrix, ir represents a residual matrix, and Ir = Io-Ip; for the P, B frame, estimating a motion vector prediction value mvp according to a motion vector mv, and calculating a motion vector residual value mvd = mv-mvp;
step 2, DCT transformation and quantization;
performing integer DCT (discrete cosine transformation) and quantization on the residual matrix Ir and the motion vector residual value mvd to obtain a plaintext matrix I; the integer DCT transformation formula is as follows: f c =C*f*C T F is an N-N matrix, and the element of the u row and the x column of the transformation matrix C is represented as:
Figure BDA0003044224750000051
the quantization formula is:
Figure BDA0003044224750000052
step 3, entropy coding CABAC;
DSP core will dense text set C M { C1, C2, C3} is transmitted to a Video-M3 core for entropy coding CABAC to realize lossless data compression; firstly, taking a binary value for an input element; secondly, selecting a probability model, namely context modeling, for the element to be coded according to the coded element by utilizing the context information of each syntactic element, including a probability information state and a maximum probability symbol MPS; and finally, carrying out probability estimation in a self-adaptive mode according to the current statistical characteristics and carrying out arithmetic coding.
Further, the elliptic curve encryption module completes a plaintext encryption step of the image compression encoding module, encrypts a quantized non-zero value of an output plaintext matrix, and comprises the following steps:
step a, initializing parameters, and aligning an elliptic curve E p (a, b), initializing random integers p, a, b according to the value range of the image pixel to realize the plaintext I to the elliptic curve E p Mapping of (a, b); the value range of p is [257,301]A, b must satisfy 4a 3 +27b 2 ≠0&&a,b∈Z p =[0,p-1]Take a = floor (p/5), b = p-1, elliptic curve equation y 2 =(x 3 + ax + b) mod p repairIs positive for y 2 =[x 3 +floor(p/5)x+(p-1)]modp。
B, mapping the plaintext matrix, correcting the plaintext matrix I, and continuously adjusting F to the quantized non-zero value of the plaintext matrix I ij To achieve a clear text in an elliptic curve E p Mapping in the step (a, b) to obtain a mapping matrix X, F, and hiding image information to a certain extent;
first, let P (x) ij ,y ij ) For a point on the elliptic curve, x is required to be satisfied ij ,y ij ∈Z p =[0,p-1]Take matrix F = [ F = ij ] M*N And is initialized to F = O for matrix F M*N I.e. all F ij =0; second, for each quantized non-zero value I ij And (3) calculating: { x ij =I ij +F ij ,F ij =0,1, …, p-1} until x is satisfied ij ,y ij ∈Z p =[0,p-1]&&y ij 2 =(x ij 3 +ax ij + b) mod p, then I is completed ij To elliptic curve E p Mapping of (a, b); finally, wait for all I ij Completion E p (a, b), the mapping matrix X = [ X ] is output ij ] M*N ,F=[F ij ] M*N Where X = F + I, the concealment of the image information is achieved.
And c, encrypting a mapping matrix X, F, namely encrypting information by using a public key PU shared by a receiving end by a sending end, namely the DM8127 Video processing system, and then sending the information to a Video-M3 core for entropy coding.
First, for the elliptic curve E p (a, b) taking a base point G, when n G = O When n is the G order. Secondly, the PC machine takes a random integer PR epsilon [0,n-1]And PR is used as a private key of the PC, PU is a public key shared by the PC to the DM8127 computing platform at the sending end, and PU = PR G is satisfied; then, the sending end DM8127 video processing system receives the public key PU and takes a random integer k epsilon [0,n-1]K is used as a shared key; finally, the sending end DM8127 video processing system encrypts the mapping matrix X, F according to the following formula: c1= k G, C2= X + k PU, C3= F + k PU, resulting in a ciphertext set C M {C1,C2,C3}。
Further, in the network transmission of the data stream, the Cortex-ARM core receives the compressed data stream transmitted by the Video-M3 core, establishes a communication thread through a TCP/IP protocol based on Socket programming, and sequentially realizes the transmission of the compressed data stream to the PC end.
Further, the PC serves as a receiving end sharing public key PU, after the sending end DM8127 video processing system completes image encryption according to the public key and transmits the image encryption to the PC, the PC receives an input compressed video stream, and completes ciphertext decryption, image recovery and image display in sequence, and the PC includes an elliptic curve decryption module and an image recovery and display module.
Further, the elliptic curve decryption module firstly decompresses the compressed data stream to obtain a ciphertext C M { C1, C2, C3}; then, the private key PR is utilized to pair the ciphertext C M { C1, C2, C3} decrypting to obtain a mapping matrix X, F; the formula for decryption with the private key PR is: c1 × PR = k × G × PR = k × PU, C2-C1 × PR = X, C3-C1 × PR = F, i.e., X = C2-C1 × PR, F = C3-C1 × PR.
Further, in the image restoration and display module, firstly, a plaintext matrix I = X-F is obtained according to a mapping matrix X, F output by the elliptic curve decryption module and according to X = I + F; secondly, carrying out inverse quantization and inverse DCT on the plaintext matrix to obtain a residual error matrix Ir and a motion vector residual error mvd; and finally, according to the prediction matrix and the motion vector prediction value, reconstructing to obtain an original video, transmitting the original video to a browser and displaying video content by a GUI client interface.
The invention achieves the following beneficial effects: an image encryption method based on motion vectors is proposed. Based on DCT (discrete cosine transformation) and quantization, the invention encrypts a residual matrix of a video compression coding process and a quantized value of a motion vector residual value as a plaintext point by point so as to eliminate the time correlation and the space correlation of the plaintext; the invention is based on the elliptic curve encryption algorithm, optimizes the elliptic curve encryption formula, maps the quantized values of the image residual error matrix and the motion vector to the elliptic curve and encrypts, effectively hides the image information, reduces the key burden while ensuring the security, has strong encryption advantages in the equipment with limited resources and realizes the safe transmission of the image between the equipment; the invention takes an embedded DM8127 video processing system as a computing platform, realizes the stable acquisition of high-definition images, the effective and rapid image computation, the specific application of an elliptic curve encryption algorithm and the image display of an IE browser. The image security method provided by the invention not only can realize the secure transmission between two devices, but also is suitable for a large-scale secure transmission system with multiple devices.
Drawings
Fig. 1 is a general structural block diagram in the embodiment of the present invention.
FIG. 2 is a flow chart of compression encoding according to an embodiment of the present invention.
Fig. 3 is a flowchart of an elliptic curve cryptography algorithm in the embodiment of the present invention.
Detailed Description
The technical scheme of the invention is further explained in detail by combining the drawings in the specification.
As shown in fig. 1, an image encryption method based on motion vectors takes a DM8127 video processing system as a transmitting end and a PC as a receiving end, and performs system research based on DCT transformation and quantization and an elliptic curve encryption algorithm as an encryption method. Based on DCT and quantization, the DM8127 video processing system calculates a residual matrix of a video compression coding process and a residual value of a motion vector, and quantizes the residual value to be used as a plaintext for encryption; based on an elliptic curve encryption algorithm, a receiving end PC shares a public key PU to a sending end DM8127 video processing system, and the DM8127 video processing system utilizes the public key PU to map a plaintext to an elliptic curve and encrypt the plaintext; and finally, transmitting the ciphertext through a wifi network, receiving the ciphertext by the PC, decrypting by using the private key PR, and displaying the video image to the IE browser to realize the image secure transmission between the DM8127 video processing system and the PC.
Specifically, a DM8127 video processing system is used as a development platform, and mainly includes the following modules: the video acquisition module, the compression coding module and the elliptic curve encryption module sequentially realize the acquisition of video images, the compression coding of videos, the encryption of plaintexts and the transmission of data streams. The DM8127 video processing system can effectively realize stable capture, fast operation and intelligent algorithm development of video images by virtue of the advantages of multi-core isomerism.
In the video acquisition module, a VPSS-M3 core controls the video acquisition module to realize real-time recording of videos. The VPSS-M3 core of the DM8127 video processing system functions to achieve video capture, scaling and HDMI display. Therefore, the VPSS-M3 core is started to start the camera, the CMOS image sensor is used for monitoring the scene in real time, and the recorded 1080p high-definition video is transmitted to the DM8127 video processing system in a YUV format. The CMOS image sensor can achieve full-frame-rate output of 1080p high-definition images.
As shown in fig. 2, the Video-M3 core is responsible for compression coding the input Video stream in h.264 format. First, a macroblock is divided for an input video, and pixel values are calculated. Secondly, in order to reduce the spatial redundancy of the image, intra-frame prediction is carried out to obtain an intra-frame coding frame I, and a residual error matrix Ir is output; and performing motion estimation and motion compensation by using the time redundancy of the continuous frames to perform interframe prediction to generate an interframe coding frame P, B and output a motion vector residual value mvd. And then, calculating integer DCT transformation and quantization of the residual matrix Ir and the motion vector residual value mvd to output a plaintext matrix I, and transmitting the plaintext matrix I to a DSP core for corresponding encryption processing. H.264 utilizes integer DCT to transform not only can reduce the operation amount and the algorithm complexity, but also has the advantage of being beneficial to being transplanted to a fixed-point DSP, H.264 adopts a scalar quantization technology, and codes and maps each image sampling point into a smaller numerical value, so that the image coding length can be reduced on the premise of not reducing the visual effect, and unnecessary information in visual recovery is reduced. And finally, receiving a ciphertext set input by the DSP core, and performing lossless compression in a CABAC format, so that the data compression rate is improved, and the system performance is improved.
The DSP core is responsible for the operation of the elliptic curve encryption module so as to optimize an elliptic curve encryption algorithm, realize the specific encryption of a 1080p high-definition video image in a DM8127 video processing system and realize the security algorithm of the video image.
Based on DCT transformation and quantization and a public key PU shared by a PC to a DM8127 video processing system, the safe encryption of a plaintext matrix is realized. First, the elliptic curve parameters p, a, b are initialized to determine an elliptic curve E p (a, b). And therewithAt the same time, the plaintext matrix I is modified to ensure that all non-zero quantized values of the matrix I satisfy the elliptic curve mapping formula, i.e. x ij =I ij +F ij ,x ij ,y ij ∈Z p =[0,p-1]&&y ij 2 =(x ij 3 +ax ij + b) mod p, an output mapping matrix X, F, where X = F + I, enabling efficient concealment of the plaintext matrix. Finally, the public key PU is utilized, the encryption of the mapping matrix X, F is realized according to an encryption formula, C1= k G, C2= X + k PU and C3= F + k PU, and a ciphertext set C is obtained M { C1, C2, C3}. Based on the method, the application and optimization of the elliptic curve encryption algorithm in the DM8127 video processing system can be realized, and the safe transmission method of the DM8127 video image system to the video image can be realized.
To reduce the amount of data transferred, the Video-M3 requests the ciphertext C M And lossless compression coding is carried out on the encrypted data based on entropy coding (CABAC), and the compressed data stream is safely transmitted to the PC through a Wifi network, the DM8127 video processing system.
Specifically, a PC is used as a receiving end to receive a compressed data stream transmitted by the DM8127 video processing system, and ciphertext decryption, image recovery and image display are sequentially realized.
The PC firstly decompresses and decodes the received compressed data stream, and then according to the public key PU and a decryption formula: c1 × PR = k × G × PR = k × PU, C2-C1 × PR = X + k × PU-k × PU = X, C3-C1 × PR = F + k × PU-k × PU = F, obviously mapping the matrix X = C2-C1 × PR, F = C3-C1 × PR.
In order to realize the display of the video image on the GUI user interface of the PC browser, the mapping matrix needs to be converted into image data. For this, first, a plaintext matrix I = X-F is obtained according to the mapping matrix X, F and X = I + F output by the elliptic curve decryption module. And then, carrying out inverse quantization and inverse DCT on the plaintext matrix to obtain a residual error matrix Ir and a motion vector residual error mvd. And finally, according to the prediction matrix and the motion vector prediction value, reconstructing to obtain an original video, transmitting to an IE browser and displaying the video content by a GUI client interface.
Therefore, the whole system realizes the image safe transmission between the DM8127 video processing system and the PC.
The above description is only a preferred embodiment of the present invention, and the scope of the present invention is not limited to the above embodiment, but equivalent modifications or changes made by those skilled in the art according to the present disclosure should be included in the scope of the present invention as set forth in the appended claims.

Claims (9)

1. An image encryption method based on motion vectors, characterized in that:
in the method, a DM8127 video processing system is used as a sending end, a PC is used as a receiving end, the encryption process is based on DCT (discrete cosine transformation) and quantization, and an elliptic curve encryption and decryption algorithm is used as an encryption and decryption method;
based on DCT and quantization, the DM8127 video processing system calculates a residual matrix of a video compression coding process and a residual value of a motion vector, and quantizes the residual value to be used as a plaintext for encryption; the quantization residual value is used as plaintext for encryption, and the method comprises the following steps:
step a, initializing parameters and aligning an elliptic curve E p (a, b), initializing random integers p, a, b according to the value range of the image pixel to realize the plaintext I to the elliptic curve E p Mapping of (a, b); the value range of p is [257,301]A and b should satisfy 4a 3 +27b 2 ≠0&&a,b∈Z p =[0,p-1]Take a = floor (p/5), b = p-1, elliptic curve equation y 2 =(x 3 + ax + b) mod p to y 2 =[x 3 +floor(p/5)x+(p-1)]mod p;
B, mapping the plaintext matrix, correcting the plaintext matrix I, and continuously adjusting F to the quantized non-zero value of the plaintext matrix I ij To achieve a clear text in an elliptic curve E p Mapping the (a, b) to obtain a mapping matrix X, F, and hiding the image information;
first, let P (x) ij ,y ij ) For a point on the elliptic curve, x is required to be satisfied ij ,y ij ∈Z p =[0,p-1]Take matrix F = [ F = ij ] M*N And is initialized to F = O for matrix F M*N I.e. all F ij =0; second, for each quantized non-zero value I ij And (3) calculating: { x ij =I ij +F ij ,F ij =0,1, …, p-1} until x is satisfied ij ,y ij ∈Z p =[0,p-1]&&y ij 2 =(x ij 3 +ax ij + b) mod p, then I is completed ij To elliptic curve E p Mapping of (a, b); finally, wait for all I ij Completion E p (a, b), then outputting a mapping matrix X = [ X ] ij ] M*N ,F=[F ij ] M*N Wherein X = F + I, enabling concealment of image information;
step c, encrypting a mapping matrix X, F, namely encrypting information by a sending end, namely a DM8127 Video processing system, by using a public key PU shared by a receiving end, and sending the information to a Video-M3 core for entropy coding;
first, for the elliptic curve E p (a, b) taking a base point G, when n G = O When n is the G order; secondly, the PC machine takes a random integer PR epsilon [0,n-1]And PR is used as a private key of the PC, PU is a public key shared by the PC to the DM8127 computing platform at the sending end, and PU = PR G is satisfied; then, the sending end DM8127 video processing system receives the public key PU and takes a random integer k E [0,n-1]K is used as a shared key; finally, the sending end DM8127 video processing system encrypts the mapping matrix X, F according to the following formula: c1= k G, C2= X + k PU, C3= F + k PU, resulting in a ciphertext set C M {C1,C2,C3};
Based on an elliptic curve encryption and decryption algorithm, a receiving end PC shares a public key PU to a sending end DM8127 video processing system, and the DM8127 video processing system utilizes the public key PU to map a plaintext onto an elliptic curve and encrypt the plaintext; and finally, the ciphertext is transmitted through the network, the PC receives the ciphertext, decrypts the ciphertext by using the private key PR, displays the video image and realizes the safe transmission of the image between the DM8127 video processing system and the PC.
2. A motion vector-based image encryption method according to claim 1, characterized in that: the DM8127 video processing system comprises the following modules: the device comprises a Video acquisition module, an image compression coding module and an elliptic curve encryption module, wherein a Cortex-ARM core runs a Linux system to call the running of a VPSS-M3 core, a Video-M3 core and a DSP core and control the realization of the functions of all the modules, wherein in the Video acquisition module, the VPSS-M3 core runs a BIOS operating system to realize the acquisition and the preprocessing of Video images; in an image compression coding module, a Video-M3 core runs a BIOS operating system to receive the preprocessed image data and performs compression coding; in the elliptic curve encryption module, a DSP core runs a BIOS operating system to be responsible for scheduling and specifically executing an encryption algorithm so as to realize plaintext encryption; and finally, the Cortex-ARM core receives the compressed data stream of the Video-M3 core, and network transmission of the data stream is realized.
3. A motion vector-based image encryption method according to claim 2, characterized in that: in the video acquisition module, a DM8127 video processing system takes a CMOS image sensor as video input equipment; VPSS-M3 receives a starting instruction of a Cortex-ARM core, configures a transmission data format for the CMOS image sensor, calls the CMOS image sensor through a CameraLink interface to carry out real-time video acquisition on site, synchronously transmits 1080p video data streams in a YUV format to VPSS-M3 by using a CameraLink protocol, and carries out subsequent inter-core data processing.
4. A motion vector-based image encryption method according to claim 2, characterized in that: in the image compression coding module, a Video-M3 core initializes parameters, receives a Video stream from a VPSS-M3 core, stores an input Video in an H.264 encoder buffer, and an H.264 encoder divides an input image into macroblocks and calculates pixel values of the macroblocks.
5. A motion vector based image encryption method according to claim 4, characterized in that: in the image compression encoding module, after an h.264 encoder divides an input image into macroblocks and calculates pixel values of the macroblocks, the following operations are performed:
step 1, predicting a difference value;
predicting a current block to be coded according to a coded block according to the time correlation or the space correlation of adjacent blocks, and then coding according to the difference between a predicted value and a frame value; the method comprises the following steps of performing prediction estimation on a frame to be coded by adopting an intra-frame prediction mode by utilizing the spatial correlation of adjacent macro blocks in a frame, and generating an intra-frame coded frame I; using the time correlation of the adjacent macro blocks between frames, adopting an inter-frame prediction mode to carry out motion estimation and motion compensation, and generating a corresponding inter-frame coding frame P, B frame; wherein for an I frame, an original frame pixel matrix is represented by Io, ip represents a linear prediction frame pixel matrix, ir represents a residual matrix, and Ir = Io-Ip; for the P, B frame, estimating a motion vector prediction value mvp according to a motion vector mv, and calculating a motion vector residual value mvd = mv-mvp;
step 2, DCT transformation and quantization are carried out;
performing integer DCT (discrete cosine transformation) and quantization on the residual matrix Ir and the motion vector residual value mvd to obtain a plaintext matrix I; the integer DCT transformation formula is as follows: f c =C*f*C T F is an N × N matrix, and the element in the u row and x column of the transformation matrix C is represented as:
Figure FDA0003994333930000041
the quantization formula is:
Figure FDA0003994333930000042
step 3, entropy coding CABAC;
DSP core will dense text set C M { C1, C2, C3} is transmitted to a Video-M3 core for entropy coding CABAC to realize lossless data compression; firstly, taking a binary value for an input element; secondly, selecting a probability model, namely context modeling, for the element to be coded according to the coded element by utilizing the context information of each syntax element, including a probability information state and a maximum probability symbol MPS; and finally, carrying out probability estimation in a self-adaptive mode according to the current statistical characteristics and carrying out arithmetic coding.
6. A motion vector-based image encryption method according to claim 2, characterized in that: and in the network transmission of the data stream, the Cortex-ARM core receives the compressed data stream transmitted by the Video-M3 core, establishes a communication thread through a TCP/IP protocol based on Socket programming, and sequentially realizes the transmission of the compressed data stream to the PC end.
7. A motion vector-based image encryption method according to claim 1, characterized in that: the PC serves as a receiving end to share the public key PU, after the sending end DM8127 video processing system completes image encryption according to the public key and transmits the image encryption to the PC, the PC receives an input compressed video stream and completes ciphertext decryption, image recovery and image display in sequence, and the PC comprises an elliptic curve decryption module and an image recovery and display module.
8. A motion vector based image encryption method according to claim 7, characterized in that: the elliptic curve decryption module firstly decompresses the compressed data stream to obtain a ciphertext C M { C1, C2, C3}; then utilizes private key PR to make cipher text C M { C1, C2, C3} decrypting to obtain a mapping matrix X, F; the formula for decryption with the private key PR is: c1 × PR = k × G × PR = k × PU, C2-C1 × PR = X, C3-C1 × PR = F, i.e., X = C2-C1 × PR, F = C3-C1 × PR.
9. A motion vector based image encryption method according to claim 7, characterized in that: in the image restoration and display module, firstly, a plaintext matrix I = X-F is obtained according to a mapping matrix X, F output by the elliptic curve decryption module and according to X = I + F; secondly, carrying out inverse quantization and inverse DCT on the plaintext matrix to obtain a residual error matrix Ir and a motion vector residual error mvd; and finally, according to the prediction matrix and the motion vector prediction value, reconstructing to obtain an original video, transmitting the original video to a browser and displaying video content by a GUI client interface.
CN202110466485.3A 2021-04-28 2021-04-28 Image encryption method based on motion vector Active CN113179404B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110466485.3A CN113179404B (en) 2021-04-28 2021-04-28 Image encryption method based on motion vector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110466485.3A CN113179404B (en) 2021-04-28 2021-04-28 Image encryption method based on motion vector

Publications (2)

Publication Number Publication Date
CN113179404A CN113179404A (en) 2021-07-27
CN113179404B true CN113179404B (en) 2023-02-21

Family

ID=76926737

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110466485.3A Active CN113179404B (en) 2021-04-28 2021-04-28 Image encryption method based on motion vector

Country Status (1)

Country Link
CN (1) CN113179404B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108388808A (en) * 2018-03-05 2018-08-10 郑州轻工业学院 Image encryption method based on Xi Er encryption and dynamic DNA encoding
CN108833924A (en) * 2018-06-22 2018-11-16 东北大学 It is a kind of based on more security level video encryption algorithms H.265

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8023562B2 (en) * 2007-09-07 2011-09-20 Vanguard Software Solutions, Inc. Real-time video coding/decoding
US8526488B2 (en) * 2010-02-09 2013-09-03 Vanguard Software Solutions, Inc. Video sequence encoding system and algorithms

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108388808A (en) * 2018-03-05 2018-08-10 郑州轻工业学院 Image encryption method based on Xi Er encryption and dynamic DNA encoding
CN108833924A (en) * 2018-06-22 2018-11-16 东北大学 It is a kind of based on more security level video encryption algorithms H.265

Also Published As

Publication number Publication date
CN113179404A (en) 2021-07-27

Similar Documents

Publication Publication Date Title
TR201808894T4 (en) Scalable video encoding with two-layer encryption and single-layer decryption.
US20120195356A1 (en) Resource usage control for real time video encoding
JP2006129436A (en) Non-integer pixel sharing for video encoding
CN109168033B (en) Video privacy data protection system and method
CN114143551B (en) Video safe and efficient transmission system applied to video sensor network
Zhang et al. Adaptive distributed compressed video sensing.
CN113179404B (en) Image encryption method based on motion vector
Unde et al. Adaptive compressive video coding for embedded camera sensors: compressed domain motion and measurements estimation
Priya et al. An Effectual Video Compression Scheme for WVSNs Based on Block Compressive Sensing
CN104301727A (en) H.264 video perception encryption algorithm with controllable quality on basis of CABAC
Angayarkanni et al. Multi-view video codec using compressive sensing for wireless video sensor networks
CN113973207A (en) Real-time control and playback method for IOS remote real machine WEB end based on H264 code stream
CN111585744A (en) Video transmission method and system based on hardware codec
Imran et al. Performance analysis of video encoders for wireless video sensor networks
Durdi et al. Robust video transmission over wireless networks using cross layer approach
KR100899666B1 (en) Dispersed multistreaming transmission apparatus
Lian et al. A fast video encryption scheme suitable for network applications
Kadam et al. Video frame encryption algorithm using AES
WO2024078403A1 (en) Image processing method and apparatus, and device
Arunkumar et al. Implementation of encrypted image compression using resolution progressive compression scheme
KR101101762B1 (en) H.264 base Embedded network image transmission devices which apply a frame encryption
JP2012049753A (en) Video compression apparatus, video compression method and program
Lee et al. Secure and energy-efficient image transmission for wireless sensor networks
Sabino et al. Motion compensation techniques in permutation-based video encryption
JP2001045493A (en) Moving image encoding device, moving image output device and storage 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