Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Q] Encrypting file at disk and passing it to http client #93

Open
kakoni opened this issue Dec 15, 2017 · 1 comment
Open

[Q] Encrypting file at disk and passing it to http client #93

kakoni opened this issue Dec 15, 2017 · 1 comment

Comments

@kakoni
Copy link

kakoni commented Dec 15, 2017

Please delete this issue if this is not the proper place to ask. Anyway;
I've got temporary files on disk which I need to encrypt and pass on to http client (that reads IO/streams).

Not sure how to do this right, Pass file and StringIO (as a target) to SymmetricEncryption::Writer.encrypt and then construct new StringIO object from the result?

@reidmorrison
Copy link
Owner

To read an encrypted file as a stream into another method, such as a controller download method, or http client:

    SymmetricEncryption::Reader.open('temp_file.enc') do |io|
     # Pass the decrypted stream into another library or method
      other_library(io)
    end

Note: Not all io methods are implemented. The above works for Rails controller download actions/streams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants