对于ax3+y3+z3=dxyz,可以化简到二次曲线上
具体就是
两边同时除以z3,得到a(x/z)3+(y/z)3+1=d(x/z)(y/z),
换元
得到ax3+y3+1=dxy
此时虽然不是传统的椭圆曲线,但还是可以用之前的一些方法解ECC
示例题目:
这里以Pohlig-Hellman为例子
还原x=x/z.y=y/z,检查新的曲线的阶,发现光滑,直接使用Pohlig-Hellman的解法
示例解题:

\# HGEME 2025\
\# Intergalactic Bound\
from Crypto.Util.number import \*\
from Crypto.Cipher import AES\
import hashlib\
p = 55099055368053948610276786301\
G = (19663446762962927633037926740, 35074412430915656071777015320)\
Q = (26805137673536635825884330180, 26376833112609309475951186883)\
ciphertext=b"k\xe8\xbe\x94\x9e\xfc\xe2\x9e\x97\xe5\xf3\x04'\x8f\xb2\x01T\x06\x88\x04\xeb3Jl\xdd Pk$\x00:\xf5"\
a = (G\[0]\*G\[1]\*(Q\[1]^3+1) - Q\[0]\*Q\[1]\*(G\[1]^3+1)) \* inverse(G\[0]\*Q\[0]\*(G\[0]^2\*Q\[1] - Q\[0]^2\*G\[1]),p)%p\
d = (a\*G\[0]^3+G\[1]^3+1)%p\*inverse(G\[0]\*G\[1],p)%p\
R.\<x,y,z> = Zmod(p)\[]\
cubic = a\* x^3 + y^3 + z^3 - d\*x\*y\*z\
E = EllipticCurve_from_cubic(cubic,morphism=True)\
G = E(G)\
Q = E(Q)\
G_ord = G.order()\
def Pohlig_Hellman(n,G,Q):\
factors, exponents = zip(\*factor(n))\
primes = \[factors\[i] ^ exponents\[i] for i in range(len(factors))]\
print(primes)\
dlogs = \[]\
for fac in primes:\
t = int(int(n) // int(fac))\
dlog = discrete_log(t\*Q,t\*G,operation="+")\
dlogs += \[dlog]\
print("factor: "+str(fac)+", Discrete Log: "+str(dlog)) #calculates discrete logarithm for each prime order\
num = crt(dlogs,primes)\
return num\
x = Pohlig_Hellman(G_ord,G,Q)\
print(x)\
key = hashlib.sha256(str(x).encode()).digest()\
cipher = AES.new(key, AES.MODE_ECB)\
flag = cipher.decrypt(ciphertext)\
print(flag)\
\# hgame{N0th1ng_bu7_up_Up_UP!}\