title: byte operations (XOR) in python
body: <pre><code>#!/usr/bin/env python3
  
  import binascii
  
  
  var=binascii.a2b_qp(&quot;hello&quot;)
  key=binascii.a2b_qp(&quot;supersecretkey&quot;)[:len(var)]
  
  print(binascii.b2a_qp(var))
  print(binascii.b2a_qp(key))
  
  
  # here I want to do an XOR operation on the bytes in var and key and place them in 'encryption': encryption=var XOR key
  
  print(binascii.b2a_qp(encrypted))
  </code></pre>
  <p>If someone could enlighten me on how I could accomplish this I would be very happy. Very new to the whole data-type conversions so yeah... reading through the python wiki is not as clear as I would like.</p>