Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 lliviu · Dec 16, 2015 at 02:10 PM · apiphpdecompile

How to communicate securely with a server

Hello I want to implement Leaderboards in my game. The game will talk to a server running php through an api. My question is, how can i make sure the request came from the game.

I mean the user can look at the network traffic and understand how he can fake requests. Let's say I use ssl and I make a more a token algorithm with salt on the client and check it on the server. The user can decompile the client code (c#), have a look and figure out how to fake the token on his own and where/how to send the requests.

Is there a safe way to do this client-server communication?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by wibble82 · Dec 16, 2015 at 04:16 PM

There's no super safe way - ultimately if you give enough users the code, and enough of them want to break it, somebody will eventually find a way!

However you can take steps to make that harder - hopefully hard enough that nobody can be bothered hacking your leaderboards :)

Some techniques I've used, or recommended / talked over with other developers:

  • Write a very simple native plugin with a function on that returns your key

  • Make the key dependent on something odd in your game - maybe you pass your 'grass' texture into your native plugin, which xors bytes 11 to 93 with a key stored in the plugin and returns it :)

  • Possibly put some plain text in there: "WeAreASmallCompanyWhoLoveMakingGreatGamesSoPleaseDontBreakAnything"

  • Consider how you can regularly backup / quickly restore the leader boards and ship patches to change the key in the event that somebody malicious does get a hold of it

  • Have 7 different keys for different days of the week, just to annoy anybody trying to break them! (again inside the native plugin)

As Bruce Dawson (MS) once said, the only reliable way to avoid a game being cracked is to make a bad game - then nobody will want to crack it! Your best bet is just to make ithe process of doing so annoying enough so people don't want to.

Comment
Add comment · 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
1

Answer by cubecoders · Dec 17, 2015 at 02:44 PM

Some games that are leaderboard based send a server a copy of the entire session replay, and the server actually runs the replay in a headless copy of the game and verifies the time that way instead of just trusting that the leaderboard time the client says is valid.

Comment
Add comment · 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

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

32 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

About unity's API for android? 2 Answers

Using the Kongregate API 1 Answer

WWW : Waiting for response from server 1 Answer

Getting 403 Forbidden error when trying to post to FB wall 4 Answers

How do you constrain googleMaps to a window? 0 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