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 9230245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:46:37+00:00 2026-06-18T05:46:37+00:00

I would like to store sensitive user information in an object which would be

  • 0

I would like to store sensitive user information in an object which would be saved as a file on the server (rather than in a database).

The user’s password or other key would be used to generate an encryption key.

The data object would be loaded from the server whenever the user logs in and provides the correct key, it would be then stored in the Session. All of this would happen other SSL.

I am not familiar with serialization but I would imagine it would work something like this.

function loadData($id, $key)
{
    //open file from storage
    $fh = fopen("data/" . $id);
    $obj = fh->read //not sure what the read function would be....
    $obj = decrypt($obj, $key) // some sort of decryption function using openssl_decrpt
    $obj = unserialize($obj
    if ($obj != null) //if successful...
    {
        session_start();
        $_SESSION['data'] = $obj;

        return true;
    }

    return false;
}

function saveData($id, $key)
{
    //open file from storage
    $fh = fopen("data/" . $id);
    $obj = serialize($_SESSION(["data"]);
    $obj = encrypt($obj, $key);
    $obj = serialize($obj

    if ($obj != null) //if successful...
    {
        fh->write($obj) //not sure what the write function would be....

        return true;
    }

    return false;
}

Also, would this be this method be secure?

  • 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-18T05:46:39+00:00Added an answer on June 18, 2026 at 5:46 am

    The weak point is your server. If someone has access to your server, he/she can:

    1. Run a dictionary attack on the encrypted object (which can be very effective if the key is a short password).
    2. Attach to your server process during request handling and get the decrypted object (or the key) from memory.

    To mitigate the first problem you should use salt, but there is really not a lot you can do about the second problem- just make sure your server is not compromised…

    (Note that running a dictionary attack is much simpler than reverse engineering a process and requires fewer permissions. So, depending on your use-case, it may be reasonable to ignore the second problem)

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

Sidebar

Related Questions

I would like to store some sensitive information in sessionStorage to use it across
I would like to store all paths to headers in separate file. I'm going
I would like to store some information at the request scope when using google
I would like to store sensitive userdata like name and address in a mysql
In my application, I store sensitive user data (like bank details) and the user
I have a certificate .p12 and .crt and I would like store the public
I would like to store the points whenever touchesMoved is called. So far everything
I would like to store historical equity price data in a table in the
I would like to store a small profile picture of my users in their
I would like to store large dataset generated in Python in a Django model.

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.