How to decrypt the last block.
843810Feb 6 2005 — edited Apr 22 2008Hi
I am using the Bouncy Castle RSA implementation. The thing is that i am able to successfully encode and decode the files. But the problem is with the last block.
I am using for encryption the following piece of code.
byte[] buf = new byte[100];
while(read!=-1)
{
read = bis.read(buf);
byte buff2 []=c.doFinal(buff);
if(read>=0)
fr.write(buff2);
}
and for the Decryption I use the inverse of the above code. with the only difference that now my buf = new byte[128]. But the thing is that i get some junk bytes at the end of the last block......because of the padding effect. Is there any way i can get rid of this junk values.