Hello, I think I may have found a flaw and wanted to let
you know. I am running PHP 4.3.9 and I believe am using
the 2.4 mcrypt. I have come across a very peculiar
situation in which mcrypt works in encrypting and
decrypting 9 out of 10 times. I have tested it when
used within a class member function and outside. When
outside it seems to work almost (ALMOST) everytime,
but defintely more than when used as part of a class
member function. Every now and then there is an error
where the IV is not the correct size for decrypt.
However, the exact same IV is used just steps before to
encrypt the data and it is accepted just fine then.
I have attached a file that is called test.php. It has the
class well documented and shows the problem.
Everystep is echoed to the screen, so you can follow
the progress of the script. When the error occurs, you
will notice that everything in the steps add up, but yet
it still does not decrypt correctly. Just a note. When
using this inside a class that extends the class that
holds the functions, there are even more errors. Yet,
there are not errors everytime with any of them.
file to show error in action