Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 HuskyPanda213 · Jun 01, 2014 at 12:26 AM · rpcsecurity

Networking - Secure RPCs?

Whilst making my multi-user aspect of my game, I was wondering how to make a username and id system - this would be achieved by using RPCs. The system would work by adding a joining player to a list - which hooked up to a IEnumerator with a countdown, once the countdown has finished and the player still remains in the list the player gets kicked. Although the client sends an RPC to the server, which includes the clients data (username and id) - the message, when received - removes the player from the server's list. Now, my question is, can't the player just send a random username and id? This would pose a threat to the server system, as ban system would rely on this information (and it being correct). So, how could I prevent this?

Comment
Add comment · Show 2
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 Eluate · Jun 01, 2014 at 01:36 AM 0
Share

You could use a random hashing method such as $$anonymous$$D5 to jumble up the username.

Then decrypt the username serverside.

avatar image HuskyPanda213 · Jun 01, 2014 at 07:44 PM 0
Share

I know I could do that, but then the user could jumble up a random username, causing no difference in security. I just want to know how to send a username from a client to the server without possibility of sending a false/random username.

1 Reply

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

Answer by Bunny83 · Jun 01, 2014 at 08:35 PM

Well, first of all network communication is never "secure". There are many ways of adding additional security to your game / application. The first one is, check the sender of the NetworkMessageInfo inside your RPC. You should store the NetworkPlayer along with the username and id on the server. Now you can determine who sent this RPC. However someone could of course manually implement a modified RakNet client and might be able to fake a certain sender. I'm not sure if that's possible since it depends on how RakNet identifies the sender (IP / uniqueID / ...)

The best bet here is to rely on secret data that is only known to the server and each individual client. So when a client joins your server, the client sends a random generated "key" / hash / GUID to the server. This information should NEVER be send to any other client. If you send this "key" along with your messages, the server can say for sure that the message comes from a certain client.

I'm not sure about your concern about a user sending a random username / id to the server. Data that is unknown or not verified should be discarded anyways ;) You can be even more aggressive and kick a player who sends clearly wrong information.

Ohh and it's always a good idea to randomly delay such a kick (1-10 sec) so a cracker has a hard time to figure out where and when he crossed the border.

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

23 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

Related Questions

Security: Sending RPC to all clients 0 Answers

Security and RPCs 1 Answer

AllocateViewID over RPC but the NetworkView doesn't exist 2 Answers

Networking Unity can't get players on network to change each others variables. 0 Answers

Very Strange RPC error 1 Answer


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