kbpgp icon indicating copy to clipboard operation
kbpgp copied to clipboard

Support for streams

Open CaptnH00k opened this issue 7 years ago • 10 comments

In your documentation you mention, that streams will be supported in the future ("For arbitrarily large files, streams will come soon in kbpgp's future."). Any ETA/progress/anything on this?

CaptnH00k avatar Jul 05 '17 19:07 CaptnH00k

IT turned out to be insanely complicated, and soured us on PGP

maxtaco avatar Jul 05 '17 19:07 maxtaco

I've been looking in the past for a way and just revisited this topic about an hour ago. There's definitely a need for stream support. Any (even brief) feedback on complexities or hurdles, or advice to abandon ship on writing it? I need to find a way to use streams to implement it since we have to do it on some huge files, but I'd love to not go down a rabbit hole if at all possible.

kellym avatar Jul 05 '17 21:07 kellym

Nevermind. Found a fork of openpgpjs that supports streams and I see what you mean :). Well, I've got somewhere to start from at least.

kellym avatar Jul 05 '17 21:07 kellym

I recommend saltpack instead.

maxtaco avatar Jul 05 '17 22:07 maxtaco

I feared this answer, but it seems to be the same reason why openpgpjs didn't implement it yet. Still @kellym, which fork did you find that supports streams? Only know there was a pr for openpgpjs which kinda implemented it, but only for encryption if i remember it correctly. PR was this one: https://github.com/openpgpjs/openpgpjs/pull/321

Thanks for the saltpack recommendation, looks promising, but sadly no javascript.

CaptnH00k avatar Jul 06 '17 12:07 CaptnH00k

We have a js implementation. Cc @oconnor663

maxtaco avatar Jul 06 '17 12:07 maxtaco

The problem you are going to hit with steaming is that you have to create new sub streams in flight. For instance you decrypt, and you say oh shit, I have to start inflating now because there is a zlib stream inside the encrypted stream. It is an utter mess.

maxtaco avatar Jul 06 '17 12:07 maxtaco

@CaptnH00k Yes, that openpgpjs PR was the one I had initially seen.

@maxtaco Ah, I haven't done enough digging in to come across that issue, that's a great point. We may end up having to create a custom solution then, since we only require encryption.

kellym avatar Jul 06 '17 14:07 kellym

FYI @CaptnH00k, I opened a PR https://github.com/openpgpjs/openpgpjs/pull/567 that hopefully improves upon the existing streaming versions out there. It's still incomplete, but more complete than the alternatives.

Wish I could've done it for kbpgp instead, but I was deterred by the use of IcedCoffeeScript... I've been using CoffeeScript for what feels like ages but didn't feel like adopting ICS when everything else is moving to straight ES6.

kellym avatar Jul 27 '17 22:07 kellym

As of 2020, any plans to still add support?

HR avatar Mar 07 '20 20:03 HR