Cryptography
Cube Cute 🥉
51
Cube Cute 2 🥇
34
Terix 🥉
34
Primer Puasa 🥈
32
Es Coco Prime 🥇
30
Motor CB-XR
22
Cube Cute
Description
Author: WanZKey
Easy chall to count?, yap, just focus on counting!. maybe yes, number three will help you!, don't forget the bit!!!.
Initial Analysis
We are given 2 files:
import os
from Crypto.Util.number import getPrime, bytes_to_long
m = bytes_to_long(os.getenv("FLAG").encode())
p = getPrime(512)
n = p * p * p
e = 65537
c = pow(m, e, n)
print(f"{n,c=}")We can see the obvious vulnerability that then we can compute the p as . Then do basic RSA decryption.
Exploitation
I don't really think i can provide much explanation, because this is just textbook RSA, you probably can understand more reading this:
We compute p, then compute Euler's Totient function, for the totient function becomes:
Then we compute the private exponent (d) using this formula:
Then compute m:
Running this script, we will get the flag:

Flag: RAMADAN{Lag1-Pu4s4_b3laj4r_Cub3-r0ot-C4lcul4t0r}
Cube Cute 2
Description
Author: WanZKey
same as the first, let's find out cube?
Initial Analysis
We are given two files:
Well this is basically the same as this challenge. The vulnerability lies in the e value. When the e value is very small, in this case 3. It is vulnerable to small exponent attack.
Exploitation
In textbook RSA, ciphertext is calculated as this formula:
But when the e is too small, or the n is very big (In this case it both is). The c value essentially becomes:
Which can then be computed as:
Rendering the n value useless.

Flag: RAMADAN{Cube_2_root_just_c0nv3rt_l0ng_1nt3g3r_t0_byt3s}
Primer Puasa
Author: WanZKey
Gatau mau ngisi deskripsinya apa, intinya next!, 128!.
Initial Analysis
We are given two files:
TL;DR of the key generation is:
Get a 128-bit prime number and assign it as q.
Get a 128-bit number and assign it as r.
Then compute p so that:
Exploitation
This challenge is the same as this challenge. So during the CTF, i just copied the solve script and got the flag :v . If you want an explanation maybe check out the writeup — I am not really good at Cryptography :(
Running this script, we will get the flag:

Flag: RAMADAN{Puas4-g4s_Crypt0-C0y_bi4r_Pr1me!!!}
Terix
Description
Author: WanZKey
Bulan Puasa ini cuacanya terix banget ya ges, pen minum rasanya:)
Initial Analysis
We are given a file:
Exploitation (?)
This is just the flag, encoded to decimal value, to solve this, we can flatten the array to 1D array and decode it:

Flag: RAMADAN{E4sy-ch4ll_M4tr1x!}
Es Coco Prime
Description
Author: WanZKey
Please verify first whether it is "coco" or not? If yes, maybe the "coco" seller, "Mr. Euclidean" will help you pour it, and yes, always remember the simple mathematics of "x" and "y" because they are the minimum formula for this "coco" which is very delicious.
Initial Analysis
We are given two files:
We can see that the flag is encrypted 2 times, msg1 and msg2. Each encrypted with a different e value but the same n value. This RSA scheme is vulnerable to common modulus attack.
Let:
Since , knowing Bézout’s Identity and Extended Euclidean Algorithm, we get an identity like this:
If the recovered x or y is negative, we must compute for example:
msg1_inv = inverse(msg1, n) then msg1_inv^{-x}
Exploitation
I already explained it above how the maths work, so here's the solve script:
Running this script and we will get the flag:

Flag: RAMADAN{bel4jar_common_modulus_attack_m4ke_coprime_coy!!!_very_easy_ga_sii?}
Motor CB-XR
Description
Author: WanZKey
Base64 and Base32 codes are very familiar, right? I don't know, but both of their numbers will help you get this "Motor CB-XR". Calculation is key, but a little analysis will help. Well whatever it is, congratulations if you get this "CB-XR Motorcycle"!.
Initial Analysis
We are given two files:
We are given a custom cipher. The cipher works like this:
Generate a random key with 8 bytes size
Taking the plaintext, pad it to multiple of 8 bytes
Generate a random 8 bytes IV
Encrypt the plaintext, for the first 8 bytes, the encryption process is then for the subsequent remaining blocks, it encrypts using
Exploitation
So to decrypt it, we need to recover the key first, since we know the IV, the first 8 byte of plaintext and and the first 8 bytes of plaintext, to recover the key, we will use this formula:
Then once we have the key, we can use the decrypt function on the chall.py file:
Running this script, we will get the flag:

Flag: RAMADAN{X0R_w1th_CBC_n0w_y0u_g3t_n3w_l3ss0n}
Last updated
