20:08 < marcan> I could make a table, but it's definitely not random, so there has to be some algorithm behind it
20:25 < oax> marcan can you give any more information
20:26 < marcan> Basically, I have 8 input bits and 8 output bits
20:26 < marcan> P(0x00) = 0xff
20:26 < marcan> from there, each input bit set changes some output bits
20:26 < marcan> initially, I thought each input bit applied a separate XOR mask to the output
20:26 < marcan> but it seems more complex than that
20:27 < oax> so you tried 01 02 04 08 10 20 40 80
20:27 < marcan> yep
20:27 < marcan> here are the outputs
20:27 < marcan> 00000001 -> 11111110
20:28 < marcan> 00000010 -> 11111101 (bear with me here, it gets worse)
20:28 < marcan> 00000100 -> 11111011
20:28 < marcan> 00001000 -> 11110011 (!)
20:28 < marcan> 00010000 -> 11101111
20:29 < marcan> 00100000 -> 11001111
20:29 < marcan> 01000000 -> 10001111
20:29 < marcan> 10000000 -> 00001111
20:29 < oax> yeah doesn't look random, but I don't see the pattern yet
20:30 < oax> is P(03) = 03 ?
20:30 < marcan> at first I thought each input bit XORed the output with a mask: 01 02 04 0c 10 30 70 f0
20:30 < marcan> but it doesn't work out
20:31 < marcan> give me a second, I'll get my friend in here
20:31 < marcan> he's the one who actually has the device that's doing this
20:31 < marcan> for the record, this is the Wii's Classic Controller, and the bits are buttons on it
20:31 < oax> ah
20:31 < oax> hmm the input bits?
20:32 < marcan> yeah. 1 = pressed here
20:32 < marcan> and the output is what gets ultimately sent to the host
20:32 < oax> and the output bits are the IR signal or whatever?
20:32 < oax> brb
20:32 < marcan> bytes in the Bluetooth packets
20:33 < marcan> we've isolated all buttons to two bytes, and they seem to behave identically, so they are using the same permutation for both
20:34 < marcan> Nintendo seems to be doing some sort of encryption, using a key that gets sent to the controller which seems to at least generate an XOR keystream that gets XORed
with the data bytes.
20:35 < marcan> We're not interested with that, as all we are doing right now is using a zero key which yields the same byte for all the XORs, and we're just using that (figuring
out the XOR mask is trivial)
20:35 < marcan> but the buttons bytes have something else going on, not just a simple XOR
20:36 < marcan> for the X / Y stick and accelerometer data in the Nunchuk, all the encryption does is XOR with 0x17 every byte if we use a zero key
20:36 < marcan> but the buttons are weird.
20:37 < marcan> On the Nunchuk, the Z-button is reported, together with an XOR of the Z and C buttons, instead of the C button only
20:37 < marcan> for the Classic with many buttons, something weirder is going on
20:37 < marcan> DesktopMa: /invite DesktopMa
20:38 < marcan> oops
20:38 < marcan> that was suppoed to be a command, my bad
20:38 < marcan> doesn't work anyway
20:39 -!- DesktopMa [server@ghybel332.grm.hia.no] has joined #cryptography