Encoding something multiple times makes it exponentially more secure!
Lets take a look at generate.js, which reads
const btoa = str => Buffer.from(str).toString('base64'); const fs = require("fs"); const flag = fs.readFileSync("flag.txt", "utf8").trim(); let ret = flag; for(let i = 0; i < 25; i++) ret = btoa(ret); fs.writeFileSync("cipher.txt", ret);
btoa is basically string to its base64 encoding.
The flag is encoded repetitively 25 times in a for loop.
We just need to base64 decode it 25 times and we will get the flag.
from base64 import b64decode with open('cipher.txt','r') as cipher_file: data = cipher_file.read() for i in range(25): data = b64decode(data) print(data)
A cool sarcasm on bad crypto challenges in CTFs :)