Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8967643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:17:25+00:00 2026-06-15T17:17:25+00:00

I have an encrypted file file = File.new(encrypted.file, r) that I would like to

  • 0

I have an encrypted file file = File.new("encrypted.file", "r") that I would like to require in Ruby after decryption. I do not want to decrypt, save, require, and delete the file.

What I do now is:

str=""
file.each do |line|
     str+=line
end#do

str = doSomeDecryption(str)

I would like to require str in some way. Any ideas? eval(str) is not an option; it really has to be ‘requireable’.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:17:27+00:00Added an answer on June 15, 2026 at 5:17 pm

    Strictly speaking, require doesn’t load a file, it loads a resource; with the right overload of Kernel#require, you can do almost anything. Some folks have made versions that use open-uri to load code from a remote server. If you want to implement this in pure Ruby, you will need to use eval. See http_require (https://github.com/astrails/http_require) for its implementation.

    If you want to implement this as an extension, you may be able to reduce the potential attack surface area, but you’re still going to be implementing either a save-to-disk-then-require or an eval. (Strictly speaking, although I can’t find the code in the interpreter right at the moment, require itself essentially does an eval.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pgp-encrypted file that I need to extract data from at runtime.
I have an aes encrypted mp3 file that I need to play in iOS;
I have a winform (in C#) that encrypt and decrypt a file... it's OK,
I would like to create a file myFile that encrypts the first part using
I want to distribute s/w licenses as encrypted files. I create a new file
I'm trying to decrypt a file in unmanaged C++ that was previously encrypted with
Let's say I have an encrypted file on an iPhone and every time I
If I have the encrypted RAR file, and I also have the unencrypted file,
In my applications web.config file I have a connection string stored. I encrypted it
I have to encrypt/decrypt some sensitive information in a Xml file? Yes I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.