I’m happy to announce that the first phase of CypherPoker v2.0 updates, namely multi-key/multi-round encryption, has been implemented in the core game code and submitted to the GitHub repository.

This means that each player is now generating and using multiple keypairs to encrypt and decrypt cards. Previous to this update, each player would only generate one keypair for encrypting and decrypting cards. Okay, this is not *entirely* accurate since a new keypair would be generated whenever another player dropped out, but this too has been updated so that multiple new keypairs are generated by players instead of just the one.

Here’s a diagram outlining the *before* and *after* (plus denotes encryption):

Although I’ve only shown three encryption cycles with three keypairs, the updated code supports any number of encryptions with any number of keypairs. Decryption works pretty much the same way and because the cryptosystem is commutative, both encryption and decryption operations can be applied in any order. You may recognize this as essentially just an extension to the way that the cryptosystem already works.

With these changes in place I can (relatively) easily update the associated Ethereum smart contracts to use multi-round cryptographic operations within the contracts’ 256-bit limit. For example, to approach 1024-bit security we would encrypt with four 256-bit keys. This isn’t a direct one-to-one correlation (using full 1024-bit numbers would be better), but this should provide good security for the application; keep in mind that encryption only needs to remain unbroken for the duration of a single hand, each player may apply an arbitrary number of encryptions to the cards (in the same hand one player may encrypt/decrypt 4 times while another may encrypt/decrypt 10 times), and both the shared prime modulus and card values are dynamic (calculated at runtime), which helps to prevent some RSA-style attacks.