Skip to content

Instantly share code, notes, and snippets.

@clayball
Last active December 19, 2017 17:53
Show Gist options
  • Save clayball/2f8fa83efe896cb1f5ba342f76b8d2e4 to your computer and use it in GitHub Desktop.
Save clayball/2f8fa83efe896cb1f5ba342f76b8d2e4 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# rot(num), 1-26
import sys
num = int(sys.argv[1])
decode_string = sys.argv[2]
def rot_alpha(n):
from string import ascii_lowercase as lc, ascii_uppercase as uc
lookup = str.maketrans(lc + uc, lc[n:] + lc[:n] + uc[n:] + uc[:n])
return lambda s: s.translate(lookup)
decoded = rot_alpha(num)(decode_string) # Uryyb Jbeyq
print("[+] decoded: ", decoded)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment