Last active
December 19, 2017 17:53
-
-
Save clayball/2f8fa83efe896cb1f5ba342f76b8d2e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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