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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:19:21+00:00 2026-06-17T16:19:21+00:00

I am using OpenSSL to encrypt files on my server. The command I am

  • 0

I am using OpenSSL to encrypt files on my server.

The command I am using is similar to this one:

 openssl enc -aes-256-cbc -salt -in file.txt \ -out file.enc -pass pass:mySillyPassword

My worry is that the password will be saved in the logs of my server.

What is the best way to encrypt my files with OpenSSL without having the password saved on the server logs?

IMPORTANT I am executing this command via PHP. The the command is stored in a shell script file. That PHP just executes.

UPDATE
I am generating different keys for each file encrypted.

  • 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-17T16:19:23+00:00Added an answer on June 17, 2026 at 4:19 pm

    use php-oopenssl.. instead, http://php.net/manual/en/function.openssl-encrypt.php . Also, using a shell script is very vulnerable. Anyone might see the password from ps -ax command or similar.

    Assuming that ONLY ROOT can see the password, the password (that too encrypted ideally by 2nd-hardcoded password) should be read from a root:root owned file with 0600 chmod options. The web-server when starts as a root, will have access rights to that file. The server can set that file content (i.e the password) as an env-variable for php files into some global variable. I had tried something like that long time ago & it worked.

    -Trilok.

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

Sidebar

Related Questions

We know we can encrypt a file with openssl using this command: openssl aes-256-cbc
I am trying to re-create this openssl command in C#: openssl enc –e –aes-256-cbc
I have to encrypt an xml file using openssl command line or a C
I'm looking for an example of using OpenSSL's AES CCM encryption. Apparently, this is
I am trying to take an AES HMAC of a file using the openssl
When using blowfish algorithm from openssl library, one can encrypt and decrypt any data.
I'm using OpenSSl to encrypt and decrypt files based on CMS/SMIME. Normally I load
I have a .bmp image. I wanted to encrypt the image file using openssl
I want to encrypt a file using openssl. I can do it by using
I'm using the following working code to decrypt a file: #include <openssl/aes.h> #include <stdio.h>

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.