about summary refs log tree commit diff
path: root/users/wpcarro/scratch/picoctf/challenge_144.py
diff options
context:
space:
mode:
Diffstat (limited to 'users/wpcarro/scratch/picoctf/challenge_144.py')
-rw-r--r--users/wpcarro/scratch/picoctf/challenge_144.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/users/wpcarro/scratch/picoctf/challenge_144.py b/users/wpcarro/scratch/picoctf/challenge_144.py
new file mode 100644
index 000000000000..570a7fd5a77b
--- /dev/null
+++ b/users/wpcarro/scratch/picoctf/challenge_144.py
@@ -0,0 +1,11 @@
+def rotate_alpha(x, n):
+    def rotate_char(c, n):
+        offset = 'A' if c.isupper() else 'a'
+        return chr((ord(c) - ord(offset) + n) % 26 + ord(offset))
+    return "".join([rotate_char(c, n) if c.isalpha() else c for c in x])
+
+xs = [
+    "cvpbPGS{arkg_gvzr_V'yy_gel_2_ebhaqf_bs_ebg13_Ncualgvd}",
+]
+for x in xs:
+    print(rotate_alpha(x, 13))