def pyherion(code):
 imports = list()
 codebase = list()
 for line in code.split('\n'):
  if (not line.startswith('#')):
   if ('import' in line):
    imports.append(line)
   else:
    codebase.append(line)
 key = helpers.randomKey(32)
 cipherEnc = AES.new(key)
 encrypted = EncodeAES(cipherEnc, '\n'.join(codebase))
 b64var = helpers.randomString(5)
 aesvar = helpers.randomString(5)
 imports.append(('from base64 import b64decode as %s' % b64var))
 imports.append(('from Crypto.Cipher import AES as %s' % aesvar))
 random.shuffle(imports)
 crypted = (';'.join(imports) + '\n')
 crypted += ('exec(%s("%s"))' % (b64var, base64.b64encode(('exec(%s.new("%s").decrypt(%s("%s")).rstrip(\'{\'))\n' % (aesvar, key, b64var, encrypted)))))
 return crypted

def pyherion ( code ) : imports = list ( ) codebase = list ( ) for line in code . split ( '\n' ) : if ( not line . startswith ( '#' ) ) : if ( 'import' in line ) : imports . append ( line ) else : codebase . append ( line ) key = helpers . randomKey ( 32 ) cipherEnc = AES . new ( key ) encrypted = EncodeAES ( cipherEnc , '\n' . join ( codebase ) ) b64var = helpers . randomString ( 5 ) aesvar = helpers . randomString ( 5 ) imports . append ( ( 'from base64 import b64decode as %s' % b64var ) ) imports . append ( ( 'from Crypto.Cipher import AES as %s' % aesvar ) ) random . shuffle ( imports ) crypted = ( ';' . join ( imports ) + '\n' ) crypted += ( 'exec(%s("%s"))' % ( b64var , base64 . b64encode ( ( 'exec(%s.new("%s").decrypt(%s("%s")).rstrip(\'{\'))\n' % ( aesvar , key , b64var , encrypted ) ) ) ) ) return crypted
generates a crypted hyperionesque version of python code using base64 and aes with a random key .