An Exception caught at the line
encryptedData = cipher.doFinal(data); javax.crypto.IllegalBlockSizeException: Data must not be longer than 501 bytes at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:344) The key size is given by: keyPairGenerator.initialize(4096);
How to solve this problem without increasing the size of key?