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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:25:54+00:00 2026-05-31T07:25:54+00:00

I’ve got two servers on two locations. Server 1 subtracts client-information (like addresses, email

  • 0

I’ve got two servers on two locations.
Server 1 subtracts client-information (like addresses, email and telephone numbers) of server 2 via a php CURL session with a custom user agent which server 2 checks. Server 2 serves a JSON string.

I want to make sure two things:

  1. If some one sniffs my packages it won’t see the actual data;
  2. If some one tries to call the php page on server 2 (with the proper
    user agent) en got served something it isn’t making sense to them
    (e.g.: the clients email or telephone number).

After looking at different methods I was thinking to encrypt the JSON text string on server 2; get it with curl from server 1; and decrypt it with a shared key.

Things i would like to know:

  1. Which cipher should I use?
  2. Is this overkill?
  3. Or is there a better way to achieve this?

BTW: merging the two servers is not an option!

  • 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-31T07:25:56+00:00Added an answer on May 31, 2026 at 7:25 am

    Instead of implementing your own encryption routine, I’d recommend serving your json data from server 2 over https, that will take take care of the encryption nicely.

    Note that you do not need to purchase a certificate, you can self-sign server2 and have curl in server1 allow “insecure” https connection (insecure means that the cert is not trusted, but the data is still encrypted).

    To whitelist who is allowed to request data from server 2, whitelist by ip if you are able. Another way (or in addition), could be a simple signature system with a shared secret.

    For illustration, set up a custom http header when server 1 makes the request (say “My-Signature”) and use a set up your signature “algorithm” (simple example in php below):

    $sig = sha1($user_agent
                . $date_header_value
                . $http_request_path
                . $http_query_string
                . $http_raw_post_payload
                . $shared_secret);
    

    Then you can set up the request header:

    My-Signature: $sig
    

    You can make your signature system as complicated as you’d like. The idea is that server2 knows the same signature “recipe”, can extract all the fields it needs from the request headers, the query string, and post payload, and use the shared secret to compute the signature on its side.

    Compare the computed signature, to the signature passed in the My-Signature header and serve the request if they match. If not, serve a 403 response page.

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

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I have some data like this: 1 2 3 4 5 9 2 6

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.