[Haskell-cafe] Encrypting streamed data

Michael Snoyman michael at snoyman.com
Thu Jul 6 12:19:37 UTC 2017

This is something I've been interested in too, so with some guidance from
Vincent I put together a short example of doing this:


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.

On Thu, Jul 6, 2017 at 7:58 AM, Ivan Lazar Miljenovic <
ivan.miljenovic at gmail.com> wrote:

> I have a use case for needing to use public key cryptography to
> encrypt a large amount of data in a streaming fashion (get it out of a
> DB, encrypt, put into an AWS S3 bucket).
> The command-line gpg tool seems to be able to encrypt/decrypt data
> from stdin to stdout in a streaming fashion, but in my attempts to use
> it it seems very file-based for things like the keys to use (whereas I
> would prefer to be able to pass the public key as an actual value
> rather than a file; if nothing else because this is for tools that
> don't have email addresses to use and base their keys on for
> addressing).
> Is there an existing library that can achieve this using
> conduit/pipes/whatever? cryptonite-conduit only covers hashing,
> hOpenPGP is poorly documented and I can't work out how to use it
> ("just follow the types" is difficult when Haddock docs don't link to
> the required types (seems to be because it uses the "import Module as
> X" trick for re-exporting everything but then everything from those
> modules isn't available).
> Can anyone recommend a solution?
> --
> Ivan Lazar Miljenovic
> Ivan.Miljenovic at gmail.com
> http://IvanMiljenovic.wordpress.com
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170706/67e34d7c/attachment-0001.html>

More information about the Haskell-Cafe mailing list