EYCC 2025 - Cryptography

Challenge ( 1 ) Veiled Secret
At the beginning, there were three challenges in cryptography. The first challenge was called Veiled Secret, and it was an easy challenge worth 100 points.
Let's start the challenge.
Initially, I was given the text:

At first, I noticed the word TOR, which is reversed, indicating that the encryption method used is likely ROT13. Let's try that.

The result became:
This suggests that it is probably Base64, because the length of the characters is around 32, which can be divided by 4 to give an integer multiple, and there are other indicators like the mix of letters, numbers, and the = padding typical of Base64.
Now, let's try to decode the Base64:
The result became:
We successfully solved the first challenge!
Challenge ( 2 ) Golden Spiral

At the beginning, the challenge provided us with an executable file

When we ran it, we found that it outputs an encrypted string following the same format as our flag:

Our expected flag format starts with:
Let’s analyze what happens at the beginning of the flag.
Here are the English letters in order:
The first letter of the encrypted value is f, while the expected value is e. This means it was shifted by 1.
The second letter of the encrypted value is z, while the expected value is y. Again, it was shifted by 1.
The third letter of the encrypted value is e, while the expected value is c. This indicates a shift of 2.
The fourth letter of the encrypted value is f, while the expected value is c. This indicates a shift of 3.
In conclusion, the sequence of shifts used in this mathematical encryption process is:
Now, let’s look at the encryption algorithm behind this process. During our research on the website OEIS, which analyzes such sequences, we found that the algorithm is based on Fibonacci numbers.

Now, let’s try to decrypt it, since we know that the encryption type is Fibonacci numbers.
And now, we have obtained the second flag:

Challenge ( 3 ) Silent Keys

تمام ✅ خليني أعيد صياغة المقال لكن بخطوات أوضح وتنظيم أفضل بحيث المعادلات والأكواد تبقى في code blocks بدل الكتابة العادية:
Solving an RSA CTF Challenge with a Mathematical Clue
We are given the following RSA parameters in the challenge:
The clue is:
Step 1: Interpreting the Clue
We know RSA modulus n is the product of two primes p and q.
The clue says one prime is:
Step 2: Factoring n
nNow that we know p, we can compute q:
Result:
So the factors are:

Step 3: Why p and q matter
p and q matterIn RSA, p and q are the secret prime factors of n.
Once we have them, we can compute Euler’s totient φ(n):
Step 4: Computing the Private Key
The private exponent d is the modular inverse of e modulo φ(n):
This d together with n forms the RSA private key.
Step 5: Decrypting the Ciphertext
The plaintext message m is obtained by:
This gives us the flag.
Step 6: Python Script to Solve
Here’s a minimal Python script that automates the process:
The Result is :
Why This Works
The security of RSA relies on the difficulty of factoring large numbers.
Normally, factoring n is computationally infeasible.
However, the clue revealed one of the primes directly (p = 314159).
With that knowledge, we easily computed q, derived the private key, and decrypted the ciphertext.
Thank you all! I hope you enjoyed the article. If you have any questions, I’m here to help.
Remember My name : everythingBlackkk
Made by ❤
Github : https://github.com/everythingBlackkk
Linkedin : www.linkedin.com/in/everythingblackkk
Last updated