Jump to content
yo20063

Run Python Obfuscated

Recommended Posts

Din pricina faptului ca nu am gasit prea multe exemple pe internet, si eram curios daca poti rula cod python obfuscated pentru ca cere indentare, am scris script-ul asta inspirandu-ma de aici.

Folosind aceasta metoda este posibil sa stochezi codul si intr-o baza de date.

 

import base64


def encode(key, string):
    encoded_chars = []
    for i in xrange(len(string)):
        key_c = key[i % len(key)]
        encoded_c = chr(ord(string[i]) + ord(key_c) % 256)
        encoded_chars.append(encoded_c)
    encoded_string = "".join(encoded_chars)
    return base64.urlsafe_b64encode(encoded_string)

def decode(key, string):
    decoded_chars = []
    decoded_string = base64.b64decode(string, '-_')
    for i in xrange(len(decoded_string)):
        key_c = key[i % len(key)]
        decoded_c = chr(ord(decoded_string[i]) - ord(key_c) % 256)
        decoded_chars.append(decoded_c)
    decoded_string = "".join(decoded_chars)
    return decoded_string


creator = "yo20063"

code = "g9ubo6SXU7bKVHiZYlObm1JSeV2gm5tSV5-Yme7ilZGkm5ealo86lqWlmdhSmZ5Wn-LippFqQFOZj1Kgop-h7Y-b"

if __name__ == "__main__":
    exec(decode(creator, code))

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...