title: Using BouncyCastle's ChaCha for file encryption
body: <p>I'm hoping to encrypt a few files using ChaCha, so I wonder if it's appropriate to use <a href="https://github.com/bcgit/bc-java/blob/master/core/src/main/java/org/bouncycastle/crypto/tls/Chacha20Poly1305.java#L14" rel="nofollow"><code>Chacha20Poly1305</code></a>. It seems that this class is designed for TLS, so does that mean it's not designed for file encryption? The methods inside, e.g., <code>encodePlaintext()</code> and <code>decodeCiphertext()</code> appear to work with text rather than binary files.</p>
  
  <p>If that's the case, does anyone know how to work with BC's ChaCha implementation for file encryption?</p>