← Back to Writeups
CUSTOMEasyCrypto

Bread 1 — RSA Decryption

XESXOR9/10/20261 min read
#crypto#custom#easy#rsa_basic_decryption

Bread 1 — RSA Decryption

Platform: spbctf | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2026-03-08 | Status: Solved Techniques: rsa_basic_decryption

Summary

Task: Given RSA parameters n, d, c. Solution: Standard RSA decryption using m = pow(c, d, n) since private exponent is already provided.

Bread 1 — Crypto Kids 2.0

Description

Given n, d, c — decrypt the message. Standard RSA decryption.

Analysis

Standard RSA decryption: m = c^d mod n. The private exponent d is already given, just apply the formula.

Solution

python
#!/usr/bin/env python3
from Crypto.Util.number import long_to_bytes

# Parameters from the task
n = ...  # modulus
d = ...  # private exponent
c = ...  # ciphertext

# Decrypt
m = pow(c, d, n)

# Convert to bytes
flag = long_to_bytes(m)
print(flag.decode())
# Output: spbctf{REDACTED}

‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍