mcrypt leaving garbage at end of decoded string
I stumbled upon a problem with the mcrypt library – when decoding (using DES and ECB mode) the encoded string is trailed with leading non-printalbe ASCII characters. So an encoded “mysecret1” becomes “mysecret1”.
Not shure what causes it, but i found a hack to get rid of those nasty low ASCII chars:
$password = preg_replace("/[\\x00-\\x1F]/", "", $password);
Vay!!!ìíå ïîíðàâèëîñü!!!