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
2
Question by SinisterRainbow · Oct 06, 2013 at 09:47 AM · encryptionsavegamecryptography

Encrypting save files logic question

I'd like to encrypt save game files, but haven't yet worked out a good way to go about it. If I generate a key for my crypto, where would I store this so that it is relatively safe?

I realize there's no full proof method.


Current thoughts:

a) Just hardcode a key into the program - perhaps obfuscate it in the code

b) Dual layer: Use an MD5 hash hard coded, generate a key from Rijndael crypto on first game run for instance, hash that key store it in say the registry on a Windows OS..Perhaps generate a fake key file to throw off would be hacks.

c) Force all saves over the net (haha.. joking)

d) Multi layer hashing.. using several algs. Tho I think any decompiling of my code would make this extra effort worthless.


This is probably not of the utmost importance for this game.. Though, I was considering allowing players to cheat by purchasing cheat equipment.. Most gamers, self included, hate cheating, but if ure an adult say and limited on time but still want the satisfaction of winning and willing to pay for it, thought I might include it as an option..

Anyway, this is more for learning than anything, maybe you can help a few others at the same time. Thanks.

Comment
Add comment · Show 4
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 SinisterRainbow · Oct 07, 2013 at 08:55 AM 0
Share

No one? sad face... I understand after .Net 3.5+ code is more obfuscated when decompiled, and so perhaps, some simple obfuscation of a hard coded crypto scheme may be sufficient or even perhaps, overkill. But I'd really like to know how others are going about it.

avatar image SinisterRainbow · Oct 08, 2013 at 04:46 PM 0
Share

Well, I figured out a reasonable workable way, though I'm still toying with other ideas. For example, you can base part of the encryption password based on device information available for the particular system running the game. Certain things like graphics cards, etc. from SystemInfo.. Though I hesitate to implement this, because all savefiles will be corrupted if you change hardware. I tried tying it to the harddisk it's saved on, but apparently checking harddrive devices of .NET is not implemented in unity? On closed systems like ipad or iphone it may work however. This is just an added headache for an attacker though. Enough of one however, that will force a significant amount of work on their end if they want to make the full crack available to everyone.. if they crack it for themselves, it's much less of a pain for me than if they crack the entire game for everyone.

avatar image Jamora · Oct 08, 2013 at 04:51 PM 1
Share

I would go with choice A, with the addition of an obfuscated assembly. Wikipedia lists the popular obfuscation methods for .NET here along with a few obfuscators.

avatar image SinisterRainbow · Oct 11, 2013 at 04:30 AM 0
Share

The link looks promising, thank you.

0 Replies

· Add your reply
  • Sort: 

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

17 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

Related Questions

HMAC Initialization throws and error. How to solve it 1 Answer

Sha1/2 encryption on Unity 4.2? 2 Answers

AES encryption in iOS - NullReferenceException 1 Answer

System.Security.Cryptography.CryptographicException: Wrong Key Length 0 Answers

SqliteKit encrypt incorrectly 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