iOS Question Encrypted communication between B4I and an ASP.NET application

ThePuiu

Active Member
Licensed User
I know this issue has been discussed before, but I want to know if anyone has found a solution.

I use HTTP job.PostString (...) to communicate with an ASP.NET application. I would like the parameters sent in the call to be encrypted and decrypted on the server and also the response from the server to be encrypted and decrypted in B4I. In B4A I did this, but it does not seem to work for B4I.
Does anyone have a solution?
 

OliverA

Expert
Licensed User

emexes

Well-Known Member
Licensed User
In B4A I did this, but it does not seem to work for B4I.
Well, that's a timely discovery of yours :) because it matches what aaronk and I just found:

https://www.b4x.com/android/forum/t...characters-when-encrypted.109855/#post-686396

which is that the B4I Cipher.Decrypt function seems to be adding (or not removing) padding nulls added to the end of the message to (presumably) make it a multiple of the encryption block size.
Does anyone have a solution?
For text, trim trailing nulls per example in post should work. For binary data that might contain nulls (byte value 0), perhaps add a length count at the beginning of the message, just before it is encrypted.
 
Top