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
I suggest you use specific cipher initialization: as an example,
Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding");
will work on both. The exception you are getting (BadPaddingException) is occuring because the default cipher initialization padding appears to be different between the desktop JVM and the Android JVM.