  Recently, an image encryption algorithm using block-based scrambling and
image filtering has been proposed by Hua et al. In this paper, we analyze the
security problems of the encryption algorithm in detail and break the
encryption by a codebook attack. We construct an linear relation between
plain-images and cipher-images by differential cryptanalysis. With this linear
relation, we build a codebook containing $(M \times N + 1)$ pairs of
plain-images and cipher-images, where $M\times N$ is the size of images. The
proposed codebook attack indicates that the encryption scheme is insecure. To
resist the codebook attack, an improved algorithm is proposed. Experimental
results show that the improved algorithm not only inherits the merits of the
original scheme, but also has stronger security against the differential
cryptanalysis.
