docs: create GEMASTIK 2026 Warmup writeups (ch1-14) via MCP DB API
CI / typecheck + build (push) Canceled after 0s
CI / deploy to VPS (push) Canceled after 0s

- Deleted all 14 dummy docs from DB + filesystem
- Created 14 Gemastik warmup writeups + index via create_document API (DB-first)
- ch1-ch12: encoding/stego/web/pwn basics
- ch13: RSA small factors
- ch14: RSA special integers via paper-search (GCD with paper appendix primes)
- All 15 docs indexed and live at wiki.asepharyana.my.id
This commit is contained in:
asepharyana committed 2026-08-21 14:28:04 +07:00
1 parent 7a6e717c28
commit 0de2458955
15 files changed
+176 -72

No files matched your search

@@ -1,13 +1,20 @@
---
title: "Slopped wave-2 — RSA Special Integers (Paper Search)"
type: "writeup"
section: "writeups"
status: "published"
author: "asep"
tags: ["gemastik", "ctf", "warmup", "crypto"]
path: "writeups/gemastik-2026-warmup/ch14-slopped-wave2.md"
created_at: "2026-08-21T07:25:51.729Z"
updated_at: "2026-08-21T07:25:51.729Z"
event: "GEMASTIK 2026 Warmup"
challenge: "Slopped wave-2"
challenge: "Slopped wave-2 — RSA Special Integers (Paper Search)"
category: "crypto"
points: 501
difficulty: "hard"
flag: "GEMASTIK19{test_vector_of_listP_on_quant}"
---
# Slopped wave-2 (501 pts) — Crypto / RSA "special integers"
**File:** `chals.py` — Kategori: `crypto, misc`
@@ -31,20 +38,20 @@ print(c)
## Analisis Serangan
Semua serangan standar gagal:
- **Fermat** (close primes): gap > 1.2×10^159 — tidak dekat secara praktis
- **ECM**: tidak smooth (B1=43M, nihil)
- **Fermat** (close primes): gap > 1.2×10^159
- **ECM**: tidak smooth (B1=43M)
- **Pollard p-1**: B=2M — tidak smooth
- **ROCA**: n mod M bukan pangkat 65537
- **Wiener / Boneh-Durfee**: e kecil (0x10001) berarti d besar — tidak berlaku
- **Trial division** ke 10M: bersih (bukan multi-prime)
- **Wiener / Boneh-Durfee**: e kecil berarti d besar
- **Trial division** ke 10M: bersih
### Hint "paper search"
Hint eksplisit dari ch13 (`"you should use paper search mcp skill"`) mengarah ke paper akademik.
Hint dari ch13 ("you should use paper search mcp skill") mengarah ke paper akademik.
Paper yang relevan: **[Wang et al., "A First Successful Factorization of RSA-2048 Integer by D-Wave Quantum Computer (TST 2024.9010028)"](https://www.sciopen.com/article/10.26599/TST.2024.9010028)**.
Paper: **[Wang et al., "A First Successful Factorization of RSA-2048 Integer by D-Wave Quantum Computer (TST 2024.9010028)"](https://www.sciopen.com/article/10.26599/TST.2024.9010028)**.
Paper ini mendefinisikan **"special integer"**: `n = p·q` di mana kedua prima berbeda tepat 2 bit (`popcount(p XOR q) = 2`). Appendix Table S1 berisi 10 contoh (N, p, q) yang **menggunakan kembali prima yang sama** antar contoh — inilah "sloppiness" wave-2: modulus challenge merekonstruksi ulang dua prima dari dua contoh berbeda di appendix.
Paper mendefinisikan **"special integer"**: `n = p·q` di mana kedua prima berbeda tepat 2 bit (`popcount(p XOR q) = 2`). Appendix Table S1 berisi 10 contoh (N, p, q) yang **menggunakan kembali prima yang sama** — inilah "sloppiness" wave-2: modulus challenge merekonstruksi ulang dua prima dari dua contoh berbeda.
## Solusi
@@ -54,16 +61,12 @@ Hitung `gcd(n, P_i)` untuk setiap prima `P_i` di 10 contoh paper:
import math
from Crypto.Util.number import long_to_bytes
n = 280088984259197676303322409340162768479248055253332178324048979479391032432289729496895136889553954879681054017549377236761031572728785368094833820151098377195413332119600135231380112995454122165424468980135704765977852529569814690639351847175244215778770376263888879859156353972612170752463744913383401062048491249958029243091765282473774483093168121753713425292265614066847042063133253723914013765258726038858443157129746991645277096281312454572347302870277064727079382216834376085631299651357Line truncated
n = <2048-bit modulus from challenge>
e = 0x10001
c = 0x... # dari challenge
c = <ciphertext>
# Dari appendix paper: 10 contoh, setiap contoh punya p & q
paper_examples = [
# (p_i, q_i) — faktor dari 10 contoh paper
...
]
# 10 contoh dari appendix paper, setiap contoh punya (p, q)
paper_examples = [...]
for ex in paper_examples:
for P in (ex.p, ex.q):
@@ -71,7 +74,6 @@ for ex in paper_examples:
if 1 < g < n:
p_factor = g
q_factor = n // g
print(f"Found factor via GCD with paper prime!")
break
phi = (p_factor - 1) * (q_factor - 1)
@@ -83,4 +85,4 @@ print(long_to_bytes(flag))
## Flag
`GEMASTIK19{test_vector_of_listP_on_quant}`
`GEMASTIK19{test_vector_of_listP_on_quant}`