Chaotic systems are widely used in image encryption due to their sensitivity to initial values. and many image encryption algorithms based on chaotic systems have been studied in the past few years. In order to obtain a simpler encryption algorithm, this work firstly proposes a new two-dimensional discrete hyperchaotic map, which has a large chaotic interval and Lyapunov exponent, and then uses the map to generate two chaotic sequences, and use these sequences to generate three S-boxes, and combine them in pairs, and finally twelve S-boxes are obtained. Then, the elements of the plaintext image are grouped, each group of pixels is summed, and then modular operations are used to specify specific S-boxes. Next, each set of elements is bitwise XOR with the corresponding S-box. Finally, the cipher image is obtained by scrambling using chaotic signal.Experiments show that compared with some other encryption algorithms, the proposed S-box based encryption method has higher security, and it resists to common attack.