CUSTOM CIPHER
Solution
We are provided a .pyc file which is a compiled python file we can't read it in plain text but there is an amazing tool online
https://www.toolnb.com/tools-lang-en/pyc.html
Using this website I found the python code behind the file
So, encryption function:
def encode_secret(secret):
rotate_const = 37
encoded = ''
for c in secret:
index = alphabet.find(c)
original_index = (index + rotate_const) % len(alphabet)
encoded = encoded + alphabet[original_index]
return encoded
We need to decrypt this so I wrote a small decryption function
You can even try it by yourselves
code:
for i in encoded_flag:
temp=alphabet.index(i)-37
while(temp<0):
temp+=len(alphabet)
print(alphabet[temp],end='')
FLAG: cybergrabs{yOU_FounD_7H3_SHIfT_c1PheR}
Comments
Post a Comment