in reply to Re^3: Add PKCS#7 padding
in thread Add PKCS#7 padding

I have fixed the problem. .net (microsoft) considers unicode to be utf16 not utf8. Once I converted my string to utf16 the encryption worked fine.

Crazy microsoft.

thanks for all your help in this. I have updated my initial code to show the utf16 encoding so this may help others in the future. I did notice that UTF16 did not work but UTF16le did. Not sure what the difference is.