In this paper, an image encryption algorithm based on compressive sensing (CS) and a hyperchaotic system is proposed. This new two-dimensional logical coupling sine chaotic map (2D-LCSCM) has a wider range of chaos, better ergodicity and hyperchaotic properties rather than for existing chaotic maps. By combining with the novel chaotic map and CS, we design an image compression encryption algorithm with good reconstruction accuracy and high security. In the substitution phase of the encryption process, the security performance of the algorithm is improved by the nonlinear transformation of the dynamic substitution box (S-box) and the linear transformation of the chaotic sequences. The performance analyses of the experimental results show that the proposed algorithm can resist various attacks and is highly secure.