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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:14:43+00:00 2026-05-19T10:14:43+00:00

I have a php document repository application running on windows apache, this application will

  • 0

I have a php document repository application running on windows apache, this application will aes-encrypt any uploaded document with the following command:

echo MyPass34 | openssl.exe aes-256-cbc -pass stdin -salt -in somefile.pdf -out somefile.pdf

and also decrypt them when they are downloaded, with the following command:

echo MyPass34 | openssl.exe aes-256-cbc -pass stdin -d -in somefile.pdf -out decriptedfile.pdf

the application has been working fine so far, people are uploading and downloading their files while they are kept encrypted on the server, the problem now is this application has been moved to an apache linux server, and now the files that where encrypted on windows are not correctly decrypted on linux.

Why is this? Is there a possible tweak to the decryption command so it correctly decrypt that files again?

PS: New files that are encrypted on linux are correctly decrypted, same as in windows, is the encoded-on-windows decoded-on-linux case that is failing.

  • 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-19T10:14:43+00:00Added an answer on May 19, 2026 at 10:14 am

    I found the solution :-), the problem is the windows echo command adds three characters to the end of password, that are space,CR and LF characters, and the linux echo command seems to not feed those characters and so the openssl command is not receiving the same password used to encrypt.

    The solution was to add those three characters to the password in Linux, that is possible because the echo command has escape sequences to insert hexadecimal values.So, following my example, the correct decrypt command that is now working for me in linux is:

    echo $'MyPass34\x20\x0d\x0a' | /usr/bin/openssl aes-256-cbc -pass stdin -d -in somefile.pdf -out decriptedfile.pdf
    

    Hope this can help someone!

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

Sidebar

Related Questions

I have this little function function makewindows(){ child1 = window.open (about:blank); child1.document.write(<?php echo htmlspecialchars(json_encode($row2['ARTICLE_DESC']),
I have the following script: $(document).ready(function() { $('#slideSelect').change(function(){ $('#slideViewer img').attr('src', $(this).val() + '.png'); });
Is there any way to have PHP automatically call a function, before a script
I have a php server that is running my domain name. For testing purposes
I have a PHP application that displays a list of options to a user.
I am trying to run web application scripted in PHP on windows server 2008.
I have a php page and the behavior is this: the page is opened
I have a php document that deletes tweets. I want to get http_code from
I have a php page call it page.php . In this page I am
I have this PHP code which attempts to populate an HTML ul list. I'm

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.