title: Directly encrypt ncdu export with aespipe
body: <p>I successfully use the ncdu export function:</p>
  <p><code>ncdu -1xo- -e /media/xxx | gzip &gt; xxx.ncdu.gz</code></p>
  <p>And extract/use it after when I want :</p>
  <p><code>zcat xxx.ncdu.gz | ncdu -f- --color dark -e</code></p>
  <p>Now I would like do the same, but to get a encrypted file (with password asked) as output. The aim is that the export is directly exported encrypted, so no readable export on the device without the password.
  I tried :</p>
  <p><code>ncdu -1xo- -e /media/xxx | gzip | aespipe &gt; xxx.ncdu.gz.aes</code></p>
  <p>But I think the ncdu start listing while aespipe is asking password, so it doesn't work.
  Is there a way to do this in one bash line, first the password is asked, then the ncdu start and store the result in the encrypted gzip output?</p>
  <p>Maybe I could use:</p>
  <pre><code>echo &quot;entrez le mot de passe&quot; &amp;&amp; read mypassword &amp;&amp; ncdu -1xo- -e /media/xxx | gzip | aespipe -P $mypassword &gt; xxx.ncdu.gz.aes | mypassword=&quot;&quot;
  </code></pre>
  <p>But I don't know if it is safe or if the password is stored somewhere? In fact the password is displayed and it better shouldn't.</p>
  <p>Anyway, after that I am unable to use the encrypted (is it really done?) export with ncdu:</p>
  <pre><code>echo &quot;entrez le mot de passe&quot; &amp;&amp; read mypassword &amp;&amp; zcat aespipe -d -P $mypassword xxx.ncdu.gz.aes | ncdu -f- --color dark -e | mypassword=&quot;&quot;
  </code></pre>
  <p>What am I missing? I think aespipe is waiting a password file instead a user entry.</p>
  <p>I tried this with openssl too:</p>
  <pre><code>echo &quot;entrez le mot de passe&quot; &amp;&amp; read mypassword &amp;&amp; ncdu -1xo- -e /media/xxx | gzip | openssl enc -base64 -e -aes-256-cbc -nosalt -pass pass:$mypassword &gt; xxx.ncdu.gz.openssl | mypassword=&quot;&quot;
  </code></pre>
  <p>with no more success</p>
  <p>Thanks for reading, sorry for my terrible English level :)</p>