Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by jrobertomar · Aug 25, 2015 at 10:55 AM · phpsecurityserversidesend-variable

Safest way to send data to server

Hi there. I was wondering, what's the best and safest way to send data, such as high scores, to my (php) server ?

I was doing a little research (but the articles seemed kinda old) and read that using MD5 is a good idea, using a secret key. For instance, I could send the username, score and the already encripted concatenated string (username+score+secret_key) to the server and validate them there.

But is there a better (safest) way to do it? The example above is kinda simple, but what if it's more complex like leveling up or claiming a prize/bonus (even for these, I can think of ways around like sending the exact new level, or checking if the prize is still available... I don't know. I can't think of a really complex example)... but that's not my point, my point is... is there other option? Or using MD5 + a secret key the best way?

Thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by YoungDeveloper · Aug 25, 2015 at 10:58 AM

Safest way would be not sending score at all. Instead you send client input and other activities. Server checks are those actions legit or not. If yes, action is executed and if result produces score, new score is added, saved and sent back to user just for visualization.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fafase · Aug 25, 2015 at 11:21 AM 0
Share

If you keep values on device then anyone with basic understanding of google search can modify your values.

There are sniffer program that will track your variables and allow the user to pass any value.

Sending data back to server enables possibility to track illegal data bumps. A few years back, Angry Birds had some browser hack to enable unlimited power-ups. People were getting high score that were discouraging the legit players.

Rovio just went to wipe any high score and data that looked suspicious on their server.

This is the kind of things you want to keep in $$anonymous$$d.

Using GameCenter is already a first step as it allows to control the values that should be passed.

avatar image YoungDeveloper · Aug 25, 2015 at 11:28 AM 0
Share

@fafase That's the reason i don't use PUN, as you trust the user with the data he sends. You will never be able to protect outgoing data, that's why data legitimacy should be checked on server side. I know devs who are trying to create client side anti hack checkers (for PUN in this example), but it's been 2 and half years an they are still struggling. They have eli$$anonymous$$ated 10 year olds though.

avatar image jrobertomar · Aug 25, 2015 at 12:10 PM 0
Share

Thanks. I get your idea, but I believe is the same thing if I send the client inputs or actions to my server since I'm still sending data. That's why I mentioned the other example above: where the player reclaims a prize, I would ask the server if the user can reclaim that prize AND if the prize is still available.

I've worked with Flash games for a while and I've always been dealing with people who try to manipulate the POST or GET data even from the browser, or creating their own forms (html) and then send data to my server. I'm developing mobile games now with unity and I know that anyone with enough knowledge (not the average user) would be able to see what data i'm sending to my server, that's why I was wondering if there's still a safest way to do so.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How can I receive a WWWForm image using PHP? Example script 1 Answer

security: about showing the path of my php file 2 Answers

Protect the PHP file that connects to mySQL 2 Answers

Unity to PHP/MySQL: password and username security 1 Answer

php, sql security 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges