title: How to convert hex string again into cipher text for decryption
body: <p>I am using <a href="http://docs.python-guide.org/en/latest/scenarios/crypto/" rel="nofollow">pycrypto</a> module for generating a cipher text. The problem is the generated cipher text cannot be saved somewhere since it is not human readable.</p>
  
  <pre><code> &gt;&gt;&gt; a=AES.new("1234567890123456")
      &gt;&gt;&gt; m='aaaabbbbccccdddd'
      &gt;&gt;&gt; a.encrypt(m)
      'H\xe7\n@\xe0\x13\xe0M\xc32\xce\x16@\xb2B\xd0'
  </code></pre>
  
  <p>I want to save this encrypted message in my database, and right now I can't do it since the its not human readable. I can save the data by converting into hexcode:</p>
  
  <pre><code>a.encrypto(m).encode('hex')
  </code></pre>
  
  <p>and generate the hex code and save it my database. The problem is how will I convert this <code>encrypted hex code</code> back to into same form for decryption? Can anyone help to me here? </p>
  
  <p>My user will access the encrypted message from the database, decrypt it and then check the integrity of the message! Could anyone help me convert hex code back into cipher text? </p>