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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:05:41+00:00 2026-06-08T21:05:41+00:00

I use openssl and mysql encryption trough PHP. Currently, I write the key in

  • 0

I use openssl and mysql encryption trough PHP.
Currently, I write the key in the php source code, but I think it isn’t so secure. If someone gets the source (maybe FTP), encryption is broken.
So, how would you store encryption keys on Linux server? I can’t use another webserver to store the key.

  • 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-08T21:05:42+00:00Added an answer on June 8, 2026 at 9:05 pm

    I’m assuming you are using Apache.

    Put the secret data into an environment variable in /etc/apache2/envvars, set the owner to root and the permissions to 400.

    An attacker will have to compromise the server to put his hands on your key.

    You can also cook up a script that asks for the secret when Apache starts (annoying, but even more secure).

    Note that people with root access will always be able to get your key and trying to hide it from them is just a placebo.

    Placebo solution:

    • Make your application idle by default until you POST your key to an HTTPS page within the same application, save your key in a global variable and proceed with your business. You have to consider the PHP process’ lifecycle (when the process terminates, you have to resend your key).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use XAMPP on my desktop (Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 MySQL
I am trying to use OpenSSL in my application, and achieve a secure connection.
Though my project is java based but we still use OpenSSL to generate keys
If I use openssl to create a new key pair, use the private key
I'm trying to use openssl dsa implementation, but I'm very confused with the following
I'd like to use the OpenSSL library to decrypt some AES data. The code
I need to use openssl in java code. e.g. $ openssl genrsa -out private.pem
EDIT (the whole question, it was too unclear) I want to use OpenSSL.NET The
I have a multithreaded application that makes heavy use of OpenSSL in C. It
I want to use the following command: openssl x509 -noout -in /etc/pki/tls/certs/cert1.pem -enddate openssl

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.