Generating password protected zip files from ruby on rails

Multi tool use
Generating password protected zip files from ruby on rails
Has anyone had any luck creating password protected zip files in rails?
I spent a bunch of hours trying to get Chilkat's 64 bit linux gem working on OSX. I got it listed as installed in my gem list, but I was never able to instantiate anything.
I'm on 1.9.2, 3.2.3, OSX.
Thanks in advance!
2 Answers
2
Have you tried ZipRuby? It seems to have an encryption method.
Zip::Archive.encrypt('filename.zip', 'password')
Sorry haven't tried it myself so can't be absolutely sure.
Glad it helped, if you need to go gem hunting in the future, try here ruby-toolbox.com
– Saifis
May 9 '12 at 2:39
Now, it is possible using RubyZip library. Note, as of now, it's marked as "Experimental". But, it works. Also note, AES Encryption is not yet supported.
https://github.com/rubyzip/rubyzip#password-protection-experimental
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Fantastic! Not sure how that gem got past me, but it works perfectly. Thanks very much for the tip!
– Mishaux
May 8 '12 at 17:51