I have a application requirement to encrypt a
string in
Java on a portable device (such as Android), then have that output ciphertext decryptable on a client-side browser using Javascript. The encryption key is pre-shared.
The primary reason for this is to preserve some purely private data - even from the servers that house it on the web within a database. Think of it as a privacy preserving data transport and storage mechanism.
I've found many implementations of AES256 in Java and Javascript, but they seem to not interoperate well. I've found JS Encrypt / Java Decrypt pairs, but that's backwards from what I am looking for. My thought on this is simply that I am borking some initialization/config in the Java implementation, but I've yet for find the magic combination.
The JS reference implementation I am using is at
http://www.movable-type.co.uk/scripts/aes.html - I have yet to get any Java implementation to work against it successfully.
Additional note: The byte array is base64 encoded before transmission and decoded in the browser before the attempt to decrypt. I've manually verified that the bytes are unchanged during transmission.
Any help on this would be appreciated.
Even vague generalities would be helpful to reduce the problem scope
Thanks!