i'm guessing that base64decode does something wrong with the encrypted data, but only on Android.
I'm using the same kind of script in WIndows and there it works perfectly without errors.
The result from decrypt says:Bad Decrypt or Wrong Final Block Length
I did some tests to rule some thing out:
delete first 16 characters, works on windows, bad decrypt on Android
leave first 16 characters where they are, then it's Wrong Final Block Length on both platforms
tried with and without URLencode when encrypting, no change. URLdecode messes it up while decrypting.
So no URLDecode while decrypting. And as this works on Windows IDE/Standalone, it should work on Android too, it's the same engine.
Decrypting itself with a encrypted pasword and salted, decrypting works OK on Android.
So i checked if it had to do with getting the data from DB, but that's not the case.
If you Encrypt it, Base64Encode it and then Base64Decode it and Decrypt it directly on Android it gives an error as result too. Works ok on Windows.
So after retreiving some data from DB
Code: Select all
on mouseUp put "some encrypted and base64encoded data" into tMe #base64 decode put the base64Decode of tMe into tSixfour #decrypt it put fDecr(tSixfour) into tDecry #put it somewhere put tDecry into fld"i can read it can i" end mouseUp private function fDecr vText set the itemDelimiter to comma decrypt vText using "aes256" with password "!@#$%^&*" and salt"*&^%$#@" at "256" bit --answer the result return it end fDecr
Code: Select all
function fEncr vText set the itemDelimiter to comma encrypt vText using "aes256" with password "!@#$%^&*" and salt"*&^%$#@" at "256" bit delete char 1 to 16 of it return it end fEncr
Hope anyone understand what i mean.
Seems like a bug to me for Android.