def xor_pair(data, avoid='\x00\n'):
 if isinstance(data, (int, long)):
  data = packing.pack(data)
 alphabet = list((chr(n) for n in range(256) if (chr(n) not in avoid)))
 res1 = ''
 res2 = ''
 for c1 in data:
  if context.randomize:
   random.shuffle(alphabet)
  for c2 in alphabet:
   c3 = chr((ord(c1) ^ ord(c2)))
   if (c3 in alphabet):
    res1 += c2
    res2 += c3
    break
  else:
   return None
 return (res1, res2)

def xor_pair ( data , avoid = '\x00\n' ) : if isinstance ( data , ( int , long ) ) : data = packing . pack ( data ) alphabet = list ( ( chr ( n ) for n in range ( 256 ) if ( chr ( n ) not in avoid ) ) ) res1 = '' res2 = '' for c1 in data : if context . randomize : random . shuffle ( alphabet ) for c2 in alphabet : c3 = chr ( ( ord ( c1 ) ^ ord ( c2 ) ) ) if ( c3 in alphabet ) : res1 += c2 res2 += c3 break else : return None return ( res1 , res2 )
xor_pair -> none or finds two strings that will xor into a given string .