I have RTS game, where all players run game and server just relays messages. Game can generate and store text file on player pc. I want to allow some players to be moderators, so I need to sign or encrypt their ids + number representing their permissions.


  • everyone knows permissions and ids of other players.
  • player can see code that encrypts message (so goodbye symmetric cryptography)

What I have so far:

  • Textbook RSA 1024 bit + bignum library
  • I encrypt message with my private key and store in text file on player pc
  • Game got my public key and can verify if decrypted number is player id + permissions + checksum
  • Ids are authenticated by server

I read about RSA padding and my conclusion is - if everybody know message after it is decrypted there is no point in padding (because people got multiple copies of various messages, and they know what message will be decrypted to). Am I correct?

Maybe there is other cipher that I could use (preferred solution without need for bitwise operations).


1 Answer 1


"if everybody know message after it is decrypted there is" still a point in padding,
since it would (hopefully) stop people from learning the message before it is decrypted.

It would probably be better to
sign the message with your private key, rather than encrypt the message with your private key.
RSA needs padding for signatures too, although that padding is different from RSA encryption padding.

Also, although you can probably still get away with 1024-bit RSA since it's just
for a game, but you should make it easy for you to move to longer public keys.

  • $\begingroup$ @user2029276 Make sure to implement signing, not some kind of encryption. (And I would propose to use an existing crypto library instead of doing it yourself.) $\endgroup$ Apr 4, 2015 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.