I’m using the Triple DES algorithm for encrypting data using PHP. Then, I’m decrypting it using a C# Windows Forms application.
With some data, when I decrypt it, I find \0\0\0\0\0\0\0\0 at the end of the original text that was encrypted in PHP. What could be causing that?
Encryption algorithms require the data to be a multiple of a certain number of bytes. If the data isn’t the right length, null characters are added to pad the data. This is what you’re seeing after decryption. This is expected, and you just need to strip them.