   [java] encryption problem
  I'm wondering why the following doesn't work:Cipher encrypt = Cipher.getInstance("RSA");encrypt.init(Cipher.ENCRYPT_MODE, key);ByteArrayInputStream str = new ByteArrayInputStream(data);CipherInputStream cis = new CipherInputStream(str, encrypt);ByteArrayOutputStream out = new ByteArrayOutputStream();byte tmp[] = new byte[8];int i = cis.read(tmp);while (i != -1) {out.write(tmp, 0, i);i = cis.read(tmp);}//WORKS ALWAYS TILL 52 characthers//return encrypt.doFinal(data);//this DON"T WORK AL the times buyt sometimes doesreturn out.toString().getBytes();the doFinal method always works but only upto 52 bytesprobably i'm overlooking sth. but can't see directly waht   
  Wild guess, but is the key 52 charactors? if it's the same length as the key, then you need to make a loop to make sure it loops through the key as many times as necessary. That was a problem I had when I was writing some basic encryption in Turing for a programming contest, and I ran out of time..But yeah, that could be the problem. (sorry I can't offer a solution, since I'm not used to encryption in Java and would code everything myself, i can't help with java's interface, it could just be that you need to encode each 52 character string one at a timeand out put them each time, ro something liek that)   