Download ende.py, pw.txt and flag.txt.en. Run python3 ende.py -d flag.txt.en and paste the password from pw.txt when prompted — the script decrypts and prints the flag.
| Platform | picoGym |
| Verified against | vivian-dai's picoCTF 2021 writeups |
| Category | General Skills |
| Difficulty | Beginner |
| Tools | python3 cat |
The challenge hands you an encrypted flag, the script that encrypted it, and the password. The skill being tested is running someone else's script correctly.
Provided: ende.py, pw.txt, flag.txt.en
Stuck? Try a hint before reading the solution
Run the script without arguments to see how it wants to be called.
-d decrypts; the password it asks for is in pw.txt.
Run the script with no arguments (or -h) to see how it expects to be called:
$ python3 ende.py
Usage: ende.py (-e/-d) [file]
-e encrypts, -d decrypts, and the second argument is the file to work on. Skimming the source also shows it uses the cryptography library's Fernet — if you get an import error, install it with pip install cryptography.
The password is simply stored in pw.txt:
$ cat pw.txt
[PASSWORD]
Run the script in decrypt mode on the encrypted file and paste the password when it asks:
$ python3 ende.py -d flag.txt.en
Please enter the password: [PASSWORD]
picoCTF{***}
To skip the copy-paste, pipe the password in: cat pw.txt | python3 ende.py -d flag.txt.en.
The flag is deliberately hidden — follow the method, you've earned it. 💪
Nothing here is hidden — the challenge is about reading a usage message and wiring the pieces together:
-h first to see their usagepip install, not by editing the scriptNew to CTFs? Start here: beginner's guide to CTFs — what a CTF is, the categories, the tools and a step-by-step plan.
Discuss this writeup with the community on the CTFdojo Discord.
Join the Discord →