A new image encryption algorithm based on chaos