Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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 vtm-kcchan · Aug 24, 2020 at 11:00 AM · securitysource code

Source code security

We had an Unity project that can build a complete game. Now we are hiring new staff to update the code inside it. Is there any best practice to provide the Unity project to him for development, but he cannot steal the source code for his own use?

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 xxmariofer · Aug 24, 2020 at 11:19 AM 1
Share

no is imposible, you need to share the full project and have confidential contracts, the only other solution is to divide the full project into libraries, atleast the important scripts

avatar image Bunny83 · Aug 24, 2020 at 12:53 PM 0
Share

"new staff" to do what exactly? In which way should they interact with your project? When you hire people you usually let them sign a disclosure contract which does not allow any usage outside the project. If they have to work with the code there's no way to "prevent" them from stealing it. If you can't trust your workers, you should find better ones.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by TenaciousDan · Aug 24, 2020 at 01:28 PM

If I understand you correctly, the new staff will be using the code you wrote like a library or asset you'd download from the asset store and you don't want them to see or reverse engineer the source code.

There are ways to "protect" the source although they have nothing to do with Unity. The first thing you can do is generate a DLL for your source code (). This alone is not enough to protect it though, a DLL can be easily decompiled using free software. You will have to do some code obfuscation. As the name suggests, this makes it so that your code is extremely hard to read making variable names like "fdh42ed" which make no sense to a person reading it. Some code obfuscators do a pretty good job making the code unreadable. Please note that this does not make the code "unstealable", it is still possible to reverse engineer the source code (however it is much, much more difficult to do so). Most people won't bother to try at this point.

Something things to note:
- When creating the DLL you will have to add all the Unity DLLs that your source code references as references. Here is a video example (video) however this example is very basic and he only adds the UnityEngine DLL but you can find all the DLLs you need in or around the location shown in the video.
- I have run into some problems where I suspect reflection was involved and obfuscating the code made those scripts throw errors. Unfortunately I was not able to completely solve this issue so for that one script, I removed it from the DLL and left it **un**obfuscated.

Here is the Obfuscation software I used (of course you can try others if you wish): ConfuserEx There is a plugin for Visual Studio that let's you chose which DLL's you want to obfuscate with some options. These are the options that worked for me: options
There are also some paid options on the Unity Asset store I think which I have not tried.
I hope that helps.
Cheers.


untitled.png (7.4 kB)
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 Bunny83 · Aug 24, 2020 at 01:46 PM 0
Share

This doesn't make much sense if those people should

update the code

in the project. I wouldn't work on a project as a programmer without seeing the code.


Apart from that the main concern was that the project is fully functional. So obfuscation is pretty pointless since they could simply steal and use everything as it is. Obfuscation is never a security measure, it's just a way to make it harder / more diffcult to reverse engineer the code.

avatar image TenaciousDan Bunny83 · Aug 24, 2020 at 01:58 PM 0
Share

I mentioned that it is still possible to steal the source even with obfuscation just makes it more difficult.
And yes, the new staff can still steal the DLL and use it, but if that was the concern of the OP, I'd say the only solution is "don't share your stuff with people who you don't trust". But I feel like that would be pretty self explanatory. I assume that the OP was looking to prevent new staff from copy pasting his source code and using it in their own projects. Like I said, DLL and obfuscation prevents most people from trying.
The best way to protect your source code is to do it legally via contractual agreement I guess.

avatar image Bunny83 TenaciousDan · Aug 24, 2020 at 02:11 PM 0
Share

But that's still pointless in his situation since the "new staff" should work ON that code. So what code do you want to obfuscate? It's like you're hiring a driver but you are worried he could steal the car so you don't give him the keys and won't let him get close to the car...

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

134 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to protect my project from decompiling? 1 Answer

Using WWW / Unity3 and Making Calls to Facebook OpenGraph API 4 Answers

Protect the PHP file that connects to mySQL 2 Answers

Cross-domain policy for specific folder/URL 1 Answer

Networking - Secure RPCs? 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