Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import sys
- from textwrap import wrap
- charot="64":"a","67":"b","66":"c","61":"d","60":"e","63":"f","62":"g","6d":"h","6c":"i","6f":"j","6e":"k","69":"l","68":"m","6b":"n","6a":"o","75":"p","74":"q","77":"r","76":"s","71":"t","70":"u","73":"v","72":"w","7d":"x","7c":"y","7f":"z","44":"A","47":"B","46":"C","41":"D","40":"E","43":"F","42":"G","4d":"H","4c":"I","4f":"J","4e":"K","49":"L","48":"M","4b":"N","4a":"O","55":"P","54":"Q","57":"R","56":"S","51":"T","50":"U","53":"V","52":"W","5d":"X","5c":"Y","5f":"Z","35":"0","34":"1","37":"2","36":"3","31":"4","30":"5","33":"6","32":"7","3d":"8","3c":"9","24":"!","26":"#","21":"$","20":"%","5b":"^","23":"&","2f":"*","2d":"(","2c":")","28":"-","5a":"_","38":"=","2e":"+","5e":"[","7e":"{","58":"]","78":"}","59":"\\","79":"|","3e":";","3f":":","22":"'","27":"\"","29":",","39":"<","2b":".","3b":">","2a":"/","3a":"?","45":"@"
- def switcheroo(string):
- one = list(string)
- final = []
- characters = {charot}
- for loop in enumerate(one):
- x = loop[1]
- if x in characters:
- final.append(str(characters[x]))
- else:
- final.append("_")
- return "".join(final)
- def decode(string):
- final = []
- characters = {charot}
- one = wrap(string, 2)
- for loop in enumerate(one):
- y = loop[1]
- if y in characters:
- final.append(str(characters[y]))
- else:
- final.append("_")
- return "".join(final)
- def main():
- if len(sys.argv) != 3:
- print("Usage: %s encode <string>" %sys.argv[0])
- print("Ex: %s testing" %sys.argv[0])
- sys.exit(-1)
- string = sys.argv[2]
- if sys.argv[1] == "encode":
- encode = switcheroo(string)
- print("Tiktok Encoded: "+encode)
- elif sys.argv[1] == "decode":
- decodex = decode(string)
- print("Tiktok Decoded: "+decodex)
- else:
- print("Wrong shit!")
- sys.exit()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement