title: Cryptography.fernet.InvalidToken when sending encrypted message over network
body: <p>I'm trying to send an encrypted string over the local network using the socket and cryptography.fernet library, but when the bytes are received it throws a "cryptography.fernet.InvalidToken" error. It does work if I encrypt and decrypt in one file, but not if I host the server and client locally or on 2  different computers.</p>
  
  <p>Server</p>
  
  <pre class="lang-py prettyprint-override"><code>    import socket
      from cryptography.fernet import Fernet
      crypt = Fernet('sqcyNL5kz2mxWb1KL2QSZWY-GCERE-scEgWBbvq9CCk=')
      with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
          s.bind((host, port))
          s.listen(10)
          conn, addr = s.accept()
          with conn:
              while True:
                  messageEncrypt = conn.recv(2048)
                  message = crypt.decrypt(messageEncrypt, None).decode()
                  print(message)
  </code></pre>
  
  <p>Client</p>
  
  <pre class="lang-py prettyprint-override"><code>    import socket
      from cryptography.fernet import Fernet
      crypt = Fernet('sqcyNL5kz2mxWb1KL2QSZWY-GCERE-scEgWBbvq9CCk=')
      message = 'sentence'
      messageEncode = message.encode()
      messageEncrypt = crypt.encrypt(messageEncode)
      with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
          s.connect((host, port))
          s.sendall(messageEncrypt)
          s.close()
  </code></pre>
  
  <p>The client encodes, encrypts, then sends the message and the client receives the message and decrypts it. The server does correctly decrypt and print the message, but immediately crashes preventing the rest of the program running.
  The weird thing is that it has enough time to print after decrypting before it crashes. Does anyone have any idea why this might be happening?</p>
  
  <p>Console for server: </p>
  
  <pre><code>sentence
  Traceback (most recent call last):
    File "E:/Google Drive/School/###/###/python/project/morseSrv.py", line 50, in &lt;module&gt;
  message = crypt.decrypt(messageEncrypt).decode()
    File "C:\Python\lib\site-packages\cryptography\fernet.py", line 74, in decrypt
  timestamp, data = Fernet._get_unverified_token_data(token)
    File "C:\Python\lib\site-packages\cryptography\fernet.py", line 92, in _get_unverified_token_data
  raise InvalidToken
  cryptography.fernet.InvalidToken
  
  Process finished with exit code 1
  </code></pre>