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 then 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. 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 ? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Demec wrote:> 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 then 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. 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 ?There is no distinction between character based data or binary data in the world of encryption. All that''s important is that you take a string of bits, mix it with some pseudo-randomly generated bits, based on a known algorithm, and store a string of bits. In cryptography terms the string "some text" in your example would be called the cleartext. Not to be confused with plaintext. Cleartext can just as easily be binary data instead of a string. The algorithm doesn''t care at all what makes up those cleartext bits. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Robert Walker wrote:> There is no distinction between character based data or binary data in > the world of encryption. All that''s important is that you take a string > of bits, mix it with some pseudo-randomly generated bits, based on a > known algorithm, and store a string of bits.Small clarification: I should have said a "stream of bits" rather than "string of bits." -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Maybe Matching Threads
- bash script hook lda_mailbox_autocreate for generate mail-crypt user encrypted private key with user password
- bash script hook lda_mailbox_autocreate for generate mail-crypt user encrypted private key with user password
- Encrypting Ogg
- Encrypting large amounts of text
- OpenSSH and CBC