title: base64.b64encode error
body: <p>I'm trying to encrypt and decrypt text in python, and I know how to do that - the problem is that I don't want to have to use a set amount of letters like 16 or 32. I want to be able to use as many letters/numbers as I want, and then encrypt the text without any errors.</p>
  
  <p>base64 in python would be perfect, because I can do just that, but when I want to do:</p>
  
  <pre><code>password = "password"
  encode = base64.b64encode(password)
  </code></pre>
  
  <p>... it returns an error because it's not in bytes; it has to be like:</p>
  
  <pre><code>encode = base64.b64encode(b'password')
  </code></pre>
  
  <p>That works completely fine, but I don't want to do that.</p>
  
  <pre><code>import base64
  
  password = "hello world"  
  encoded = base64.b64encode(password.encode("utf-8"))
  print(encoded)
  decoded = base64.b64decode(encoded)
  print(decoded)
  </code></pre>
  
  <p>that is now my code and it works fine but i now know i was using the wrong type of thing i need to know on how to use AES.</p>