Skip to content

Master of Minuscule

Crypto - Easy

Description: I am the master of the little mysteries! Your task is to unlock the flag by delving into the world of numbers

Given: n, e, ct

e is small

from Crypto.Util.number import long_to_bytes

n = 16762077095801589672314890427869401187164086916344025478190347015681606276350033764791052494634438743687378102302129876469874629401611476115475741216444937553471054356393134540670817836743767583241290027522501016180585699330112702613161730012176085574743462096939111910613507008960837373716627558251940473661478520417826486527958422713970123527171162093407894286630360257132145754982872704536638681505413861494861497793838069021603881655804866695522655064013867284791862099373846594743596668718076555604173830911320344662327626095423734160003409379162445204425515220005854125716129645038092738757407899378631925818639
e = 3  # small public exponent
c = 710289350683868503644597519669917810036866060097512736293170169932115475815119142207293435658975273721020114420910211496808786789

# c = m^3 mod n
# highly probable that m^3 < n, m = c^(1/3)

def int_cbrt(x):
    lo, hi = 0, x
    while lo < hi:
        mid = (lo + hi) // 2
        if mid**3 < x:
            lo = mid + 1
        else:
            hi = mid
    return lo

m = int_cbrt(c)
print(long_to_bytes(m))