tên challenge: Matrix mô tả: Let play with the mat...

Creato il: 9 maggio 2026

Risposto usando GPT-5.5 Thinking da Chat01

Domanda

crypto_matrix.zip

tên challenge: Matrix
mô tả: Let play with the matrix!
flag format: BKISC{...}
solve challenge

Pensiero

bash -lc python3 - <<'PY' import importlib.util spec=importlib.util.spec_from_file_location('sol','/mnt/data/solve_matrix.py') sol=importlib.util.module_from_spec(spec); spec.loader.exec_module(sol) j,S,u,v,lam=sol.roots[0] P=sol.mul(lam,sol.conj(lam))[1] a=int.from_bytes(b'7c6684ff4a69f86f','big') b=int.from_bytes(b'b16374051e7b2db6','big') d=S-a c=((a*d-P)*pow(b,-1,sol.p))%sol.p print('a',a,sol.b16(a)) print('b',b,sol.b16(b)) print('d',d, sol.b16(d), sol.is_printable16(d)) print('c',c, sol.b16(c) if c<256**16 else None, sol.is_printable16(c)) print(b'BKISC{'+sol.b16(a)+sol.b16(b)+sol.b16(c)+sol.b16(d)+b'}')

Verify C0,C1 prefixes for dlen 73/77 and eigenvalues maybe by computing matrix power? compute via recurrence? Need compute C entries from uM+vI.

C00=(ua+v)%sol.p C01=(ub)%sol.p C10=(uc)%sol.p C11=(ud+v)%sol.p print('C00',C00,len(str(C00)),str(C00)[:36]) print('C01',C01,len(str(C01)),str(C01)[:36]) print('trace',(C00+C11)%sol.p, (sol.B+sol.Dconst)%sol.p) print('det',(C00C11-C01C10)%sol.p)

determinant from evalues with norm 5

D_C=(sol.Bsol.Dconst + sol.Asol.A5)%sol.p print('D_C',D_C) print('det ok', (C00C11-C01*C10)%sol.p == D_C) PY

Thought for 5m 17s

Risposta

Flag:

text
BKISC{7c6684ff4a69f86fb16374051e7b2db6c0497f02e1f2d49b7cdb005873941541}

Các chunk khôi phục được:

text
a = 7c6684ff4a69f86f b = b16374051e7b2db6 c = c0497f02e1f2d49b d = 7cdb005873941541

Ý tưởng giải ngắn gọn: vì C = M^(1337^31337), eigenvalues của C là lũy thừa tương ứng của eigenvalues của M. Do gcd(1337^31337, p^2 - 1) = 1337, mình enumerate 1337 nghiệm khả dĩ trong GF(p^2), lọc bằng điều kiện trace là tổng của hai block ASCII 16 byte. Sau đó dùng Cayley-Hamilton để viết:

text
C = uM + vI

Từ prefix leak của C[0][0], C[0][1] và điều kiện printable, khôi phục được 4 block trên.

Condividi questa Q&A