Safest way to send data to server

Hi there.
I was wondering, what’s the best and safest way to send data, such as high scores, to my (php) server ?

I was doing a little research (but the articles seemed kinda old) and read that using MD5 is a good idea, using a secret key. For instance, I could send the username, score and the already encripted concatenated string (username+score+secret_key) to the server and validate them there.

But is there a better (safest) way to do it? The example above is kinda simple, but what if it’s more complex like leveling up or claiming a prize/bonus (even for these, I can think of ways around like sending the exact new level, or checking if the prize is still available… I don’t know. I can’t think of a really complex example)… but that’s not my point, my point is… is there other option? Or using MD5 + a secret key the best way?

Thanks!

Safest way would be not sending score at all.
Instead you send client input and other activities. Server checks are those actions legit or not. If yes, action is executed and if result produces score, new score is added, saved and sent back to user just for visualization.