title: AES encryption algorithm, paralel programming,java
body: <p>I have a project that write with a friend and we're in trouble with threads. code select a file, encrypt or decrypt it and write it a file(every file pdf,docx,mpeg,mkv,etc.). </p>
  
  <p>selected,opened with RandomAccessFile an input and output object,</p>
  
  <pre><code>byte[] temp new byte[16];
  readedByte=1;
  while(16*readedByte&lt;fileLenght){
                  for(i=0;i&lt;16;i++){
                  temp[i]=input.readByte();
                  }
                  byte[] newTemp=AES.encrypt(temp, k.getBytes("ISO-8859-9"));
                  output.write(newTemp);
                  readedByte++;
              }
  </code></pre>
  
  <p>i want to write a thread that do this job. thread will read 16 byte, encrypt them and write to output object.</p>