Based on the combination of quaternion numbers, residual matrices, and chaotic attractors, a new cryptosystem is proposed for multimedia processing files such as images and audio. The key employed in this encryption schema consists of an image with a wide and sensitive range, obtained from the Julia Quaternion set rendered using a computational tool. Due to the use of quaternion matrices mixing the information between RGB layers and audio samples was possible, whereas using XOR operation and residual matrices modulus 257, added high sensitivity to small perturbations during encryption, key preparation and decryption processes, to such an extent that a minimal change in the image or in the audio leads to a totally different encryption result. The use of dynamic programming also reduced the processing time for matrix operations on the $\mathbb {Z}_{257}$
ℤ
257
ring. To corroborate security of the algorithm, different tests were performed, including the National Institute of Standards and Technology test obtaining different indicators that were compared with other scientific references of similar works, finding behavioral patterns in accordance with those referenced works.