The application relates to the technical field of image
encryption, and discloses a
plaintext-related image
encryption method based on a bidirectional dynamic window, which comprises the following steps: calculating the hash value of a
plaintext image, combining the hash value with a
master key to generate a
session key, using the
session key to disturb a
chaotic system to generate first to fourth
chaotic sequences; using the first
chaotic sequence to perform pixel position replacement on the
plaintext image to obtain a scrambled image; performing high-low bit exchange of pixel values on the scrambled image to output an
intermediate image; using the second and third chaotic sequences to construct a forward dynamic window scheduling table and a reverse dynamic window scheduling table respectively, and sequentially performing forward window-by-window
diffusion calculation and reverse traversal
diffusion calculation on the
intermediate image; and using a two-dimensional matrix remodeled by the fourth chaotic sequence to perform feedback superposition calculation to output a
ciphertext image. The application establishes the correlation between plaintext and
encryption parameters, and introduces a bidirectional dynamic window
diffusion mechanism, thereby avoiding the regularity of fixed diffusion step length, and improving the ability of the
algorithm to
resist selective plaintext attacks and the
avalanche effect.