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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:27:59+00:00 2026-06-01T08:27:59+00:00

I have a simple JavaScript game that sends a score to PHP by adding

  • 0

I have a simple JavaScript game that sends a score to PHP by adding the score to the URL and then PHP uses GET to grab it. Obviously, this is about as easy to cheat as it could possibly be. I’d like to make it mildly irritating to cheat the game. I’m not looking for it to be fort nox or anything like that; there really is no point, but making it just a little harder to change your score would be nice.

So I’m looking to encrypt the numeric score using Crypto-JS and then decrypt it in PHP. I can’t figure out how to get the same answer with Crypto-JS as I’m getting with PHP’s mcrypt though.

I realize that anyone can read the code and figure out how to crack it in JavaScript; that’s ok. It’s not sensitive data at all, and if they go to that much trouble, they have expended more effort than it takes to beat the game anyways.

Alternate methods of scrambling the score would be fine too; just anything that really would require the average highschool user to put in more than 5 min of work to “crack” is good enough for my purposes. Any suggestions?

Crypto-JS: http://code.google.com/p/crypto-js/

  • 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-01T08:28:01+00:00Added an answer on June 1, 2026 at 8:28 am

    You could try to send the values in like:

    whatever.php?score=UNHASHED_SCORE&key=MD5(SALT . SCORE)
    

    Then in PHP check:

    $_GET['score'] == md5(SALT . $_GET['key'])
    

    Where the $salt value is some random string that you know the value of.

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

Sidebar

Related Questions

I have a simple JavaScript file that has three jQuery $document.ready functions. All three
I have this simple code that speaks for itself. <script language='javascript"> function check() {}
I am relatively new to programming with PHP. I have created a simple Javascript
I have simple JavaScript code that is using the Ajax API for fetching a
I have a simple javascript function that takes two variables. I need to pass
Im working on a simple html/javascript multiplication game, in which I have a multiplication
I have a simple javascript that I'd like to loop for multiple elements. Here's
I have a simple javascript program that's acting a little funny. When I try
I have developed a simple interactive Flash game, but now it appears that sometimes
I have a simple JavaScript Array object containing a few numbers. [267, 306, 108]

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.