OpenSSL is in the Ruby standard library. Here''s a blog with some
sample usage: http://weblog.masukomi.org/index.pl/view/encryption%20in%20ruby
On 12/17/05, Ezra Zygmuntowicz
<ezra-SD1UcFUIF7QjH4SCZfkgnw@public.gmane.org>
wrote:>
> On Dec 17, 2005, at 12:10 PM, Mark Haliday wrote:
>
> > Anyone know of a good (fast) way to encrypt/decrypt uploaded files in
> > RoR? I''ve seen this project: http://ezcrypto.rubyforge.org/
but it
> > only seems to encrypt strings and such. I need to encrypt files once
> > they are uploaded, then decrypt them when they request the file back.
> >
> > Any ideas?
> >
> > Thanks,
> >
> > Mark
> >
>
> Mark-
>
> If you want to do this one way I can think of is the use the
> ezcrypto lib you found and with a few other steps you could make it
> work. What you could do is once the file is uploaded, read it into a
> string and Base64 encode it before it goes in the db or on the
> filesystem. Then when it comes time to send the file down to a user
> again, you can read it in and unencode it form base64 and then
> decrypt it and use send_file or send_data to get it to the browser.
>
> There might be a much better way to do this with less overhead but
> this is one way.
>
> Cheers-
>
> -Ezra Zygmuntowicz
> WebMaster
> Yakima Herald-Republic Newspaper
> ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org
> 509-577-7732
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>