ECDLP on a small curve
ECDLP (elliptic curve discrete logarithm problem): finding k given G and Q = k·G. The entire security of ECC relies on the difficulty of this problem — but only when the curve is large enough.
Here p is only 32-bit, meaning the number of points according to Hasse is also around ~232. In such a group, the baby-step giant-step (BSGS) algorithm finds k in ~√n ≈ 216 steps:
- Let
m = ceil(sqrt(n)). - «Baby steps»: calculate
j·Gforj = 0..m-1and write them to a dictionary. - «Giant steps»: calculate
Q - i·m·Gfori = 0, 1, 2, ...and search in the dictionary. - If a match is found —
k = i·m + j.
Memory is ~216 points, time is a few seconds. On real curves (256 bits) this would be 2128 steps — that is why they are secure.
p = 3184984651
a = 2188334749
b = 259655667
G = (1088842421, 612483763)
Q = (2337050807, 2949717214)
Find k. Use the Hasse bound as the search interval for k: k < p + 2√p + 1. Note: the order of G can be smaller than the group order, so there will be several matching k in this interval — enter the smallest positive k as the answer (if you run BSGS starting from i = 0, exactly this one will be found).
Answer: number only — in decimal format, without spaces and without additional characters (for example 1234).