Encrypting file using GnuPG on command line hangs forever
<p>There is one file I want to encrypt with GnuPG by </p>

<pre><code>    gpg2 --homedir=~/.gnupg --always-trust=true --recipient="BlahBlah" --encrypt=/path/to/file --output=/path/to/output_file
</code></pre>

<p>However this command seems to hang forever and never return. Interestingly, after I interrupt process, there is indeed <code>/path/to/output_file</code> created , however the bytes written there is much bigger than raw payload (for example my <code>/path/to/file</code> is only of 5 bytes but it turns out there are nearly 200 bytes written to <code>/path/to/output_file</code>).</p>

<p>There must be something wrong, but I really couldn't figure out what is it.</p>

<p>I have in advance imported the key for <code>BlahBlah</code> by <code>gpg --import key.asc</code>. It happens both for GnuPG 1 and GnuPG 2.</p>