title: How to encrypt paperclip attachments before uploading them to S3?
body: <p>I'm working on a Ruby on Rails web app. The user can upload files and they get stored to Amazons S3. For file uploads I use the paperclip gem.</p>
  
  <p>How can I encrypt files with AES256 before they get saved? I know S3 has server side encryption, but that doesn't really work for me because I'm opening the site in the mobile app and would like to handle decryption on the client.</p>
  
  <p>I know I can use the paperclip processors or the before_post_process methods but how can I get the file that is being uploaded and change it?</p>