Challenge Description

Description

I heard encoding and encryption are 2 different things. Not sure whether this is useful.

  • Author: Jun Wei
  • Category: crypto
  • Difficulty: easy

Files

23summit46 - Solution

  1. For this challenge, we are given a file called secret.txt. It contains a long base64-encoded string.

  1. There are many ways to solve this challenge. We can use CyberChef are repeatedly decode from Base64. Alternatively, we can use scripts to automate this. 2 solve scripts (Python and bash) are attached below.

These solve scripts were developed based on the prior knowledge that the string has undergone 32 rounds of base64 encoding.

This is not blind guessing, however, because the challenge name suggests that the flag has indeed been base64-encoded 32 times.

23summit46 is a sort of wordplay:

  • Flipping 23 gives 32.

  • The opposite of “summit” could be interpreted as “base”.

  • Flipping 46 gives 64.

Put together, this suggests base64 encoded 32 times, which matches the challenge.

import base64
 
with open("secret.txt", "r") as file:
    text = file.read().strip()
 
for i in range(32):
    text = base64.b64decode(text.encode()).decode("utf-8")
 
print(text)
#!/bin/bash
 
file="secret.txt"
text=$(cat "$file")
 
for i in $(seq 1 32);
do
    text=$(echo "$text" | base64 --decode)
done
 
cat <<< "$text"
  1. We can use either of the above methods to obtain the flag, which will be revealed after decoding from base64 32 times.

Flag: HNF{4ft3r_32_base64s}