NOTE: Coming back to this later as I\'ve been unable to find a working solution. Draining the input streams manually instead of using BufferedReaders doesn
This may or may not be the problem (in the decrypt function)
BufferedReader gpgOutput = new BufferedReader(new InputStreamReader(gpgProcess.getInputStream()));
BufferedReader gpgErrorOutput = new BufferedReader(new InputStreamReader(gpgProcess.getInputStream()));
BufferedWriter gpgInput = new BufferedWriter(new OutputStreamWriter(gpgProcess.getOutputStream()));
You are wrapping the result of getInputStream
twice. Obviously gpgErrorOutput
should be wrapping the error stream, not the input stream.