Skip to content

Instantly share code, notes, and snippets.

@Karolis2011
Created January 15, 2016 13:18
Show Gist options
  • Save Karolis2011/f4a087b2a7982d569f21 to your computer and use it in GitHub Desktop.
Save Karolis2011/f4a087b2a7982d569f21 to your computer and use it in GitHub Desktop.
Simple code that obfuscates a string
from random import randint
s = "Hello World!"
ob = "000000!%*£?#*" #Obfucation chars
new_s = ""
for c in s:
cc = ob[randint(1,len(ob) - 1)]
if (cc == "0" or c == " " or c == "."):
new_s += c
else:
new_s += cc
print(new_s) #Outputs obfuscated result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment