Chaotic Video Encryption Method Based on Sliding Encryption Window
By dynamically adjusting the encryption window parameters based on the correlation between the initial key stream value and the frame content, an encryption key stream is generated and scrambled chaotically, thus solving the problem of limited key space and improving the security and flexibility of the video encryption system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NAVAL UNIV OF ENG PLA
- Filing Date
- 2026-01-16
- Publication Date
- 2026-06-02
AI Technical Summary
In existing chaotic video encryption methods based on sliding encryption windows, the limited key space results in insufficient resistance to brute-force attacks, making it easy for attackers to crack encrypted videos through traversal.
The sliding step size and size of the encryption window are dynamically adjusted based on the initial value of the key stream and the correlation with the frame content. The video sequence is divided into frames-by-frame sliding encryption windows. The parameters of the chaotic system are dynamically adjusted based on the pixel information within the encryption window to generate an encryption key stream, which is then applied to the corresponding pixels within the encryption window for chaotic scrambling and encryption.
It improves the video encryption system's resistance to brute-force attacks, enhances the utilization of the key space, and enables intelligent encryption strategy selection for dynamic video content, thereby improving the system's security and flexibility.
Smart Images

Figure CN122137988A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication security technology, and particularly to a chaotic video encryption method based on a sliding encryption window. Background Art
[0002] The chaotic video encryption method based on a sliding encryption window is a technology that uses a chaotic system to generate a key stream and combines a sliding window mechanism to dynamically encrypt video frames, improving the security and adaptability of encryption through an ever-changing encryption window.
[0003] One problem with this method is how to provide feedback control for the division strategy of the encryption window based on the correlation between the initial value of the key stream and the content of the video frame, so as to solve the problem that due to the fixed parameters and single key generation mode of traditional encryption methods, attackers can easily crack the encrypted video through a brute-force search, resulting in insufficient anti-exhaustive attack ability due to limited key space, thereby enhancing the security and robustness of the system. Summary of the Invention
[0004] In view of this, embodiments of the present disclosure provide a chaotic video encryption method based on a sliding encryption window, which at least partially solves the problems existing in the prior art.
[0005] The chaotic video encryption method based on a sliding encryption window includes: Determining the sliding step and size of the encryption window according to the correlation between the initial value of the key stream and the frame content; Dividing the video sequence into sliding encryption windows frame by frame to obtain the encrypted area corresponding to each frame; Dynamically adjusting the parameters of the chaotic system based on the pixel information within the encryption window to generate an encrypted key stream; Applying the key stream to the pixel points within the corresponding encryption window for chaotic scrambling and encryption.
[0006] According to one embodiment, the determining the sliding step and size of the encryption window according to the correlation between the initial value of the key stream and the frame content further includes: Obtaining the similarity value S between the current frame and the previous frame; Calculating the ratio of the initial value K0 of the key stream to S, that is, δ = |K0| / S; Adjusting the sliding step according to the formula Step = a×δ + b, where a and b are preset constants; When Step < Step_min or Step > Step_max, setting Step to Step_min or Step_max, where Step_min and Step_max are the minimum and maximum values of the set sliding step.
[0007] According to one embodiment, determining the sliding step size and dimensions of the encryption window based on the correlation between the initial value of the key stream and the frame content further includes: Combine the entropy value H of the initial key stream K0 to generate the scaling factor ρ = H / D; The width of the encryption window is set according to the formula W=c×ρ+d, where c and d are preset constants; If W exceeds the maximum window size W_max, then it is forcibly set to W_max.
[0008] According to one embodiment, determining the sliding step size and dimensions of the encryption window based on the correlation between the initial value of the key stream and the frame content further includes: Calculate the region R of the target object in the current frame; The weighting factors of R are determined based on the modulus of the initial key stream value K0 mod(K0,n). The window height is calculated using the formula H=e×R+f×mod(K0,n), where e and f are adjustment coefficients. If H is less than the minimum height H_min, then H = H_min.
[0009] According to one embodiment, the step of dividing the video sequence into frame-by-frame sliding encryption windows to obtain the encryption region corresponding to each frame further includes: Generate a random offset O based on the initial value of the key stream; The window's starting position P is updated by combining the motion vector information M of each frame; The position of the window is controlled by the formula P=(P_prev+O)%width, where P_prev is the starting position of the window in the previous frame and width is the image width. If P is close to the boundary, the window is clipped to ensure it is within the frame range.
[0010] According to one embodiment, the step of dividing the video sequence into frame-by-frame sliding encryption windows to obtain the encryption region corresponding to each frame further includes: Use dynamic frame rate F to adjust the number of encrypted windows; A frame rate compensation factor λ=(F×F_avg) / F_avg is introduced to affect the number of windows, where F_avg is the average frame rate; The number of encrypted regions is calculated using the formula N=round(α×λ+β), where α and β are system parameters. When N is greater than or equal to the maximum number of regions N_max, N is truncated to N_max.
[0011] According to one embodiment, the step of dividing the video sequence into frame-by-frame sliding encryption windows to obtain the encryption region corresponding to each frame further includes: Detect the illumination change ΔI in the video and use it as input for window density adjustment; The gap between encrypted regions is adjusted according to the formula gap=γ×(ΔI+θ), where γ is the amplification factor and θ is the preset offset term; If gap is less than 2 pixels, then set gap to 2; Otherwise, the gap will be used as the starting point reference for the next batch of encryption windows.
[0012] According to one embodiment, the step of dynamically adjusting the chaotic system parameters based on the pixel information within the encryption window to generate the encryption key stream further includes: Statistical analysis of the color histogram distribution h in the encrypted window; The initial conditions are adjusted according to the formula x0=h_avg×σ+μ, where h_avg is the weighted average of the average values of each color in the color histogram, and μ and σ are the mean and standard deviation, respectively. Divide the brightness level L of the encrypted window into three intervals, and adjust the system gain factor g accordingly. The mapping function is dynamically selected based on different values of g to optimize the key stream generation effect.
[0013] According to one embodiment, the step of dynamically adjusting the chaotic system parameters based on the pixel information within the encryption window to generate the encryption key stream further includes: Get the edge strength E of the current encryption window; The system delay time is updated according to the formula delay=ε×E+ζ, where ε and ζ are adjustment parameters; The delay time_delay is input into the nonlinear system model to generate the key stream; If delay causes system instability, limit it to the range [delay_min, delay_max], where delay_min and delay_max are the minimum and maximum values of the system delay time.
[0014] According to one embodiment, applying the key stream to pixels within the corresponding encryption window for chaotic scrambling and encryption further includes: Perform a reverse sorting operation on each row in the window; The application uses Arnold mapping based on key stream, where the coordinate transformation formula is (x,y)=((x+y)%width,(x+2y)%height), where width is the image width and height is the image height; Construct a mask matrix M using the differences between adjacent bits in the key stream; By performing block-by-block replacement according to M, the encryption's resistance to brute-force attacks is improved.
[0015] This disclosure provides a chaotic video encryption method based on a sliding encryption window, comprising: determining the sliding step size and dimensions of the encryption window according to the correlation between the initial value of the key stream and the frame content; dividing the video sequence frame by frame into a sliding encryption window to obtain the encryption region corresponding to each frame; dynamically adjusting the chaotic system parameters based on the pixel information within the encryption window to generate an encryption key stream; and applying the key stream to the pixels within the corresponding encryption window for chaotic scrambling and encryption. The scheme of this disclosure can provide feedback control of the encryption window division strategy based on the correlation between the initial value of the key stream and the frame content to solve the problem of insufficient resistance to brute force caused by limited key space. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the exemplary embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this disclosure and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart of a chaotic video encryption method based on a sliding encryption window; Figure 2 This is a further flowchart of determining the sliding step size and dimensions of the encryption window based on the correlation between the initial value of the key stream and the frame content; Figure 3 This is a further flowchart of dividing a video sequence into frame-by-frame sliding encryption windows to obtain the encryption region corresponding to each frame; Figure 4 It is a further flowchart of dynamically adjusting the parameters of the chaotic system based on the pixel information within the encryption window to generate the encryption key stream; Figure 5 It is a flowchart of applying the key stream to the pixels within the corresponding encryption window for further chaotic scrambling and encryption. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the embodiments of this disclosure will be further described in detail below with reference to the accompanying drawings. The illustrative implementation methods and descriptions of the embodiments of this disclosure are only used to explain the embodiments of this disclosure and are not intended to limit the embodiments of this disclosure.
[0019] Next, refer to Figure 1This paper describes the steps of the chaotic video encryption method based on a sliding encryption window according to the present invention, and explains how it solves the problem of insufficient resistance to brute force due to limited key space by adjusting the encryption window division strategy based on the correlation between the initial key stream value and the frame content. This technical solution improves system security by dynamically adjusting encryption parameters and window information according to the video content. First, the method includes four key steps: determining the sliding step size and dimensions of the encryption window based on the correlation between the initial key stream value and the frame content; dividing the video sequence frame by frame into sliding encryption windows to obtain the encryption region corresponding to each frame; dynamically adjusting the chaotic system parameters based on the pixel information within the encryption window to generate an encryption key stream; and applying the key stream to the pixels within the corresponding encryption window for chaotic scrambling and encryption. Below, I will describe the specific operation of each step and illustrate it with a concrete example.
[0020] S101: The sliding step size and size of the encryption window are determined based on the correlation between the initial keystream value and the frame content. Specifically, during the encryption process, the system first calculates the initial window size and sliding step size based on the given initial keystream parameters. Then, it dynamically adjusts these parameters using the pixel distribution characteristics of each frame (such as brightness differences or motion features). This adjustment prevents attackers from predicting subsequent encryption areas using a fixed sliding pattern, thereby improving overall anti-cracking capabilities. For example, when processing a video containing multiple moving objects, if the system detects significant changes in brightness or abrupt edge changes in certain areas of the current frame, it automatically increases the size of the encryption window and adjusts the sliding step size to provide a higher level of protection for these highly sensitive areas. This ensures a balance between security and computational efficiency.
[0021] S102: The video sequence is divided into frame-by-frame sliding encryption windows to obtain the encryption region corresponding to each frame. Specifically, the system draws multiple encryption windows on each frame image in a preset manner (such as horizontal or vertical sliding). The starting position of these windows is affected by the key stream parameters of the previous frame and the content information of the current frame. For example, in one embodiment, when a segment of video is relatively stable with little dynamic change, the encryption window will cover the entire screen with a larger sliding step size, and the overlap between windows will be minimal to avoid redundant processing; while when a frame has fast motion or a large number of pixels changing, the system may reduce the size of the encryption window and use a denser sliding step size to cover more detailed areas. This method can ensure that key information is encrypted without affecting processing speed, enhancing the adaptability of the algorithm.
[0022] S103: Based on the pixel information within the encryption window, the chaotic system parameters are dynamically adjusted to generate an encryption keystream. The core of this process is to combine the characteristics of the pixels within the window and correct the initial parameters of the chaotic function used to generate the keystream in real time. Specifically, through statistical analysis of the grayscale values or color distribution within each window, a set of feature parameters is obtained, and the control parameters of the chaotic model are updated accordingly. This not only improves the unpredictability of the keystream but also maintains a weak correlation between keystreams in different frames, increasing the risk that an adversary cannot extract patterns from consecutive frames. In a specific instance, if the system detects a large number of pixels with similar hues within a certain encryption window, it immediately adjusts the initial conditions of the chaotic equation, causing the subsequently generated keystream to exhibit a wider range of fluctuations, avoiding the low entropy problem caused by a single-hue window.
[0023] S104: Apply the keystream to the pixels within the corresponding encryption window for chaotic scrambling and encryption. Based on the keystream of each window, each pixel is reordered or its value is changed, thereby completing the scrambling and diffusion processing of the image. The key to this step is how to efficiently and accurately apply the keystream to the specified window while minimizing errors and computational delays. For example, in another embodiment, assuming a large area of uniform background (such as a blue sky) appears in a frame of a video, the system will use the keystream to perform complex rotations and transformations on several encryption windows within the background, making the originally clear blue sky appear chaotic and difficult to identify in certain areas, greatly improving the concealment and security of that part.
[0024] This invention effectively enhances the resistance to brute-force attacks in video encryption systems, improves the utilization rate of key space, and enables intelligent selection of encryption strategies for dynamic video content. Because the system can automatically adjust the keystream and local parameters of the encryption pane based on the current video content, it can produce completely different encryption results in different scenarios, even with the same initial key, thereby greatly enhancing the system's security and flexibility.
[0025] Next, refer to Figure 2 The present invention describes how the sliding step size and dimensions of the encryption window are determined based on the correlation between the initial value of the key stream and the frame content.
[0026] S202: Obtain the similarity value S between the current frame and the previous frame. The similarity value S measures the degree of change between two frames, and its value is usually between 0 and 1. The larger the value, the smaller the difference between the frames.
[0027] S202: Calculate the ratio of the initial key stream value K0 to S, i.e., δ=|K0| / S. K0 is the initial value of the key stream, its absolute value represents the strength of the key stream, and δ reflects the relationship between the key stream and frame changes.
[0028] S203: Adjust the sliding step size according to the formula Step = a×δ + b, where a and b are preset constants based on the expected value range of δ; make the step size adaptive and fall within [Step_min, Step_max]; ensure simple calculation, taking into account sensitivity and boundary control. Generally, set a = 2 and b = 1 to ensure a reasonable range of change for the steps.
[0029] S204: When Step < Step_min or Step > Step_max, set Step to Step_min or Step_max, where Step_min and Step_max are the minimum and maximum values of the set sliding step size. This step aims to make the encryption window move dynamically in the video, enhancing security and adaptability.
[0030] For example, in an embodiment, the similarity of the current frame S = 0.5, K0 = 2, then δ = 4, Step = 2×4 + 1 = 9. If Step_max = 10, then use this step size; if Step exceeds the set range, it will be automatically adjusted to ensure that the operation meets the system requirements. This method makes the movement of the encryption window more flexible and resistant to attacks, thus improving the overall security and robustness of encryption.
[0031] Next, further describe the determination of the sliding step size and size of the encryption window according to the correlation between the initial value of the key stream and the frame content of the present invention.
[0032] S301: Statistically calculate the inter-frame change difference D. Where D represents the sum of pixel differences between consecutive video frames, used to reflect the dynamic degree of the picture. The larger the value of D, the more剧烈 the picture change, and a more flexible encryption strategy is required.
[0033] S302: Combine the entropy value H of the initial value K0 of the key stream to generate the scaling factor ρ = H / D. Where H reflects the randomness of the initial state of the key stream, and the larger H is, the more uncertain the initial key is; D represents the inter-frame difference, and the ratio ρ of H and D serves to quantify the relationship between the two. This ratio helps to adjust the encryption parameters according to the complexity of the video content and the uncertainty of the key.
[0034] S303: The width of the encryption window is set according to the formula W=c×ρ+d, where c and d are preset constants. The values of the preset constants c and d are determined based on the statistical characteristics of the scaling factor ρ, the system-defined allowable range of encryption window width [W_min, W_max], and a comprehensive trade-off between encryption strength and processing efficiency. For example, after data normalization, c can take a value between 1 and 5, and d can take a value between 10 and 50 to ensure that the encryption window width can respond sensitively and reasonably to changes in video content and key entropy. The significance of this formula is to dynamically adjust the window size to adapt to the characteristics of video content and key stream, thereby achieving better encryption efficiency and security strength.
[0035] S304: If W exceeds the maximum window size W_max, then force it to be set to W_max. This is to ensure system stability and prevent resource waste.
[0036] For example, in one embodiment, if the inter-frame variation in a video is small and the keystream entropy is high, the scaling factor ρ is larger, resulting in a larger W and a wider encryption coverage. Specifically, when D=150 and H=7.8, assuming c=2 and d=20, then W=2×7.8+20=35.6, which is approximately rounded down to 36, not exceeding W_max=50. This setting ensures that more areas are encrypted when the image is relatively static, improving security; while in dynamic scenes, a smaller encryption window reduces computation and improves processing efficiency. Such a scheme can effectively improve the adaptability and encryption effect of the video encryption system.
[0037] Next, the invention further describes how the sliding step size and dimensions of the encryption window are determined based on the correlation between the initial value of the key stream and the frame content.
[0038] S401: Calculate the area R of the target object in the current frame. R represents the area ratio of the target object in the image, with a value ranging from [0,1]. This step identifies and counts the size of the target object using a target detection algorithm to reflect the changing characteristics of the frame content. For example, in a frame of a video, if a person occupies one-third of the screen, then R is 0.33.
[0039] S402: Divide the weighting factors of R according to the modulus mod(K0,n) of the initial key stream value K0. mod(K0,n) represents the result of taking the remainder of K0 with respect to the integer n. n is usually set to a constant greater than or equal to the maximum possible value of the window height, such as n=100, which ensures that the modulus varies within the range [0,n). This step controls the weighting method of R through K0, making the encryption window adapt to different frame contents and improving encryption diversity.
[0040] S403: The window height is calculated using the formula H = e × R + f × mod(K0,n), where e and f are adjustment coefficients. e and f typically range from [0.5, 2], and the optimal values can be adjusted based on experimental data, such as e = 1.5 and f = 0.8. This formula combines frame content and key information, allowing the window height to change dynamically and enhancing its resistance to attacks.
[0041] S404: If H is less than the minimum height H_min, then H = H_min. H_min is generally set to 1 / 4 or larger of the video resolution to avoid the window being too small to effectively cover the content.
[0042] For example, when H is calculated to be 64 and H_min is set to 128, H is ultimately set to 128. This design ensures that each window always covers the critical area, improving overall encryption efficiency and security. Through the above steps, the system can dynamically adjust the encryption window parameters based on the in-frame content and key information, improving the flexibility and robustness of video encryption.
[0043] Next, refer to Figure 3 The present invention describes the process of dividing a video sequence into a frame-by-frame sliding encryption window to obtain the encryption region corresponding to each frame.
[0044] S501: Generate a random offset O based on the initial keystream value. Here, O is a random value generated by the encryption algorithm to determine the positional changes of the subsequent window. The value range of O is typically [0, width), where width represents the image width, to ensure that the offset does not exceed the image size. By setting this parameter, the encryption window can have unpredictable displacement characteristics between different frames, thereby improving encryption security. For example, when encrypting the first frame, O might be chosen to be 32 pixels.
[0045] S502: Update the window's initial position P by combining the motion vector information M from each frame. The motion vector information M reflects the direction and magnitude of the object's movement in the image, used to adjust the current position of the encrypted window. This dynamic adjustment allows the window to move flexibly within the target area, reducing the possibility of attackers exploiting patterns. Specifically, in a frame, if the object moves 5 pixels to the right, P is adjusted accordingly to a suitable position to prevent the window from deviating from the valid content.
[0046] S503: The window position is controlled by the formula P=(P_prev+O)%width, where P_prev is the window's starting position in the previous frame, and width is the image width. O is the randomly generated offset mentioned above. The purpose of this formula is to keep the window within the image area and achieve smooth position transitions, avoiding visual discontinuities caused by window jumps.
[0047] S504: If P is close to the boundary, the window is cropped to ensure it remains within the frame. When P exceeds half the frame width or is close to the edge, the system automatically resizes the window to ensure it is always contained within the effective area of the image. For example, if the image width is 800 pixels and the current window's starting position P is 700 pixels, and the window's original width is 200 pixels, the right side of the window will extend to 900 pixels, exceeding the right boundary of the image. In this case, the system will crop the window to the right, adjusting its effective width to 100 pixels to ensure the window is completely within the image frame.
[0048] This technical solution helps improve the real-time performance and attack resistance of encryption, while reducing the consumption of computing resources and improving encryption efficiency and security.
[0049] Next, we will further describe how the present invention divides a video sequence into frame-by-frame sliding encryption windows to obtain the encryption region corresponding to each frame.
[0050] S601: Uses a dynamic frame rate F to adjust the number of encryption windows. Here, the dynamic frame rate F refers to the frame rate of the current frame in the video sequence, used to determine the number of encryption windows to be processed in each frame, making the encryption process more flexible. For example, in high frame rate videos, the system may select more encryption windows to improve security, while in low frame rate videos, it may reduce the number of encryption windows to ensure real-time performance.
[0051] S602: Introduces a frame rate compensation factor λ=(F×F_avg) / F_avg to affect the number of windows, where F_avg is the average frame rate. λ is used to adjust for errors caused by the mismatch between the actual frame rate and the average frame rate, ensuring consistent encryption under different video conditions. For example, when F is close to or equal to F_avg, the value of λ is close to 1, indicating that no additional adjustment is needed; while when F is higher or lower than F_avg, λ is used to increase or decrease the number of encrypted areas.
[0052] S603: The number of encrypted regions is calculated using the formula N=round(α×λ+β), where α and β are system parameters. α is a weighting coefficient, typically ranging from 0.5 to 2.0, representing the direct impact of λ on the number of encrypted regions; β is an offset, typically ranging from 1 to 5, used to ensure that the number of encrypted regions is not less than the minimum requirement. For example, when α is 1.2 and β is 2, for a reasonable value of λ, the system will calculate an appropriate N as the number of encrypted regions.
[0053] S604: When N is greater than or equal to the maximum number of regions N_max, N is truncated to N_max. N_max is the upper limit of the maximum encrypted region determined by system resources and encryption performance, preventing the encryption process from exceeding hardware or software limits. For example, when N_max is set to 6, but N is calculated to be 8, N is forced to be set to 6 to avoid excessive computational load.
[0054] By following the steps described above, the number of encryption windows can be dynamically adjusted, ensuring the stability and efficiency of encryption operations at different frame rates. This technical solution enhances the adaptability of video encryption methods to different video streams, improves system security and efficiency, and optimizes the allocation of encryption resources.
[0055] Next, we will further describe how the present invention divides a video sequence into frame-by-frame sliding encryption windows to obtain the encryption region corresponding to each frame.
[0056] S701: Detect the illumination change ΔI in the video and use it as input for window density adjustment. This step quantifies the degree of illumination change by calculating the difference in pixel brightness between adjacent frames, which is used to dynamically adjust the position and distribution density of the encryption window. For example, if the lighting in the scene changes suddenly, the ΔI value will increase, causing a corresponding change in the gap between encryption regions in subsequent steps. ΔI is a dimensionless parameter, typically ranging from 0 to 100. Its optimal value is generally set to 20 to ensure effective response to sudden illumination changes while avoiding excessive perturbation of the window position under normal conditions.
[0057] S702: The gap between encrypted regions is adjusted according to the formula gap=γ×(ΔI+θ), where γ is the amplification factor and θ is a preset offset term. This formula is used to calculate the minimum distance between two adjacent encrypted windows. γ is typically between 0.5 and 2, with an optimal value of 1, to balance encryption strength and processing efficiency under different lighting conditions; the reasonable range for θ is 0 to 5, with an optimal value of 2, to avoid the error of a zero gap due to an excessively small ΔI. This formula is designed to dynamically adapt the window density to changes in lighting, improving the overall encryption effect and security.
[0058] S703: If gap is less than 2 pixels, set gap to 2. This step is to prevent overly dense or overlapping encryption areas and ensure the independence and effectiveness of each window. For example, in a video clip with stable lighting, the ΔI value is small, and gap may be less than 2. Forcing it to 2 can avoid invalid window overlap, improve system stability, and enhance the overall quality of image encryption.
[0059] S704: Otherwise, use the gap as the starting point reference for the next batch of encryption windows. This allows for continuous and orderly window sliding, providing better temporal and spatial continuity in the encryption process and reducing the risk of image content leakage. Combined with the above steps, this method can effectively adapt to various video environment changes, enhancing the robustness and security of the encryption system.
[0060] Next, refer to Figure 4 The present invention describes how to dynamically adjust the parameters of a chaotic system based on pixel information within an encrypted window to generate an encrypted key stream.
[0061] S801: Calculate the color histogram distribution h within the encrypted window. This step provides data support for subsequent parameter adjustments by calculating the color distribution of pixels within the window. For example, it extracts the color values of all pixels within the current sliding window in a video sequence and counts the frequency of each color.
[0062] S802: Adjust the initial conditions according to the formula x0 = h_avg × σ + μ, where h_avg is the weighted average of the average values of each color in the color histogram, and μ and σ are the mean and standard deviation, respectively. The value of x0 is generally between 0 and 1 to ensure the stability and diversity of the chaotic system. This setting allows the chaotic system to generate a more random key stream under different image backgrounds.
[0063] S803: Divide the brightness level L of the encryption window into three intervals and adjust the system gain factor g accordingly. For example, low, medium, and high brightness regions, so as to adjust the system gain factor g for different situations. g is strongly correlated with the range of mathematical chaos parameters of the selected chaos map, usually within a sub-interval between 1 and 4.
[0064] S804: Dynamically select the mapping function based on different values of g to optimize the keystream generation effect. For example, when g is small, use the logistic mapping; when g is large, switch to the tent mapping to improve the unpredictability of the keystream.
[0065] This method can automatically adjust parameters based on video content, making the generated keystream more closely match the actual image information and improving encryption security and adaptability. Specifically, during video encryption, if the color distribution within the window is relatively uniform, x0 is set to a reasonable value to ensure a high complexity of the keystream; conversely, if the colors are too dark or too bright, a chaotic mapping function is dynamically selected through brightness partitioning, and the gain factor is finely adjusted accordingly to make the keystream strongly correlated with the image content, thereby enhancing its randomness and unpredictability. Typically, by presetting μ and σ within the (0,1) interval and normalizing the image feature h_avg, the specific value of x0 is dynamically calculated using the formula x0 = h_avg × σ + μ.
[0066] This technical solution significantly enhances the dynamic adaptability and anti-attack capabilities of the encryption system.
[0067] Next, the present invention further dynamically adjusts the parameters of the chaotic system based on the pixel information within the encrypted window to generate an encrypted key stream.
[0068] S901: Obtain the edge strength E of the current encryption window. This step calculates the edge sharpness of the image by analyzing the pixel gradient changes within the encryption window. The value of E typically ranges from 0 to 255, with the optimal value depending on the specific image content and encryption requirements. For example, in a video frame with rich texture, the edge strength may be higher, which helps improve the unpredictability of the keystream.
[0069] S902: Update the system delay time according to the formula delay=ε×E+ζ, where ε and ζ are adjustment parameters. ε is a scaling factor, typically set between 0.1 and 0.5, and ζ is the offset, usually set between 1 and 5. This formula aims to link edge strength with system delay time, ensuring that system operating parameters change synchronously with changes in image content, thereby enhancing encryption security.
[0070] S903: Input the delay `time_delay` into a nonlinear system model to generate the keystream. Nonlinear systems are typically models such as Lorenz or Chen, whose output serves as a key element in encryption and possesses high randomness and irreversibility.
[0071] S904: If delay causes system instability, limit it to the range [delay_min, delay_max], where delay_min and delay_max are the minimum and maximum system delay times, respectively. This ensures system stability. The values of delay_min and delay_max are determined by the actual system performance; it is recommended to set them to 5 and 20, respectively.
[0072] For example, in one embodiment, when a high-contrast region appears in a video segment, the edge strength is high, leading to increased system latency. This makes the keystream more variable, effectively improving the overall resistance to attacks. Through this process, the encryption process can be made more adaptive and secure.
[0073] Next, refer to Figure 5 The present invention describes the application of a key stream to pixels within a corresponding encryption window for chaotic scrambling and encryption.
[0074] S1001: Perform a reverse arrangement operation for each row in the window. This step reverses the order of the pixel rows within each window to increase the spatial complexity of the video information. For example, in one embodiment, when the window size is 64×64 pixels, the pixels in each row are rearranged from column 64 to column 1. This method effectively disrupts the distribution pattern of the original data and reduces data predictability.
[0075] S1002: This application uses a keystream-based Arnold mapping, where the coordinate transformation formula is (x,y)=((x+y)%width,(x+2y)%height), where width is the image width and height is the image height. The input to this formula is the current pixel position (x,y) of the image, and the output is the transformed position. Width and height represent the width and height of the window, typically ranging from 16 to 128. This formula achieves periodic jumps in pixel position through linear transformation, creating a more complex obfuscation effect and making it difficult for attackers to infer the original data based on position.
[0076] S1003: Construct a mask matrix M using the differences between adjacent bits in the keystream. M is a binary matrix with the same size as the window, where 0 and 1 represent whether a substitution operation is performed. In specific scenarios, the keystream is divided into adjacent bit groups; if two adjacent bits are different, a 1 is generated, otherwise a 0 is generated. This method can improve the randomness and unpredictability of the cipher.
[0077] S1004: Perform block-by-block replacement according to M to improve the encryption's resistance to brute-force attacks. This step replaces pixels in areas that meet certain conditions. For example, when a part of M is 1, the pixels in that area will be replaced by random pixels from other windows, enhancing the encryption strength. Through the synergistic effect of the above steps, this invention significantly improves encryption security and the level of obfuscation.
[0078] The chaotic video encryption method based on a sliding encryption window of the present invention includes: firstly, dynamically adjusting the sliding step size and size of the encryption window according to the correlation between the initial value of the key stream and the frame content, so as to achieve adaptive optimization of the encryption window partitioning strategy; then, processing the video sequence frame by frame, dividing each frame into a corresponding encryption region, and dynamically adjusting the parameters of the chaotic system based on the pixel information in each encryption window to generate an encryption key stream that matches the characteristics of the window; subsequently, using the key stream to perform chaotic scrambling and encryption operations on the pixels in the window, thereby achieving secure transmission and storage of video content.
[0079] In addressing the technical problem of insufficient resistance to brute-force attacks due to limited key space by adjusting the encryption window partitioning strategy based on the correlation between the initial key stream value and frame content, this invention introduces a frame content correlation index. This allows the size and movement step of the encryption window to no longer be fixed constants, but rather vary depending on factors such as the structural complexity and texture distribution of the current frame. This content-based adaptive adjustment significantly enhances the system's key space while maintaining high encryption efficiency. Traditional fixed-window mechanisms are easily cracked by attackers through brute-force attacks. This method, however, updates the encryption window parameters in real time and combines this with changes in chaotic system parameters, ensuring that the key stream generated by each encryption window is highly differentiated and unpredictable, thereby greatly enhancing the cryptographic system's resistance to brute-force attacks and its security. This feedback control mechanism ensures key stream diversity and effectively avoids security vulnerabilities caused by limited key space.
[0080] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this invention, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A chaotic video encryption method based on a sliding encryption window, characterized in that, including: Determine the sliding step and size of the encryption window according to the correlation between the initial value of the key stream and the frame content; Perform frame-by-frame sliding encryption window division on the video sequence to obtain the encrypted regions corresponding to each frame; Dynamically adjust the chaotic system parameters based on the pixel information within the encryption window to generate an encrypted key stream; Apply the key stream to the pixel points within the corresponding encryption window for chaotic scrambling and encryption.
2. The chaotic video encryption method based on a sliding encryption window according to claim 1, characterized in that, The determination of the sliding step and size of the encryption window according to the correlation between the initial value of the key stream and the frame content further includes: Obtain the similarity value S between the current frame and the previous frame; Calculate the ratio of the initial value K0 of the key stream to S, i.e., δ = |K0| / S; Adjust the sliding step according to the formula Step = a×δ + b, where a and b are preset constants; When Step < Step_min or Step > Step_max, set Step to Step_min or Step_max, where Step_min and Step_max are the minimum and maximum values of the set sliding step.
3. The chaotic video encryption method based on a sliding encryption window according to claim 2, characterized in that, The determination of the sliding step and size of the encryption window according to the correlation between the initial value of the key stream and the frame content further includes: Statistical frame change difference D; Combine the entropy value H of the initial value K0 of the key stream to generate a scaling factor ρ = H / D; Set the width of the encryption window according to the formula W = c×ρ + d, where c and d are preset constants; If W exceeds the maximum window size W_max, force it to be set to W_max.
4. The chaotic video encryption method based on a sliding encryption window according to claim 3, characterized in that, The determination of the sliding step and size of the encryption window according to the correlation between the initial value of the key stream and the frame content further includes: Calculate the area ratio R of the target object in the current frame; Divide the weight factor of R according to the modulus value mod(K0,n) of the initial value K0 of the key stream; Calculate the window height according to the formula H = e×R + f×mod(K0,n), where e and f are adjustment coefficients; If H is less than the minimum height H_min, take H = H_min.
5. The chaotic video encryption method based on a sliding encryption window according to claim 1, characterized in that, The frame-by-frame sliding encryption window division of the video sequence to obtain the encrypted regions corresponding to each frame further includes: Generate a random offset O according to the initial value of the key stream; Update the window starting position P in combination with the motion vector information M of each frame; Control the position of the window through the formula P = (P_prev + O)%width, where P_prev is the window starting position of the previous frame and width is the image width; If P is close to the boundary, perform clipping on the window to ensure it is within the frame range.
6. The chaotic video encryption method based on a sliding encryption window according to claim 5, characterized in that, The frame-by-frame sliding encryption window division of the video sequence to obtain the encrypted regions corresponding to each frame further includes: Use the dynamic frame rate F to control the number of encryption windows; Introduce a frame rate compensation factor λ = (F×F_avg) / F_avg to affect the number of windows, where F_avg is the average frame rate; Calculate the number of encrypted regions according to the formula N = round(α×λ + β), where α and β are system parameters; When N is greater than or equal to the maximum number of regions N_max, N is truncated to N_max.
7. The chaotic video encryption method based on a sliding encryption window according to claim 6, characterized in that, The frame-by-frame sliding encryption window division of the video sequence to obtain the encrypted regions corresponding to each frame further includes: Detect the illumination change ΔI in the video and use it as input for window density adjustment; The gap between encrypted regions is adjusted according to the formula gap=γ×(ΔI+θ), where γ is the amplification factor and θ is the preset offset term; If gap is less than 2 pixels, then set gap to 2; Otherwise, the gap will be used as the starting point reference for the next batch of encryption windows.
8. The chaotic video encryption method based on a sliding encryption window according to claim 1, characterized in that, The step of dynamically adjusting the chaotic system parameters based on the pixel information within the encryption window to generate the encryption key stream further includes: Statistical analysis of the color histogram distribution h in the encrypted window; The initial conditions are adjusted according to the formula x0=h_avg×σ+μ, where h_avg is the weighted average of the average values of each color in the color histogram, and μ and σ are the mean and standard deviation, respectively. Divide the brightness level L of the encrypted window into three intervals, and adjust the system gain factor g accordingly. The mapping function is dynamically selected based on different values of g to optimize the key stream generation effect.
9. The chaotic video encryption method based on a sliding encryption window according to claim 8, characterized in that, The step of dynamically adjusting the chaotic system parameters based on the pixel information within the encryption window to generate the encryption key stream further includes: Get the edge strength E of the current encryption window; The system delay time is updated according to the formula delay=ε×E+ζ, where ε and ζ are adjustment parameters; The delay time_delay is input into the nonlinear system model to generate the key stream; If delay causes system instability, limit it to the range [delay_min, delay_max], where delay_min and delay_max are the minimum and maximum values of the system delay time.
10. The chaotic video encryption method based on a sliding encryption window according to claim 1, characterized in that, The step of applying the key stream to the pixels within the corresponding encryption window for chaotic scrambling and encryption further includes: Perform a reverse sorting operation on each row in the window; The application uses Arnold mapping based on key stream, where the coordinate transformation formula is (x,y)=((x+y)%width,(x+2y)%height), where width is the image width and height is the image height; Construct a mask matrix M using the differences between adjacent bits in the key stream; By performing block-by-block replacement according to M, the encryption's resistance to brute-force attacks is improved.