This paper presents a new hyper chaos-based image encryption algorithm which makes use of dynamic DNA coding and SHA-256. Different DNA encoding rules are adopted for different pixels, according to a random matrix generated by a five-dimension hyper-chaotic system with the initial value related to the SHA-256 hash value of the plaintext image. Since the initial values of the five-dimension hyper-chaos system are related to the hash value of the explicit image, the five-dimension hyper-chaos system generates distinct key streams per plain text image, even for the same initial conditions of the chaos system. Therefore, the new encryption algorithm can withstand the chosen-plaintext attacks. Moreover, the dynamic encoding technology enhances the security of the ciphertext image. The result of this experiment and relevant safety analysis show that the algorithm has a large space and good tatistical characteristics of cipher image. In addition, the ciphertext is very impressible to the plaintext and the secret key, can bear chosen-plaintext attacks. As a result, this new algorithm has good application prospects in image secure communication and storage applications.