{"action":"created","issue":{"url":"https://api.github.com/repos/openpgpjs/openpgpjs/issues/321","repository_url":"https://api.github.com/repos/openpgpjs/openpgpjs","labels_url":"https://api.github.com/repos/openpgpjs/openpgpjs/issues/321/labels{/name}","comments_url":"https://api.github.com/repos/openpgpjs/openpgpjs/issues/321/comments","events_url":"https://api.github.com/repos/openpgpjs/openpgpjs/issues/321/events","html_url":"https://github.com/openpgpjs/openpgpjs/pull/321","id":80512666,"number":321,"title":"Implement steaming encryption","user":{"login":"evilaliv3","id":217034,"avatar_url":"https://avatars.githubusercontent.com/u/217034?v=3","gravatar_id":"","url":"https://api.github.com/users/evilaliv3","html_url":"https://github.com/evilaliv3","followers_url":"https://api.github.com/users/evilaliv3/followers","following_url":"https://api.github.com/users/evilaliv3/following{/other_user}","gists_url":"https://api.github.com/users/evilaliv3/gists{/gist_id}","starred_url":"https://api.github.com/users/evilaliv3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evilaliv3/subscriptions","organizations_url":"https://api.github.com/users/evilaliv3/orgs","repos_url":"https://api.github.com/users/evilaliv3/repos","events_url":"https://api.github.com/users/evilaliv3/events{/privacy}","received_events_url":"https://api.github.com/users/evilaliv3/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-05-25T11:57:32Z","updated_at":"2016-02-14T15:00:08Z","closed_at":"2016-02-13T15:56:53Z","pull_request":{"url":"https://api.github.com/repos/openpgpjs/openpgpjs/pulls/321","html_url":"https://github.com/openpgpjs/openpgpjs/pull/321","diff_url":"https://github.com/openpgpjs/openpgpjs/pull/321.diff","patch_url":"https://github.com/openpgpjs/openpgpjs/pull/321.patch"},"body":"This pull requests supersedes @hellais https://github.com/openpgpjs/openpgpjs/pull/306.\r\n\r\nIn relation to that one it:\r\n- removes the deterministic key generation part that will be evenutally provided in a separated pull request;\r\n- uses stream opts.objectMode = true; to make the patch compatible with Browsers/Phantomjs;\r\n- adds unittests towards all encryption algos:  tripledes, cast5, blowfish, aes128, aes192, aes256, twofish;\r\n- adds unittests for both integregrity protexted modes: true/false."},"comment":{"url":"https://api.github.com/repos/openpgpjs/openpgpjs/issues/comments/183903268","html_url":"https://github.com/openpgpjs/openpgpjs/pull/321#issuecomment-183903268","issue_url":"https://api.github.com/repos/openpgpjs/openpgpjs/issues/321","id":183903268,"user":{"login":"tanx","id":1374174,"avatar_url":"https://avatars.githubusercontent.com/u/1374174?v=3","gravatar_id":"","url":"https://api.github.com/users/tanx","html_url":"https://github.com/tanx","followers_url":"https://api.github.com/users/tanx/followers","following_url":"https://api.github.com/users/tanx/following{/other_user}","gists_url":"https://api.github.com/users/tanx/gists{/gist_id}","starred_url":"https://api.github.com/users/tanx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanx/subscriptions","organizations_url":"https://api.github.com/users/tanx/orgs","repos_url":"https://api.github.com/users/tanx/repos","events_url":"https://api.github.com/users/tanx/events{/privacy}","received_events_url":"https://api.github.com/users/tanx/received_events","type":"User","site_admin":false},"created_at":"2016-02-14T15:00:08Z","updated_at":"2016-02-14T15:00:08Z","body":"> by now the file encryption possibilities of openpgp are highly capped by the RAM of the user, in fact supposing one (e.g. protonmail) wants to upload a file of 30MB, for sure would have to keep in ram at once 30MB (of plaintext read at once) + at least 30MB of encrypted payload => twice the size of the file uploaded.\r\n> \r\n> having a streaming capability instead one would have in ram even only a plaintext chunk + an encrypted chunk depending on the ram availability.\r\n\r\nI understand the need for streaming and generally have nothing against support for it in OpenPGP.js. But not how it is currently implemented in the proposed PR. I'm currently trying to create a more modular design by pushing parts that do not need to be in the core library out into their own GitHub repos and consuming them via npm e.g. see the [asmCrypto-lite](https://github.com/openpgpjs/asmcrypto-lite) module, which is a dependency of the core library.\r\n\r\nI don't want to become the next angular.js with a big monolithic library that everyone is afraid to include into their site. The angular developers have learned from their mistake and Angular 2 is much more modular and the core library is much leaner. I think this is the way modern JS libraries need to be written going forward... put only the important stuff in the core library and push everything optional into separate modules.\r\n\r\nHow's this?\r\n\r\n1. Port the new `stream` module to a separate repo. I created this one under the openpgpjs org for you: https://github.com/openpgpjs/openpgp-stream\r\n2. Include all the dependencies you need including forge and whatnot (our forth SHA lib it seems) in that repo.\r\n3. Create a browserify build in the openpgp-stream repo that creates a file called `openpgp-stream.js`\r\n4. Change `require('./stream')` to `require('openpgp-stream')` [here](https://github.com/openpgpjs/openpgpjs/pull/321/files#diff-1fdf421c05c1140f6d71444ea2b27638R18).\r\n5. Set the `'openpgp-stream'` module as `external` in the current browserify builds\r\n6. Add the `openpgp-stream.js` to your app sitting right next the the `openpgp.js` core lib.\r\n\r\nThis setup should allow you to have everything you need, but keep all the dependencies out of the core lib. Everyone wins. What do you thing?"}}