title: Cryptography in Java
body: <p>I'm making an app that encrypts some files. I want to use gnu's cryptix library. It says it is no longer developed since 2005, but I guess it has everything I need... should I use something else?</p>
  
  <p>And I have a question about encrypting a single file. Right now I do it with a loop like this:</p>
  
  <pre><code>for(int i=0; i+block_size &lt; bdata.length; i += block_size)
      cipher.encryptBlock(bdata, i, cdata, i);
  </code></pre>
  
  <p>So my question is how to encrypt the last block that may not have the same size as the block_size. I was thinking maybe a should add some extra data to the last block, but than I don't know how to decrypt that...</p>