about summary refs log tree commit diff
path: root/users/wpcarro/scratch/picoctf/challenge_144.py
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2021-12-29T16·09-0400
committerclbot <clbot@tvl.fyi>2021-12-29T19·34+0000
commit5c0ec720afc83761d1afda44e9b6acd30375d898 (patch)
tree45b8d18a0f53420038415855e1aa8684712b142d /users/wpcarro/scratch/picoctf/challenge_144.py
parentd3c20a44d37f0246dc9d848e6c63da2839f8dc4f (diff)
feat(wpcarro/scratch): Upload my solutions to picoCTF challenges r/3500
Just getting my feet wet...

Change-Id: Ia1db0c69fe7d5ea5cb5585853d0688ef97f2680a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4739
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
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))