3 first challenges

This commit is contained in:
Maxime Vorwerk
2024-06-05 15:28:09 +02:00
commit c9764c3f18
7 changed files with 86 additions and 0 deletions

1
mod_26/flag Normal file
View File

@@ -0,0 +1 @@
cvpbPGS{arkg_gvzr_V'yy_gel_2_ebhaqf_bs_ebg13_hyLicInt}

19
mod_26/sol.py Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/python
def rot13(char):
c = ord(char)
A = ord('A')
Z = ord('Z')
a = ord('a')
z = ord('z')
if c >= A and c <= Z:
char = chr((c-A+13)%(Z-A+1)+A)
elif c >= a and c <= z:
char = chr((c-a+13)%(z-a+1)+a)
print(char, end='')
with open("flag", "r") as f:
flag = f.read()
for char in flag:
rot13(char)