I have an audio file that I encrypted and decrypted using the AES algorithm.

After the decryption is complete I output the audio file to a new file.

I wanted to calculate the root mean square between the original file and the newly decrypted file. It came out as 0. Why is that? Shouldn't the processing have introduced some form of error to the output audio file?

  • 2
    $\begingroup$ AES, like most (all?) encryption algorithms, is lossless. The decrypted file is identical to the original. $\endgroup$
    – MBaz
    Mar 14, 2023 at 0:42
  • 2
    $\begingroup$ @MBaz yeah, I'd say that it's the definition of "encryption" that if you decrypt it with the correct key, you get 100% the original data. Tushar, this feels like someone is letting you do something practical to make you review the basics section from a cryptography chapter in some textbook or lecture? $\endgroup$ Mar 14, 2023 at 7:25

1 Answer 1


Processing any file with an algorithm that is reversible does not change the file in any way. This includes AES encryption and decryption, compressing and decompressing with a generic algorithm like ZIP, or using lossless audio codecs like FLAC to an audio file.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.