Hi,
I am trying to use MD5 encryption between my app and the server. To verify what was sent. I don’t really understand how this works. I know that MD5 creates a checksum that I need to send to my server, but how does the server check that aswell? I got the idea from this:
"As-is, the ‘secret’ really doesn’t help at all. Anyone that wants to submit a fake score can simply copy the URL passed, change the score, and re-submit the URL.
A quick work-around to prevent this type of attack is to hash the ‘secret’ along with the data being passed. Then you just send the hashed value rather than the actual ‘secret’. On the server side, you compute the same MD5 hash to make sure the data is legit.
Pseudo code example:
hash = MD5( “secret” + username + score)
NSString *urlString = [NSString stringWithFormat:@“http://icodeblog.com/ws/put_score.php?secret=%@&udid=%@&name=%@&score=%f”,
hash,udid,username,theScore];
Note, the secret itself is never sent in plain text this way. In fact, the secret is never sent at all!
Main benefits: (A) No one else knows your secret password, and (B) if someone changes the Score or the Username, the MD5 hash will not match.
Quick and easy!
HTH
—
Dave"
On this site http://icodeblog.com/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/
Thanks for your help.
[import]uid: 8192 topic_id: 5465 reply_id: 305465[/import]