Challenges
Factoring n from d
Cryptography
Medium
e,d,n → factor
Solves: 7
Factoring n from d
Author: CyberSamSU
Points
50
You are given the full key — n, e and the private d — but the primes p, q are missing. One might say "I have d, I will decrypt everything". But the goal is different: to factor n from exactly this (e, d, n) — which reveals all other messages and shows why revealing d is dangerous.
It is known that e·d − 1 = k·φ(n) is a multiple of φ. Writing it in the form 2^t · s, we repeatedly square g^s, g^(2s), … for a random base g. When a nontrivial square root of 1 (x ≠ ±1, x² = 1) is encountered, gcd(x−1, n) gives the factor.
n =
5627495286378216820373397228635742833930525447840919603607305577
0070730734969903803579070691213150301243344867788427689795497013
23844280630023628854231519
e = 65537,
d =
3903706161547316677416045665932803465464539846342430795111087265
8482316259107573059854568864907851712112080903196901616685867333
40564938493003196309153633
c (encrypted flag) =
2059689229708375962679874011164025672362334194181908320968559922
9343808846707633283138653763370277006027333772342453721449119279
33978418524568315006226347
To submit a flag, log in.