<div dir="ltr">This is something I've been interested in too, so with some guidance from Vincent I put together a short example of doing this:<div><br></div><div><a href="https://gist.github.com/snoyberg/20243aae347b38ad09daaf8b129e2efb">https://gist.github.com/snoyberg/20243aae347b38ad09daaf8b129e2efb</a><br></div><div><br></div><div>It's got some magic values in a few places (especially that 65!), and the usage of leftovers/B.append is far from efficient. However, it should get the general idea across.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 6, 2017 at 7:58 AM, Ivan Lazar Miljenovic <span dir="ltr"><<a href="mailto:ivan.miljenovic@gmail.com" target="_blank">ivan.miljenovic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have a use case for needing to use public key cryptography to<br>
encrypt a large amount of data in a streaming fashion (get it out of a<br>
DB, encrypt, put into an AWS S3 bucket).<br>
<br>
The command-line gpg tool seems to be able to encrypt/decrypt data<br>
from stdin to stdout in a streaming fashion, but in my attempts to use<br>
it it seems very file-based for things like the keys to use (whereas I<br>
would prefer to be able to pass the public key as an actual value<br>
rather than a file; if nothing else because this is for tools that<br>
don't have email addresses to use and base their keys on for<br>
addressing).<br>
<br>
Is there an existing library that can achieve this using<br>
conduit/pipes/whatever? cryptonite-conduit only covers hashing,<br>
hOpenPGP is poorly documented and I can't work out how to use it<br>
("just follow the types" is difficult when Haddock docs don't link to<br>
the required types (seems to be because it uses the "import Module as<br>
X" trick for re-exporting everything but then everything from those<br>
modules isn't available).<br>
<br>
Can anyone recommend a solution?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Ivan Lazar Miljenovic<br>
<a href="mailto:Ivan.Miljenovic@gmail.com">Ivan.Miljenovic@gmail.com</a><br>
<a href="http://IvanMiljenovic.wordpress.com" rel="noreferrer" target="_blank">http://IvanMiljenovic.<wbr>wordpress.com</a><br>
______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</font></span></blockquote></div><br></div>