
In this challenge you are given a file that contains a value on each line.
- Each line except for one contains an md5 hash.

The idea is to locate the line that is not a valid MD5 hash.
The idea:
- MD5 hashes are expressed as hexadecimal. (0-9)(A-F)
- One line contains a value that is outside of this range and, therefore, can not be an MD5 hash.
There are many, many ways to solve this challenge.
This script will check each line in the file and spit out any lines containing values not in the Hexadecimal range.
def is_hexadecimal(s):
"""Check if the string s is a valid hexadecimal number."""
hex_chars = set("0123456789abcdefABCDEF")
return all(c in hex_chars for c in s.strip())
def check_md5_file(filename):
"""Read the file line by line and print invalid lines."""
with open(filename, 'r') as file:
for line_number, line in enumerate(file, start=1):
if not is_hexadecimal(line):
print(f"Invalid line {line_number}: {line.strip()}")
if __name__ == "__main__":
check_md5_file("md5.txt")

Copy and paste the found line as the flag, and you’ll receive points.