title: TypeError: can't concat bytes to str. Pycrypto Aes encryption
body: <p>Trying to encrypt/decrypt text with aes encryption with python 3, using pycryptodome 3.4.2</p>
  
  <p>Of course, I found this method on the Internet and tried to change it for my needs and all that I'm getting are the errors.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>def aes():
      #aes
      print('1.Шифруем')
      print('2.Дешифруем')
      c = input('Ваш выбор:')
      if int(c) == 1:
          #shifr
          os.system('clear')
          print('Шифруем значит')
          print('Введите текст, который хотите зашифровать')
          text = input()
          with open('Aes/plaintext.txt', 'wb') as f:
              f.write(text.encode('utf-8'))
          BLOCK_SIZE = 16
          PADDING = '{'
          pad = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * PADDING
          EncodeAES = lambda c, s: base64.b64encode(c.encrypt(pad(s)))
          secret = os.urandom(BLOCK_SIZE)
          with open('Aes/secret.bin', 'wb') as f:
              f.write(secret)
          cipher = AES.new(secret, AES.MODE_CFB)
          with open('Aes/plaintext.txt', 'rb') as f:
              text = f.read()
          encoded = EncodeAES(cipher, text)
          with open('Aes/ciphertext.bin', 'wb') as f:
              f.write(encoded)
          print (encoded)
      if int(c) == 2:
          os.system('clear')
          print('Дешифруем значит')
          PADDING = '{'
          with open('Aes/ciphertext.bin', 'rb') as f:
              encoded = f.read()
          with open('Aes/secret.bin', 'rb') as keyfile:
              secret = keyfile.read()
          DecodeAES = lambda c, e:    c.decrypt(base64.b64decode(e)).rstrip(PADDING)
          cipher = AES.new(secret, AES.MODE_CFB)
          decoded = DecodeAES(cipher, encoded)
          with open('Aes/plaintext.txt', 'w') as f:
              f.write(str(decoded))
          print(decoded)    
  </code></pre>
  
  <p>But when I'm trying to decrypt some text, I get this error:</p>
  
  <pre><code>Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/usr/lib/python3/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 699, in runfile
  execfile(filename, namespace)
  File "/usr/lib/python3/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 88, in execfile
  exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
  File "/home/tukanoid/Desktop/Enc_dec2/Enc_dec.py", line 475, in &lt;module&gt;
  aes()
  File "/home/tukanoid/Desktop/Enc_dec2/Enc_dec.py", line 178, in aes
  encoded = EncodeAES(cipher, text)
  File "/home/tukanoid/Desktop/Enc_dec2/Enc_dec.py", line 166, in &lt;lambda&gt;
  EncodeAES = lambda c, s: base64.b64encode(c.encrypt(pad(s)))
  File "/home/tukanoid/Desktop/Enc_dec2/Enc_dec.py", line 162, in &lt;lambda&gt;
  pad = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * PADDING
  TypeError: can't concat bytes to str
  </code></pre>
  
  <p>Actually, I don't know what does lambda do but I think that I get this error because of it. Thanks.</p>