The present invention provides an image encryption method based on chaotic mapping and chaotic S-box substitution in the technical field of image encryption, including: step S10, obtaining a color image file and performing hash calculation to obtain a hash value, based on the hash value calculation system Parameters; Step S20, generating four initial values of the four-dimensional hyperchaotic map based on the hash value, and then obtaining four sets of chaotic pseudo-random sequences; Step S30, extracting sequences based on the chaotic pseudo-random sequences and system parameters W z , using the sequence W z And use the S box of AES algorithm to generate chaotic S box; Step S40, carry out Arno l d scrambling to color image file to obtain scrambling image, utilize chaotic S box to carry out byte substitution to scrambling image and obtain replacement image; Step S50, Using chaotic pseudo-random sequence and system parameters, image diffusion encryption is performed on the three components of RGB in the substitution image to obtain three ciphertext data, and the encrypted image is obtained based on each ciphertext data. The invention has the advantages of greatly improving the security of image encryption.