Skip to content

Commit 25aeebc

Browse files
committed
Add simple_curve
1 parent 0aafb8d commit 25aeebc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The challenge calculated `ctext = [65537]flag` over a hyperelliptic curve.
2+
To recover the flag we need to multiply by the inverse of 65537 modulo the group's order.
3+
4+
The order can be calculated using Magma:
5+
6+
K := FiniteField(2^256);
7+
P := PolynomialRing(K);
8+
w := P.1;
9+
f := w^5 + w^3 + 1;
10+
h := w^2 + w;
11+
H := HyperellipticCurve(f, h);
12+
print #Jacobian(H);
13+
14+
Now we decrypt the flag (in Sagemath):
15+
16+
order = 13407807929942597099574024998205846127384782207827457971403006387925941306569427075743805985793764139096494648696821820448189053384542053304334065342873600
17+
e = 65537
18+
d = int(pow(e, -1, order))
19+
flag = mul(ctext, d)
20+
print(decode(flag))
21+

0 commit comments

Comments
 (0)