Error in the size when I Encrypt an Object with RSA
<p>I have to Encrypt a message as follows:</p>

<pre><code>EB(receiver, “message”)
</code></pre>

<p>B is the receiver public key. So i made a class called <code>EncryptionParameter</code> that contains two <code>String</code>s, receiver and the message. After i read the public key of the receiver:</p>

<pre><code>EncryptionParameter encryptionParameter = new EncryptionParameter ();
encryptionParameter.setEncrParameter(reciver , message);
// the reciverand the message are both String

// I created  a class to convert an object to byte[]  called ObjectToByte
ObjectToByte otp = new ObjectToByte();
byte[] MByte = otp.convert(encryptionParameter); // convert the object to byte[]
//  Encrypt the message 
Cipher c = Cipher.getInstance("RSA");
c.init(Cipher.ENCRYPT_MODE,reciverKey); 
byte[] myEncryptMessage = c.doFinal(MByte);
</code></pre>

<p>I see an error saying "117bytes limit while encrypting." I tried another way which is</p>

<pre><code>Cipher c = Cipher.getInstance("RSA");
c.init(Cipher.ENCRYPT_MODE,senderKey); 
SealedObject myEncryptMessage = new SealedObject( encryptionParameter, c);
</code></pre>

<p>The same error appeared so is there any way to encrypt an object?</p>
