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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:27:23+00:00 2026-06-06T16:27:23+00:00

I have application with needs to have access to some sensitive data(in this case

  • 0

I have application with needs to have access to some sensitive data(in this case cryptographic keys). At this point I’m storing them in file so they can be read while script is proccessed.

However it’s not safe enough according to security standards I have to follow, because if server root account is compromised someone may easily read & copy them.

Typical solution is to mount external memory containg keys, start application, unmount memory and let in run with data cached in ram. Of course since it’s PHP it’s not possible.

Is there any other solution? At this point my only idea is small side application with will serve keys however I’m not sure how should it work to be safe.

  • 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-06T16:27:24+00:00Added an answer on June 6, 2026 at 4:27 pm

    As you know already, no matter what you do, if the key is available to the application, it will certainly be available to malicious code that has gained root access on the server, and most probably to code that has gained access to the UID under which the application runs too. It’s just a question of how easy it is.

    Buy since your application is not long-running, it sounds like you will have to accept a level of risk beyond that.

    Your idea is to use a daemon of some sort which keeps the keys in RAM and can be queried by the application. That works, but you probably already realise that if your application can query it, then malicious code can query it too. If you choose that option anyway, consider using memcached (why reinvent the wheel?).

    The only other option I can think of would be to write an Apache module (in C) that loads the secret at system startup time (after which the persistent copy of the secret is unmounted) and a PHP extension (in C) to get the secret from the Apache module that lives in the same process. That assumes you’re using PHP as an Apache module, not as an external process. But to me this sounds like overkill, because it is quite complex and it doesn’t actually remove the risk.

    Have you considered what to do about swap space? You can use mlock or similar (in C) to keep the secret from being written to swap if it’s in a confined location, but it would be difficult to protect it in this way once it’s been handed over to the PHP interpreter. So you had better run the system without swap.

    Consider a design change that will confine the secret to a single location in a long-running daemon (probably not written in PHP) and have the PHP application delegate the cryptographic functions that need access to the secret to this daemon.

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

Sidebar

Related Questions

I have a Silverlight application that needs to retrieve some data from my database.
I have a JavaEE application that needs to access a file in order to
Scenario: I have a console application that needs to access a network share with
I have created application where i just need to access data form assets folder.
I'm building an application that needs to store sensitive information, which means the data
I'm currently writing a little drawing application that needs to access pixel data for
In our application we are caching some frequently used data. Recently we have developed
I have some services that an application needs running in order for some of
I have a VB.NET application where various objects are going to access some common
I am developing an AIR application. This application needs some hardware accesses that are

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.