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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:37:32+00:00 2026-06-17T12:37:32+00:00

I’m making an application that communicates with a php page on my server. With

  • 0

I’m making an application that communicates with a php page on my server.

With that page I can set scores into the database.

I use post variables to store scores in the db, everything works fine, but if I analyze with wireshark what my game is sending to the page and I re-do the POST request with different data, the page is storing that data on the db.

How can I accept data storing ONLY from my game?

The game is a Java applet, the server is written in PHP

  • 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-17T12:37:33+00:00Added an answer on June 17, 2026 at 12:37 pm

    You need a way to let the php script know that the data received is genuine.

    client side

    Put the all the data to be sent concatenated into a string. Put into the string also the current date and time (client side). You need to send that information too.

    Then “salt” the string with some more data, either a static string “xyw#q”wz” for example or better something you derive from the sent data.

    Let’s call that string the check-string

    Finally calculate the MD5 hash of the check-string and send it along with your data and current date and time.

    server side

    The php script receive all the data and the MD5 hash.

    Do the same operations on the data received (concatenation, salting, etc..) to re-build the check-string, exactly in the same way you did client-side.

    Calculate its MD5 and compare the two hashes: the one received and the one just calculated.

    If they match then data is genuine and can be added to the database. Otherwise it is not or it have been reposted.

    –

    summary

    client : data -> build string -> make MD5 from string -> send data & MD5

    server : data (received) -> build string -> make MD5 from string

    (client side MD5 == server side MD5) ? YES data genuine : NO fake or repost

    –

    how it works

    for any set of data there is only one valid MD5 hash. If someone wants to post fake data he need to pass a valid MD5 too. But he doesn’t know how the MD5 is built up.

    To make things harder for the hacker I told you to “salt” the string with some random data.

    This is just one way (the easier I think) to achieve what you want.

    Note that if the client side app would have been written in JavaScript (instead of Java) this approach would have been very vulnerable as the JS code would have exposed the process of building up the check-string.

    As a last note: that’s not bulletproof. A smart hacker could still guess how you build up the check-string or decompile the Java and (with some effort) find how the check-string is build up to generate the MD5 for his fake data.

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

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
Let's say I'm outputting a post title and in our database, it's Hello Y’all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.