I am using RSA to encrypt username and password on Android and decrypt them on server (tomcat 6, java 1.6). Android Encryption:
PublicKey pubKey = readPu
Firstly, it looks like you're initializing both ciphers with the public key. Encryption uses public key, decryption used private key. I hope that's just a typo though.
I had a lot of trouble with RSA encryption as well, much was trial and error. I suggest you try another provider. I managed to implement RSA using BouncyCastle.
Cipher wrapper = Cipher.getInstance("RSA", "BC");
wrapper.init(Cipher.ENCRYPT_MODE, publicKey);
encryptedData= wrapper.doFinal(unencryptedData);
Although, I generated my own keypair since this was a session encryption.
kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(1024);
KeyPair kp = kpg.genKeyPair();
publicKey = kp.getPublic();
privateKey = kp.getPrivate();