09-10-2012 05:35 AM
I'm working with encryption, and posting encrypted data to a web service. This works fine on the simulator, however when posting to a login service on the device, I'm getting an 'Invalid Credentials' error, which I suspect is being caused by the encryption not working right.
Im using BlockEncryptor, with PKCS5FormatterEngine and a generated InitializationVector.
BlockEncryptor encryptor = new BlockEncryptor(new PKCS5FormatterEngine( new AESCBCEncryptorEngine(new AESKey( Base64InputStream.decode(Constants.AES_PRIVATE_KEY
)), iv)), outputStream);
Can anyone think of a reason why this would work in Sim, but not on device?
Solved! Go to Solution.
09-10-2012 09:36 AM
I have an update.
I fixed the IV on both device and Sim and compared the posted strings. All matched apart from 'Email'
I then tried encrypting email without the @ sign, and they matched!
Still.. No idea why the device isn't encrypting the @ sign right
09-10-2012 11:55 AM
Erm... Lets just say be careful with Upper/Lower case.. Apparently they produce different ciphertext
Yeah.. Lets never speak of this again