Jump to content

[SOLVED] mcrypt excess characters?


gyrus

Recommended Posts

Not sure how to title this since it's a bit bizarre..

 

I have a script that encrypts a string using mcrypt, stores the encrypted data into a mysql database as a BLOB, then pulls, and decrypts the data. Everything works fine but I'm getting this character � unknown.png as a filler if the string isn't 16 characters. This is only showing up in Firefox, not Safari or IE. Just wondering if this is a issue I should be concerned about.

 

Thanks for any help!

Link to comment
https://forums.phpfreaks.com/topic/163696-solved-mcrypt-excess-characters/
Share on other sites

The data that will be encrypted with the given cipher and mode. If the size of the data is not n * blocksize, the data will be padded with '\0'.

 

They are NULL (0) characters. You should use a function like trim() or rtrim() to remove them.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.