> --
> You received this message because you are subscribed to the "Crypto++ Users" Google Group.
> To unsubscribe, send an email to cryptopp-user...@googlegroups.com.
> More information about Crypto++ and this group is available at http://www.cryptopp.com.
Elias
Cameron Hutchison wrote:
> [I sent this directly to Elias by accident - gmail newbie here. Here
> it is again for the list]
>
> I don't think man-in-the-middle is going to be a problem. My goal
> here is to make sure information is not revealed to the participants
> (of which there are two, but the protocol could probably be extended
> to more easily enough) before both players agree to it.
>
> Anyway, if the man-in-the-middle does become an issue, the game can be
> played over a SSL/TLS link so I dont have to invent a new identity
> scheme for the game (i.e. make it possible to set up comms with
> existing certs - I hate the proliferation of different incompatible
> certs for different systems that I'm not going to add to it).
>
> None of that matters though, unless I find an appropriate cipher for
> the game itself. :-)
>
> Cheers
>
> On Sun, Jul 4, 2010 at 9:32 AM, Elias <elias...@googlemail.com
> <mailto:elias...@googlemail.com>> wrote:
>
> Don't forget about man-in-the-middle - You'd have to use signatures at
> least! So better use asymmetric crypto in the first place ;)
>
> On Jul 1, 6:48 am, Cameron Hutchison <camh.c...@gmail.com
> <mailto:cryptopp-user...@googlegroups.com>.
Elias
Cameron Hutchison wrote:
> No, it is not a server-based game. There are only two participants. I
> am trying to implement a peer-to-peer system that does not need a
> trusted third party.
>
> At the end of the initialisation protocol, each player is left with a
> list of tokens (cards) that are encrypted by both players (technically
> they don't need to keep their own cards encrypted with their own keys
> but it helps to think of a single list of shared tokens than each
> player having a list of the same tokens but encrypted by the other
> player).
>
> Anyway, after initialisation, player A can choose to reveal a token to
> player B by sending them the key that they used to encrypt that token.
> And vice versa.
>
> To do this, I'm looking for a commutative cipher where each token is
> multiply-encrypted with multiple keys. Each token is encrypted with a
> different key. From previous research, a stream-based cipher (XOR)
> will leave the initialisation phase vulnerable to key discovery. That
> is how I've ended finding Massey-Omura (for which I cannot find an
> implementation), and now looking for something similar that is
> implemented in crypto++.
>
> > <mailto:elias...@googlemail.com
> <mailto:elias...@googlemail.com>>> wrote:
> >
> > Don't forget about man-in-the-middle - You'd have to use
> signatures at
> > least! So better use asymmetric crypto in the first place ;)
> >
> > On Jul 1, 6:48 am, Cameron Hutchison <camh.c...@gmail.com
> <mailto:camh.c...@gmail.com>
> > <mailto:camh.c...@gmail.com <mailto:camh.c...@gmail.com>>>
> > <mailto:cryptopp-user...@googlegroups.com
No idea where you got that information, but I can assure you AES never
reveals the key. It doesn't even allow reconstruction of the key when
used in ECB mode - though ECB allows attacks against the ciphertext.
What you've read was probably about RC4 or something similar. Just use
an IV and AES OFB-mode, that works for your purpose and is secure!
I
don't get why you want the other player to have the encrypted data in
advance though. Instead of sending the key to decrypt the data you could
simply send the data the moment player1 reveals some data to player2.
Cameron Hutchison wrote:
> No, it is not a server-based game. There are only two participants. I
> am trying to implement a peer-to-peer system that does not need a
> trusted third party.
>
> At the end of the initialisation protocol, each player is left with a
> list of tokens (cards) that are encrypted by both players (technically
> they don't need to keep their own cards encrypted with their own keys
> but it helps to think of a single list of shared tokens than each
> player having a list of the same tokens but encrypted by the other
> player).
>
> Anyway, after initialisation, player A can choose to reveal a token to
> player B by sending them the key that they used to encrypt that token.
> And vice versa.
>
> To do this, I'm looking for a commutative cipher where each token is
> multiply-encrypted with multiple keys. Each token is encrypted with a
> different key. From previous research, a stream-based cipher (XOR)
> will leave the initialisation phase vulnerable to key discovery. That
> is how I've ended finding Massey-Omura (for which I cannot find an
> implementation), and now looking for something similar that is
> implemented in crypto++.
>
> On Sun, Jul 4, 2010 at 9:55 AM, Elias Önal <elias...@googlemail.com
> Two known cryptosystems that satisfy
>> E(key1, E(key2, Message)) = E(key2, E(key1, Message))
> are the Massey Omura crytosystem and Shamir's three-pass protocol. One
> reason to prefer these two schemes is the following property: an
> attacker with access to the ciphertexts E(key1, Message), E(key2,
> Message) and E(key1, E(key2, Message)) can not find the message. On
> the other hand, the solutions based on RSA or stream cipher can be
> broken under this assumption.
I think you got him wrong! It doesn't allow the reconstruction of the
key, but the keystream. Of course this is possible when using XOR, but I
don't see the problem in your case - You'd use a new IV for each game
anyway.
I have an other idea that might work for you and is pretty simple. I
will describe it from the view of player 1. Player1 receives a random
nonce from player2. Player1 then concatenates his choice for his card to
the nonce, adds another nonce on his own(a different one for each card)
and hashes it. Then he sends the hash to player2. Player2 can't get any
information from the hash until player1 reveals the card and the nonce
he chose for that card. At that moment player2 is able to verify player1
had the same card at the beginning by concatenating the three values and
hashing them. Using any secure cryptographic hash guarantees that
player1 can't cheat as well since he can't "forge" random hashes. I
would suggest sha256. Since the card-id is probably really short you
should choose the nonce reasonable long. (Defeats rainbowtables)
Concerning the problem of player1 getting "E(key1, Message) XOR E(key1,
E(key2, Message)) = key2" (he probably could brute force the positions
eventhough they're shuffled) player2 could refuse to share E(key1,
E(key2, Message)) with player1, but give him a hash of every card in
E(key1, E(key2, Message)).
Cameron Hutchison wrote:
> [Replying back to the list with Elias's permission]
>
>
> > On Sun, Jul 4, 2010 at 10:24 AM, Elias �nal
> > > On Sun, Jul 4, 2010 at 9:55 AM, Elias �nal
> > <mailto:camh.c...@gmail.com <mailto:camh.c...@gmail.com>>>>>
I think the system as you've described has another problem. After
player2 shuffled the cards player1 can't decrypt them anymore without
knowing the original position.
So player2 would have to keep a remapping
table which is only shared with player1 once both agree on disclosing
one card. If player1 knows the mapping table - he'd know all the cards.
Concerning the streamcipher you don't have to worry. You can't
reconstruct other parts of the keystream from single disclosured parts -
not for modern streamciphers. Just make sure to change the IV with each
game.
Concerning the problem of player1 getting "E(key1, Message) XOR E(key1,
E(key2, Message)) = key2" (he probably could brute force the positions
eventhough they're shuffled) player2 could refuse to share E(key1,
E(key2, Message)) with player1, but give him a hash of every card in
E(key1, E(key2, Message)).
Cameron Hutchison wrote:
> [Replying back to the list with Elias's permission]
>
>
> On Sun, Jul 4, 2010 at 11:15 AM, Elias Önal <elias...@googlemail.com
> > On Sun, Jul 4, 2010 at 10:24 AM, Elias Önal
> <elias...@googlemail.com <mailto:elias...@googlemail.com>
> > > On Sun, Jul 4, 2010 at 9:55 AM, Elias Önal
Cameron Hutchison wrote:
> > On Sun, Jul 4, 2010 at 11:15 AM, Elias �nal
> > > On Sun, Jul 4, 2010 at 10:24 AM, Elias �nal
> > > > On Sun, Jul 4, 2010 at 9:55 AM, Elias �nal
No wonder ElGamal was suggested already (by Shai Halevi)
They could be decrypted in a different order, you just need to know the
area of the streamcipher you used. A streamcipher is basically a
cryptographic PRNG. You can tell it to generate 2 megabytes of
randomness and it will do. Since you'd never disclosure the key, but
only parts of the keystream it wouldn't really be a streamcipher -
rather a one time pad. One time pads are commutative as well.
> > On Sun, Jul 4, 2010 at 11:15 AM, Elias Önal
> <elias...@googlemail.com <mailto:elias...@googlemail.com>
> > > On Sun, Jul 4, 2010 at 10:24 AM, Elias Önal
> > > > On Sun, Jul 4, 2010 at 9:55 AM, Elias Önal