Hi,
I remember some issues with passing binary strings. Hence I think I went with base64 encoding. So you need to prepare a JS function that decodes a character string from base64 enconding, perfroms encryption and then encodes result in base64,
Your description also mentions that counter mode is used. Is this a right mode? Is other party expecting this mode to be used?
Cheers