title: Python 3: ValueError: invalid literal for int() with base 10: '0001.0110010110010102e+22'
body: <p>I'm a beginner, so sorry if this is obvious.</p>
  
  <p>I'm at a loss here. I've been trying to make an encryption/decryption program, but I keep getting this error. I'm aware that there are other questions on this issue, but I still can't resolve it.</p>
  
  <p><strong>Encryptor</strong>:</p>
  
  <pre><code>import binascii
  def text_to_bits(text, encoding='utf-8', errors='surrogatepass'):
      bits = bin(int(binascii.hexlify(text.encode(encoding, errors)), 16))[2:]
      return bits.zfill(8 * ((len(bits) + 7) // 8))
  
  def text_from_bits(bits, encoding='utf-8', errors='surrogatepass'):
      n = int(bits, 2)
      return int2bytes(n).decode(encoding, errors)
  
  def int2bytes(i):
      hex_string = '%x' % i
      n = len(hex_string)
      return binascii.unhexlify(hex_string.zfill(n + (n &amp; 1)))
  
  #ENCRYPTION ALGORITHM
  algorithm = 61913299
  
  #ASCII ----&gt; NUMBERS
  raw = input("Enter text to encrypt:")
  
  binary = text_to_bits(raw)
  binary = int(binary)
  algorithm = int(algorithm)
  encrypted = binary * algorithm
  encrypted = str(encrypted)
  print(encrypted)
  
  print("Done")
  </code></pre>
  
  <p><strong>Decryptor:</strong></p>
  
  <pre><code>import sys
  import time
  
  def to_bin(string):
      res = ''
      for char in string:
          tmp = bin(ord(char))[2:]
          tmp = '%08d' %int(tmp)
          res += tmp
      return res
  
  def to_str(string):
      res = ''
      for idx in range(len(string)/8):
          tmp = chr(int(string[idx*8:(idx+1)*8], 2))
          res += tmp
      return res
  
  incorrectpasswords = 0
  password=("password")
  originpassword = password
  x = 1
  algorithm = 61913299
  
  while x==1:
      passwordattempt =input("Enter Password:")
      if passwordattempt == password:
          print("Correct")
          x = 2
  
      if passwordattempt!= password:
          print("Incorrect")
          incorrectpasswords = incorrectpasswords + 1
      if incorrectpasswords &gt; 2:
          if x == 1:
              print("Too many wrong attempts, please try again in one minute.")
              time.sleep(60)
  
  
  encrypted = input("Enter numbers to unencrypt:")
  
  encrypted = int(encrypted)
  
  one = encrypted / algorithm
  size = sys.getsizeof(one)
  one = str(one).zfill(size + 1)
  one = int(one)
  unencrypted = to_str(one)
  
  x = unencrypted
  </code></pre>
  
  <p>For the conversion between binary and text, and text and binary, I used some code I found online.</p>