eggs ^= (key[eggs&0x3]<<8); reads as: eggs = eggs ^ ( key[eggs&0x3] << 8 ) also remember that key is an array with 4 bytes, so the term picks one of the 4 bytes and shifts that by 8 (so it masks the middle of the 3-byte tuple of plain text characters). no, i have not yet solved this one...