I am making an online poker server in NodeJS. Currently, the state of the game is being sent to each client. So using debugging tools a client can see all the other player's card IDs. I would like to send the game state but modify it so that player card ID's are represented in ciphertext.
What kind of encryption protocol/scheme/library can I use to encrypt a player's cards so that the client can only read their own cards until a card is revealed to everybody in which case the card ID will then be sent in plaintext?
For example, a player's hand might be ['Ah', 'Kh'] which represents he is holding the Ace of Hearts and King of Hearts. Instead it should probably be encrypted to something like ['xxxxxxxx', 'xxxxxxxx'] unless the client is able to decrypt the hand.