Re: [android-developers] ArrayIndexOutOfBoundsException when decrypting file

2014-06-12 Thread gnugu
If I could only type properly. It should read: *It always only fails at the END OF input stream.* On Thursday, June 12, 2014 10:32:45 AM UTC-7, gnugu wrote: > > NOTE2: When decrypting the file using > > public void encryptDecrypt(InputStream input, OutputStream output) { > final int BU

Re: [android-developers] ArrayIndexOutOfBoundsException when decrypting file

2014-06-12 Thread gnugu
NOTE2: When decrypting the file using public void encryptDecrypt(InputStream input, OutputStream output) { final int BUFFER_SIZE = 1024; try { CipherOutputStream cipherStream = new CipherOutputStream(output, _cipher); byte[] buffer

Re: [android-developers] ArrayIndexOutOfBoundsException when decrypting file

2014-06-12 Thread gnugu
NOTE: By 'text' in the post above I mean a short data from sql db. In which case I use doFinal(data) and am not using cipher streams at all. On Thursday, June 12, 2014 9:44:35 AM UTC-7, gnugu wrote: > > Hi Nikolay, > Thanks for your response. > > I have tried _cipher = Cipher.getInstance(CIPHER_

Re: [android-developers] ArrayIndexOutOfBoundsException when decrypting file

2014-06-12 Thread gnugu
Hi Nikolay, Thanks for your response. I have tried _cipher = Cipher.getInstance(CIPHER_PROVIDER, "BC"); before. Makes no difference. I fact on my Android 4.4.3 when I do not specify "BC" it still instantiates BouncyCastle. What bothers me is that when I'm decrypting texts it works fine. Fails

Re: [android-developers] ArrayIndexOutOfBoundsException when decrypting file

2014-06-10 Thread Nikolay Elenkov
On Sat, Jun 7, 2014 at 6:52 AM, gnugu wrote: > Hi I am getting the following exception, when decrypting a file on Android > based on user supplied password: > > Caused by: java.lang.ArrayIndexOutOfBoundsException: src.length=1024 > srcPos=1008 dst.length=16 dstPos=16 length=16 > at java.la