oregontrail256
oregontrail256

Reputation: 657

Zip and AES encrypt in Rails

What's the easiest way to zip and encrypt a file with AES (128 or 256) in a Rails app, so that the zip archive can be opened with WinZip?

Requirements:

  1. Zip archive can be opened by WinZip (so no 7-zip)
  2. Zip archive is encrypted with AES-128 or AES-256 (which WinZip supports)

Gems:

  1. Rubyzip: doesn't support encryption
  2. Zipruby: supports only the traditional/legacy non-AES encryption which is significantly less secure.

Any advice on what I can do here?

Thanks!

Upvotes: 1

Views: 1017

Answers (1)

Nick Veys
Nick Veys

Reputation: 23939

Are commercial products out of the question? Chilkat Ruby Zip appears to support WinZip AES. The example code looks pretty temptingly easy.

There also appears to be a Java library available. If you're running in JRuby... Or if you feel like porting!

Upvotes: 2

Related Questions