Rotation

You will find the flag after decrypting this file Download the encrypted flag here.

starting off the challenge we were given a file and printing the file

seems like it was doing a rotation cipher thing so we can just suspect it like caesar cause rotation get it? so using my old caesar chall code and improving it a little to bruteforce the flag

flag = ''

with open('encrypted.txt', 'r') as a:
    flag += a.readline().strip()

num = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]
for i in num:
    temp = ''
    for j in flag:
        if j.islower():
            num = ord(j) + i
            if(num > ord('z')):
                num -= 26
            temp += chr(num)
        elif j.isupper():
            num = ord(j) + i
            if(num > ord('Z')):
                num -= 26
            temp += chr(num)
        else:
            temp += j
    if "pico" in temp:
        print(temp)
        break

Last updated