Java API questions (JAR distribution & input stream wrapping)
Posted: Thu Aug 09, 2018 7:16 pm
1) I'm interested in using the AESCrypt Java API in a project, but I noticed that it (along with the source) only seems to be available as a class file inside of a ZIP on the download page. Is there an official JAR file distribution or anything like that available? I can't even seem to find the source on Github anywhere.
2) When it comes to encrypting an InputStream the AESCrypt API takes an approach that makes actually streaming the encryption a bit more difficult than it needs to be. Instead of implementing an encrypting InputStream that is returned to the caller (Java's own CipherInputStream, for example), it writes the bytes to an OutputStream. Unfortunately in order to bridge an OutputStream to InputStream to feed to another consumer it requires piped streams along with spawning an extra thread. I have gotten this to work even while streaming large files, but it's not ideal compared to the one-line, single-threaded approach usable by CipherInputStream and other libraries that use it (OpenSSL). I think this can be implemented without too much difficulty by using a SequenceInputStream and/or an extension of CipherInputStream that handles keeping the HMAC updated along with handling the trailer bytes.
Is there a place where I can request this as a feature? As the code doesn't appear to have a Github presence I can't do it there, nor could I contribute an implementation.
Thank you!
2) When it comes to encrypting an InputStream the AESCrypt API takes an approach that makes actually streaming the encryption a bit more difficult than it needs to be. Instead of implementing an encrypting InputStream that is returned to the caller (Java's own CipherInputStream, for example), it writes the bytes to an OutputStream. Unfortunately in order to bridge an OutputStream to InputStream to feed to another consumer it requires piped streams along with spawning an extra thread. I have gotten this to work even while streaming large files, but it's not ideal compared to the one-line, single-threaded approach usable by CipherInputStream and other libraries that use it (OpenSSL). I think this can be implemented without too much difficulty by using a SequenceInputStream and/or an extension of CipherInputStream that handles keeping the HMAC updated along with handling the trailer bytes.
Is there a place where I can request this as a feature? As the code doesn't appear to have a Github presence I can't do it there, nor could I contribute an implementation.
Thank you!