<p>I'm working on a game for the iPhone and would like it to be able to submit scores back to the server.  Simple enough, but I want the scores to be verified to actually come from a game-play.  With the (defacto) prohibition on real crypto with the export conditions, what would be the best way to get information back in a secure/verified channel?</p>

<p>All my thoughts lead back to an RSA-style digital signature algorithm, but would prefer something less "crypto" to get past that export question.</p>

<p>Thanks!</p>

[{'answer_id': 78642, 'author': 'Hank Gay', 'author_id': 4203, 'author_profile': 'https://Stackoverflow.com/users/4203', 'pm_score': 1, 'selected': False, 'text': "<p>Couldn't you just use a client certificate (signed by you) and establish an HTTPS connection to your server, which has been configured to only accept connections begun with a client certificate signed by you?</p>\n"}, {'answer_id': 78688, 'author': 'UnkwnTech', 'author_id': 115, 'author_profile': 'https://Stackoverflow.com/users/115', 'pm_score': 0, 'selected': False, 'text': '<p>generate a random, something fairly long, then tack the score to the end, and maybe the name or something else static, then sha1/md5 it, and pass both to the server, verify that the random hashes, to be equal to the hash.</p>\n\n<p>After-thought: If you want to make it harder to reverse engenier, then multiply your random by the numerical representation of the day (monday=1, tuesday=2,...)</p>\n'}, {'answer_id': 78710, 'author': 'emk', 'author_id': 12089, 'author_profile': 'https://Stackoverflow.com/users/12089', 'pm_score': 1, 'selected': False, 'text': '<p>To make a long story <em>very</em> short, you\'re allowed to export digital signature code with very few restrictions.  To learn more, <a href="http://www.bis.doc.gov/exportlicensingqanda.htm" rel="nofollow noreferrer">start at the BIS export FAQ</a>.</p>\n\n<p>You probably want to look at <a href="http://www.access.gpo.gov/bis/ear/pdf/742.pdf" rel="nofollow noreferrer">EAR 742.15(b)3</a>, which covers the digital signature exemptions.</p>\n\n<p>Of course, I Am Not A Lawyer, and the rules may have changed in the last year.</p>\n'}, {'answer_id': 90843, 'author': 'benzado', 'author_id': 10947, 'author_profile': 'https://Stackoverflow.com/users/10947', 'pm_score': 0, 'selected': False, 'text': "<p>One idea that might be Good Enough:</p>\n\n<ul>\n<li>Let Secret1, Secret2, Secret3 be any random strings.</li>\n<li>Let DeviceID be the iPhone's unique device ID.</li>\n<li>Let Hash(Foo + Bar) mean I concatenate Foo and Bar and then compute a hash.</li>\n</ul>\n\n<p>Then:</p>\n\n<ol>\n<li><p>The first time the app talks to the server, it makes a request for a DevicePassword.  iPhone sends: DeviceID, Hash(DeviceID + Secret1)</p></li>\n<li><p>The server uses Secret1 to verify the request came from the app.  If so, it generates a DevicePassword and saves the association between DeviceID and DevicePassword on the server.</p></li>\n<li><p>The server replies: DevicePassword, Hash(DevicePassword + Secret2)</p></li>\n<li><p>The app uses Secret2 to verify that the password came from the server.  If so, it saves it.</p></li>\n<li><p>To submit a score, iPhone sends: DeviceID, Score, Hash(Score + DevicePassword + Secret3)</p></li>\n<li><p>The server verifies using Secret3 and the DevicePassword.</p></li>\n</ol>\n\n<p>The advantage of the DevicePassword is that each device effectively has a unique secret, and if I didn't know that it would make it harder to determine the secret by packet sniffing the submitted scores.</p>\n\n<p>Also, in normal cases the app should only request a DevicePassword once per install, so you could easily identify suspicious requests for a DevicePassword or simply limit it to once per day.</p>\n\n<p>Disclaimer: This solution is off the top of my head, so I can't guarantee there isn't a major flaw in this scheme.</p>\n"}, {'answer_id': 3989637, 'author': 'benzado', 'author_id': 10947, 'author_profile': 'https://Stackoverflow.com/users/10947', 'pm_score': 1, 'selected': False, 'text': '<p>Using real crypto won\'t actually buy you anything here. You basically have the reverse of the typical DRM problem. In that case, you want to prevent people from decrypting content, but they have to decrypt it to watch it, so you have to give them to key anyway.</p>\n\n<p>In your case, you want to prevent people from signing fake scores, but they have to be able to sign real scores, so you have to give them the key anyway.</p>\n\n<p>All you need to do is make sure your scheme requires more effort to crack than the potential rewards. Since we\'re talking about a game leader board, the stakes are not that high. Make it so that someone using tcpdump won\'t figure it out too quickly, and you should be fine. If your server is smart enough to detect "experimentation" (a lot of failed submissions from one source) you will be safer than relying on any cryptographic algorithm.</p>\n'}]
['https://Stackoverflow.com/questions/78599', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']