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

  • SEARCH
  • Home
  • 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 6055603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:16:59+00:00 2026-05-23T08:16:59+00:00

I have a php file which was encrypted using mcrypt and now we need

  • 0

I have a php file which was encrypted using mcrypt and now we need to decrypt it.

Here is the decryption:

abstract class Encryption_Abstract {
    const CYPHER = 'blowfish';
    const MODE = 'cfb';
    protected $key;
    public
    function __construct($key) {
        $this->key = $key;
    }
    public function encrypt($plaintext) {
        return $plaintext;
    }
    public function decrypt($crypttext) {
        return $crypttext;
    }
}
//decryptor
class Decryption extends Encryption_Abstract {
    function decrypt($crypttext) {
        $plaintext = '';
        $td = mcrypt_module_open(self::CYPHER, '', self::MODE, '');
        $ivsize = mcrypt_enc_get_iv_size($td);
        $iv = substr($crypttext, 0, $ivsize);
        $crypttext = substr($crypttext, $ivsize);
        if ($iv) {
            mcrypt_generic_init($td, $this - > key, $iv);
            $plaintext = mdecrypt_generic($td, $crypttext);
        }
        return $plaintext;
    }
}

Now this is how we instantiate it and then use it:

$enc = new Decryption(KEYS::PROD);  //KEYS::PROD is the decryption key
eval($enc->decrypt(file_get_contents("key_file.txt"))); //<--

Is there any way to not use eval? or is it my only option?

  • 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-05-23T08:17:00+00:00Added an answer on May 23, 2026 at 8:17 am

    If it’s a PHP file and you need to execute it, you can pipe it to a php cli.. but it would be the same. But how would you want to execute a PHP file without executing it?:)

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

Sidebar

Related Questions

I have a php file which I will be using as exclusively as an
I have created a class file database.php which handles all the sql queries and
I have a PHP file which has the following text: <div class=small_italic>This is what
I have a php file which connects to mysql database. I need to create
i have a php file from which i need to call a shell script
I have an index.php file which has to process many different file types. How
I have been using the PHP mcrypt module for encrypting sensitive data at my
The situation is next: I have php file, which parses a web-page. on that
I have a php file which prints an xml based on a MySql db.
I have a PHP file which edits an XML file, both on the same

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.