In this paper, we propose an images encryption algorithm based on the quaternion multiplication and the XOR function. The proposed algorithm processes the image in 32 quaternions i.e. block of 32 × 4. For each quaternion, the algorithm exor the ith image quaternion and the ith key quaternion. The key quaternion is changed in each block using the quaternion multiplication. The randomness of the proposed algorithm is evaluated by diehard package. Several other analyses are provided to evaluate the performances of this encryption scheme. These analyses demonstrate that the proposed algorithm is with high security level and fast run speed and can be competitive with some other recently proposed image encryption schemes.