title: Xor Encryption/Decryption Python 2.7.5
body: <p>I know there is a built in xor operator that can be imported in Python. I'm trying to execute the xor encryption/decryption. So far I have:</p>
  
  <pre><code>def xor_attmpt():
      message = raw_input("Enter message to be ciphered: ")
      cipher = []
      for i in message:
          cipher.append(bin(ord(i))[2::])#add the conversion of the letters/characters
  #in your message from ascii to binary withoout the 0b in the front to your ciphered message list
      cipher = "".join(cipher) 
      privvyKey = raw_input("Enter the private key: ")
      keydecrypt = []
      for j in privvyKey:
          keydecrypt.append(bin(ord(j))[2::]) #same
      keydecrypt = "".join(keydecrypt )#same
  
      print "key is '{0}'" .format(keydecrypt) #substitute values in string
      print "encrypted text is '{0}'" .format(cipher)
      from operator import xor
      for letter in message:
          print xor(bool(cipher), bool(keydecrypt))
  </code></pre>
  
  <p>This:</p>
  
  <pre><code>&gt;  for letter in message:
      print xor(bool(cipher), bool(keydecrypt))
  </code></pre>
  
  <p>is where my python starts to go wrong.</p>
  
  <pre><code>The ouput looks like this
      Enter message to be ciphered: hello
  Enter the private key: \@154&gt;
  key is '10111001000000110001110101110100111110'
  encrypted text is '11010001100101110110011011001101111'
  False
  False
  False
  False
  False
  </code></pre>
  
  <p>What I'm messing up on is trying to get these two binary(key and encrypted) to be compared and give true(1) or false(being 0). The xor should then give me a resulting 1 and 0 binary list from comparing the two. Any input?</p>