A chaotic permutation and diffusion based image encryption algorithm for secure communications