Tumzadoc
2005-06-10 08:32:01 UTC
Hi
I'm trying to encrypt a 256 bytes of data using a 2048 bits RSA key.
----Code Snippet----
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, rsaPublic);
encryptedData = cipher.doFinal(originalData);
----End of Code Snippet----
It gives me the following exception :
javax.crypto.IllegalBlockSizeException: Data must not be longer than 245
bytes
Is it possible to encrypt data of over 246 bytes using RSA? If yes how do
i go about doing it
Thanx
I'm trying to encrypt a 256 bytes of data using a 2048 bits RSA key.
----Code Snippet----
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, rsaPublic);
encryptedData = cipher.doFinal(originalData);
----End of Code Snippet----
It gives me the following exception :
javax.crypto.IllegalBlockSizeException: Data must not be longer than 245
bytes
Is it possible to encrypt data of over 246 bytes using RSA? If yes how do
i go about doing it
Thanx