{"action":"created","issue":{"url":"https://api.github.com/repos/rubyzip/rubyzip/issues/209","labels_url":"https://api.github.com/repos/rubyzip/rubyzip/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/rubyzip/rubyzip/issues/209/comments","events_url":"https://api.github.com/repos/rubyzip/rubyzip/issues/209/events","html_url":"https://github.com/rubyzip/rubyzip/pull/209","id":54538576,"number":209,"title":"Support for Traditional Encryption (ZipCrypto) + Tests","user":{"login":"johnnyshields","id":27655,"avatar_url":"https://avatars.githubusercontent.com/u/27655?v=3","gravatar_id":"","url":"https://api.github.com/users/johnnyshields","html_url":"https://github.com/johnnyshields","followers_url":"https://api.github.com/users/johnnyshields/followers","following_url":"https://api.github.com/users/johnnyshields/following{/other_user}","gists_url":"https://api.github.com/users/johnnyshields/gists{/gist_id}","starred_url":"https://api.github.com/users/johnnyshields/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnnyshields/subscriptions","organizations_url":"https://api.github.com/users/johnnyshields/orgs","repos_url":"https://api.github.com/users/johnnyshields/repos","events_url":"https://api.github.com/users/johnnyshields/events{/privacy}","received_events_url":"https://api.github.com/users/johnnyshields/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-16T04:23:52Z","updated_at":"2015-01-17T10:30:23Z","closed_at":"2015-01-17T10:20:52Z","pull_request":{"url":"https://api.github.com/repos/rubyzip/rubyzip/pulls/209","html_url":"https://github.com/rubyzip/rubyzip/pull/209","diff_url":"https://github.com/rubyzip/rubyzip/pull/209.diff","patch_url":"https://github.com/rubyzip/rubyzip/pull/209.patch"},"body":"This PR adds support for traditional encryption. The interface is:\r\n\r\n```ruby\r\n      Zip::OutputStream.write_buffer(::StringIO.new(''), Zip::TraditionalEncrypter.new('password')) do |out|\r\n        out.put_next_entry(\"my_file.txt\")\r\n        out.write my_data\r\n      end.string\r\n```\r\n\r\nThis preserves backwards compatibility with existing rubyzip, however I'd suggest that it might be cleaner to do something like an options-hash based interface in future versions.\r\n\r\nThe PR contains unit and integration tests. It seems that InfoZip uses a different crc32 function from Zlib, so we had to include a zip file generated with [archive-zip](https://github.com/javanthropus/archive-zip) into the repo (couldn't get InfoZip-based generators to work.)\r\n\r\nThere is a separate PR for AES encryption (#179) which is read only. We believe our code structure is a cleaner one which allows for both read and write and it should be fairly straightforward to adapt #179 into our structure.\r\n\r\nBig thanks to @matsu911 who did the work.\r\n"},"comment":{"url":"https://api.github.com/repos/rubyzip/rubyzip/issues/comments/70362092","html_url":"https://github.com/rubyzip/rubyzip/pull/209#issuecomment-70362092","issue_url":"https://api.github.com/repos/rubyzip/rubyzip/issues/209","id":70362092,"user":{"login":"simonoff","id":14304,"avatar_url":"https://avatars.githubusercontent.com/u/14304?v=3","gravatar_id":"","url":"https://api.github.com/users/simonoff","html_url":"https://github.com/simonoff","followers_url":"https://api.github.com/users/simonoff/followers","following_url":"https://api.github.com/users/simonoff/following{/other_user}","gists_url":"https://api.github.com/users/simonoff/gists{/gist_id}","starred_url":"https://api.github.com/users/simonoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonoff/subscriptions","organizations_url":"https://api.github.com/users/simonoff/orgs","repos_url":"https://api.github.com/users/simonoff/repos","events_url":"https://api.github.com/users/simonoff/events{/privacy}","received_events_url":"https://api.github.com/users/simonoff/received_events","type":"User","site_admin":false},"created_at":"2015-01-17T10:30:23Z","updated_at":"2015-01-17T10:30:23Z","body":"@johnnyshields n/p. But would be great to update README with info how to use this feature."}}