This is a follow up for this question.
I was wondering about the IV. As I see this an random IV is created for decrypt and encrypt separately. And it is not passed along with the data to be decrypted.
If I am not mistaken, an IV can very well be public and be transmitted along with the encrypted data. However it should be random and not re-used all the time (for example taking a series of zeros).
But to decrypt successfully the same IV must be used that has been used to encrypt.
How can the decrypt function work properly when generating a new, random IV?
And it does work, i tested it...