1

Java Android Error "too much data for RSA block"

view story
linux-howto

http://stackoverflow.com – A have an error in my Android project (RSA encryption/decryption). The encryption passes OK, but when I trying to decrypt encrypted text, yhere are an error: "too much data for RSA block". How to solve this problem? code: public String Decrypt(String text) throws Exception { try{ Log.i("Crypto.java:Decrypt", text); RSAPrivateKey privateKey = (RSAPrivateKey)kp.getPrivate(); Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding"); cipher.init(Cipher.DECRYPT_MODE, privateKey); byte[] cipherData = cipher.doFinal(text.getBytes());// <----ERR (HowTos)