Encrypting files in Ruby

D

Demec

So far the tutorials I've seen are for encrypting text and then
decrypting it back.
So for example you have a
plaintext = "some text"

you encrypt it and the you decrypt it depending on how you encrypted
it.

What I am looking for is to encrypt a whole file and then store it.
for example I allow my users to upload .doc/.xls files in a Rails app.
I want to encrypt those files so I would not store them like that, and
in case a user wants to download it back the app will decrypt it and
then send it to user.

How can I do this ?
 
D

Dejan Dimic

So far the tutorials I've seen are for encrypting text and then
decrypting it back.
So for example you have a
 plaintext = "some text"

you encrypt it and the you decrypt it depending on how you encrypted
it.

What I am looking for is to encrypt a whole file and then store it.
for example I allow my users to upload .doc/.xls files in a Rails app.
I want to encrypt those files so I would not store them like that, and
in case a user wants to download it back the app will decrypt it and
then send it to user.

How can I do this ?

Try http://www.google.com/search?q=ruby+encrypt+decrypt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top