Rating:
I checked the contents of the encode_mania.txt file and found that it was encoded with base32.
I tried to decode through cyberchef, but I found out that there was a different base encoding, and I programmed the code to decode it in Python.
```python
from base64 import *
base16 = set("0123456789ABCDEFabcdef")
base32 = set("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=")
base64 = set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=")
base85 = set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!#$%&()*+-;<=>?@^_`{|}~")
enc = open("artifacts/encode_mania.txt","r").read().encode()
while True:
string = enc.decode("UTF-8")
if all(x in base16 for x in string):
enc = b16decode(enc)
elif all(x in base32 for x in string):
enc = b32decode(enc)
elif all(x in base64 for x in string):
enc = b64decode(enc)
else:
enc = b85decode(enc)
if "KCTF{" in enc.decode("UTF-8"):
print(enc.decode("UTF-8"))
break
```
I got FLAG through the above code
FLAG : ```KCTF{dfs_0r_b4u7e_f04c3}```