文件名:我不喜欢十六进制 线索贯穿每个像素,每一步都是解密的关键 hint1:密码是关键\\ &#x...

创建于:2026年8月22日

使用 GPT-5.6 Thinking 回答 Chat01

问题

6ac3b4c68469903df8c816647b9ae97f_720.jpg

文件名:我不喜欢十六进制
线索贯穿每个像素,每一步都是解密的关键
hint1:密码是关键\
hint2:图片分辨率与密码息息相关\
hint3:David Hilbert
获得flag

Python

python
from PIL import Image img=Image.open('/mnt/data/6ac3b4c68469903df8c816647b9ae97f_720.jpg') img.size, img.mode ((1280, 317), 'RGB')

Python

python
import numpy as np, PIL.Image as Image, pandas as pd, math, statistics a=np.array(img) g=a.mean(axis=2) mask=g<128 row=mask.sum(axis=1) col=mask.sum(axis=0) row[:20], row.shape, row.min(),row.max(),col.min(),col.max() (array([273, 261, 258, 260, 271, 291, 316, 299, 300, 286, 235, 244, 218, 202, 196, 205, 200, 191, 201, 196]), (317,), np.int64(116), np.int64(319), np.int64(3), np.int64(141))

Python

python
img.getexif(), img.info (<PIL.Image.Exif at 0x7f63a36bdaa0>, {'jfif': 257, 'jfif_version': (1, 1), 'jfif_unit': 0, 'jfif_density': (1, 1)})

Python

python
from collections import Counter cnt=Counter(map(tuple,a.reshape(-1,3))) cnt.most_common(20) [((np.uint8(250), np.uint8(248), np.uint8(249)), 18844), ((np.uint8(249), np.uint8(249), np.uint8(249)), 18626), ((np.uint8(250), np.uint8(248), np.uint8(251)), 11556), ((np.uint8(249), np.uint8(249), np.uint8(251)), 10839), ((np.uint8(250), np.uint8(249), np.uint8(247)), 6771), ((np.uint8(249), np.uint8(249), np.uint8(247)), 6004), ((np.uint8(248), np.uint8(250), np.uint8(249)), 4709), ((np.uint8(251), np.uint8(249), np.uint8(250)), 4706), ((np.uint8(251), np.uint8(249), np.uint8(252)), 3904), ((np.uint8(252), np.uint8(248), np.uint8(249)), 3568), ((np.uint8(248), np.uint8(249), np.uint8(251)), 3534), ((np.uint8(250), np.uint8(250), np.uint8(252)), 3218), ((np.uint8(250), np.uint8(250), np.uint8(250)), 3127), ((np.uint8(252), np.uint8(247), np.uint8(251)), 2296), ((np.uint8(249), np.uint8(248), np.uint8(253)), 2263), ((np.uint8(251), np.uint8(250), np.uint8(248)), 2113), ((np.uint8(255), np.uint8(254), np.uint8(255)), 2066), ((np.uint8(248), np.uint8(248), np.uint8(248)), 1992), ((np.uint8(252), np.uint8(248), np.uint8(247)), 1986), ((np.uint8(250), np.uint8(248), np.uint8(253)), 1855)]

Python

python
import numpy as np, itertools, binascii, zlib, gzip, bz2, lzma, string, math bits=(g<128).astype(np.uint8).ravel() def bits_to_bytes(bits, msb=True): n=len(bits)//8*8 b=bits[:n].reshape(-1,8) if msb: vals=(b*(1<<np.arange(7,-1,-1))).sum(axis=1) else: vals=(b*(1<<np.arange(8))).sum(axis=1) return bytes(vals.astype(np.uint8)) for inv in [False,True]: bb=bits_to_bytes(bits^(1 if inv else 0)) print(inv, bb[:64], bb[:16].hex())

Python

python
import sympy as sp, math sp.factorint(317), sp.factorint(1280), math.gcd(1280,317) ({317: 1}, {2: 8, 5: 1}, 1)

Python

python
1280*317, 637**2, 1280*317-637**2 (405760, 405769, -9)

Python

python
# Implement generalized Hilbert ("Gilbert") traversal from https://github.com/jakubcerveny/gilbert def sgn(x): return (x>0)-(x<0) def gilbert2d(width, height): coords=[] if width >= height: _generate2d(coords, 0,0,width,0,0,height) else: _generate2d(coords, 0,0,0,height,width,0) return coords def _generate2d(out,x,y,ax,ay,bx,by): w=abs(ax+ay); h=abs(bx+by) dax=sgn(ax); day=sgn(ay) dbx=sgn(bx); dby=sgn(by) if h==1: for _ in range(w): out.append((x,y)); x+=dax; y+=day return if w==1: for _ in range(h): out.append((x,y)); x+=dbx; y+=dby return ax2=ax//2; ay2=ay//2 bx2=bx//2; by2=by//2 w2=abs(ax2+ay2); h2=abs(bx2+by2) if 2*w > 3*h: if (w2%2) and (w>2): ax2+=dax; ay2+=day _generate2d(out,x,y,ax2,ay2,bx,by) _generate2d(out,x+ax2,y+ay2,ax-ax2,ay-ay2,bx,by) else: if (h2%2) and (h>2): bx2+=dbx; by2+=dby _generate2d(out,x,y,bx2,by2,ax2,ay2) _generate2d(out,x+bx2,y+by2,ax,ay,bx-bx2,by-by2) _generate2d(out,x+(ax-dax)+(bx2-dbx), y+(ay-day)+(by2-dby), -bx2,-by2, -(ax-ax2), -(ay-ay2)) coords=gilbert2d(1280,317) len(coords), len(set(coords)), coords[:10], coords[-10:] (405760, 405760, [(0, 0), (1, 0), (2, 0), (2, 1), (1, 1), (0, 1), (0, 2), (1, 2), (1, 3), (0, 3)], [(1278, 4), (1279, 4), (1279, 3), (1279, 2), (1279, 1), (1278, 1), (1277, 1), (1277, 0), (1278, 0), (1279, 0)])

Python

python
import sympy as sp sp.factorint(405760) {2: 8, 5: 1, 317: 1}

思考

Resource uri: /response/turn0 Showing 26 of 26 lines. Response metadata: response_timestamp_utc=2026-08-22T16:21:09.550085+00:00, current_user_turn_index=0, total_count=5, total_uploaded_files_count=5, surface=conversation Pagination: has_more=false

undefined

Python

python
import numpy as np, math gray=np.array(img.convert('L'),dtype=float) gx=np.abs(np.diff(gray,axis=1)).mean(axis=0) gy=np.abs(np.diff(gray,axis=0)).mean(axis=1) # dominant frequencies excluding DC def top_periods(sig, n=20): x=sig-sig.mean() f=np.fft.rfft(x) p=np.abs(f) inds=np.argsort(p[1:])[::-1][:n]+1 return [(i, len(sig)/i, p[i]) for i in inds] top_periods(gx,15), top_periods(gy,15)[:10] ([(np.int64(256), np.float64(4.99609375), np.float64(3604.6617140288026)), (np.int64(16), np.float64(79.9375), np.float64(2859.003547522342)), (np.int64(128), np.float64(9.9921875), np.float64(2244.750644451607)), (np.int64(17), np.float64(75.23529411764706), np.float64(2194.068189463618)), (np.int64(235), np.float64(5.4425531914893615), np.float64(1441.2516636243408)), (np.int64(4), np.float64(319.75), np.float64(1429.952331958533)), (np.int64(12), np.float64(106.58333333333333), np.float64(1322.2261933965185)), (np.int64(512), np.float64(2.498046875), np.float64(1235.7399964802207)), (np.int64(8), np.float64(159.875), np.float64(1126.1167340334955)), (np.int64(528), np.float64(2.422348484848485), np.float64(1113.0190030996202)), (np.int64(19), np.float64(67.3157894736842), np.float64(1110.3972352297226)), (np.int64(20), np.float64(63.95), np.float64(1064.3187329487382)), (np.int64(384), np.float64(3.3307291666666665), np.float64(985.3741581279893)), (np.int64(272), np.float64(4.702205882352941), np.float64(981.392747336574)), (np.int64(64), np.float64(19.984375), np.float64(976.3927489277297))], [(np.int64(64), np.float64(4.9375), np.float64(943.186374764334)), (np.int64(127), np.float64(2.4881889763779528), np.float64(643.0826879880325)), (np.int64(131), np.float64(2.4122137404580153), np.float64(556.4338141252352)), (np.int64(32), np.float64(9.875), np.float64(497.6935098734253)), (np.int64(63), np.float64(5.015873015873016), np.float64(479.3860437977779)), (np.int64(128), np.float64(2.46875), np.float64(420.0336854999287)), (np.int64(129), np.float64(2.449612403100775), np.float64(388.0237134784334)), (np.int64(58), np.float64(5.448275862068965), np.float64(356.70347847859506)), (np.int64(65), np.float64(4.861538461538461), np.float64(287.1067579696809)), (np.int64(95), np.float64(3.3263157894736843), np.float64(266.21566551787294))])

Python

python
from PIL import Image # reconstruct logical bitmap sizes gray_img=img.convert('L') for h0 in [127,128]: small=gray_img.resize((512,h0), Image.Resampling.LANCZOS) arr=np.array(small) # inspect histogram print(h0, np.percentile(arr,[1,10,25,50,75,90,99]), (arr<128).mean()) Image.fromarray(arr).save(f'/mnt/data/small_{h0}.png')

Python

python
def hilbert_d2xy(n, d): x=y=0 t=d s=1 while s<n: rx=1 & (t//2) ry=1 & (t ^ rx) if ry==0: if rx==1: x=s-1-x y=s-1-y x,y=y,x x += s*rx y += s*ry t//=4 s*=2 return x,y coords256=[hilbert_d2xy(256,d) for d in range(256*256)] len(set(coords256)), coords256[:10], coords256[-1] (65536, [(0, 0), (1, 0), (1, 1), (0, 1), (0, 2), (0, 3), (1, 3), (1, 2), (2, 2), (2, 3)], (255, 0))

Python

python
gray=np.array(img.convert('L')) def grid_extract(xphase,yphase,cell=5,W=256,H=64,method='mean'): out=np.zeros((H,W),float) for r in range(H): y0=yphase+r*cell y1=min(y0+cell,gray.shape[0]) for c in range(W): x0=xphase+c*cell x1=min(x0+cell,gray.shape[1]) if y0>=gray.shape[0] or x0>=gray.shape[1]: out[r,c]=255 else: block=gray[max(y0,0):y1,max(x0,0):x1] out[r,c]=block.mean() if block.size else 255 return out # choose phases 0 for exact width, y maybe -? evaluate bimodality separation for yp in range(-4,5): arr=grid_extract(0,yp) vals=arr.ravel() # percentile and score: variance between low/high clusters around threshold128 low=vals[vals<128]; hi=vals[vals>=128] score=(hi.mean()-low.mean()) if len(low) and len(hi) else 0 print(yp, score, len(low)/len(vals), np.percentile(vals,[10,25,50,75,90]))

Python

python
def block_score(cell, xp, yp, H=None,W=None): # average within blocks std, and between block mean variance, covering full blocks only if W is None: W=(gray.shape[1]-xp)//cell if H is None: H=(gray.shape[0]-yp)//cell means=[]; vars_=[] for r in range(H): y0=yp+r*cell for c in range(W): x0=xp+c*cell b=gray[y0:y0+cell,x0:x0+cell].astype(float) if b.shape==(cell,cell): means.append(b.mean()); vars_.append(b.var()) return np.mean(vars_), np.var(means), np.mean(vars_)/(np.var(means)+1e-9) for cell in [2,3,4,5,6,8,10]: best=(1e9,None)

Python

python
import numpy as np, itertools, string, math, zlib, bz2, lzma, gzip, binascii # recover logical 512x128 with threshold variants def pack(bits, msb=True): bits=np.asarray(bits,dtype=np.uint8) n=(len(bits)//8)*8 b=bits[:n].reshape(-1,8) weights=(1<<np.arange(7,-1,-1)) if msb else (1<<np.arange(8)) return bytes((b*weights).sum(1).astype(np.uint8)) printable=set(bytes(string.printable,'ascii')) def score_bytes(bb): if not bb: return 0 return sum((32<=x<127) or x in (9,10,13) for x in bb)/len(bb) def magic_hits(bb): mags=[b'flag',b'ctf',b'FLAG',b'CTF',b'PK\x03\x04',b'\x89PNG',b'GIF8',b'%PDF',b'\x1f\x8b',b'7z\xbc\xaf\x27\x1c',b'Rar!',b'http',b'base64',b'key',b'password'] return [(m,bb.find(m)) for m in mags if bb.find(m)>=0] seqs={} for th in [80,96,112,128,144,160,176,192,208,224]: grid=(np.array(gray_img.resize((512,128),Image.Resampling.LANCZOS))<th).astype(np.uint8) # row-major seqs[(th,'row')]=grid.ravel() seqs[(th,'col')]=grid.T.ravel() # generalized hilbert traversal seqs[(th,'gilbert_rect')]=np.array([grid[y,x] for x,y in coords512x128],np.uint8) # reshape square and hilbert traversal sq=grid.ravel().reshape(256,256) seqs[(th,'reshape256_hilbert')]=np.array([sq[y,x] for x,y in coords256],np.uint8) # tile hilbert concatenate seq=[] for k in range(4): tile=grid[:,k*128:(k+1)*128] seq.extend(tile[y,x] for x,y in coords128) seqs[(th,'tile128_hilbert')]=np.array(seq,np.uint8) best=[] for (th,name),s in seqs.items(): for inv in [0,1]: ss=s^inv for rev in [0,1]: t=ss[::-1] if rev else ss for msb in [1,0]: bb=pack(t,msb) # inspect first 256 printable sc=score_bytes(bb[:512]) hits=magic_hits(bb) best.append((sc,hits,th,name,inv,rev,msb,bb[:80])) sorted(best,reverse=True,key=lambda x:x[0])[:20] [(0.279296875, [], 224, 'reshape256_hilbert', 0, 0, 0, b'\xec\x02\xbds?\xf3\x93\xc9\xe6\x9d\xffw\xbf\xc9\xfe\xbf!B\x11A\x00\x00@\x04\x00\x00@\x04@\x1c\x00\x00\x00\x04\x00\x14l6!@l6\xc0\x04\xe9o\x93\xc9l\xb6yc9c\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x009\x02\x10\x03\x00\x00'), (0.275390625, [], 208, 'reshape256_hilbert', 0, 0, 0, b'\xec\x02\xbds=\xe3\x93\xc9\xe6\x9c\xfew\xbf\xc9\xf6\x9f!\x02\x11\x01\x00\x00\x00\x00\x00\x00@\x00@\x0c\x00\x00\x00\x00\x00\x04l6!@l6@\x04\xe0g\x93\xc9l\xa69c9c\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000\x02\x10\x01\x00\x00'), (0.259765625, [], 224, 'reshape256_hilbert', 0, 0, 1, b'7@\xbd\xce\xfc\xcf\xc9\x93g\xb9\xff\xee\xfd\x93\x7f\xfd\x84B\x88\x82\x00\x00\x02 \x00\x00\x02 \x028\x00\x00\x00 \x00(6l\x84\x026l\x03 \x97\xf6\xc9\x936m\x9e\xc6\x9c\xc6\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9c@\x08\xc0\x00\x00'), (0.259765625, [], 224, 'reshape256_hilbert', 1, 0, 1, b'\xc8\xbfB1\x0306l\x98F\x00\x11\x02l\x80\x02{\xbdw}\xff\xff\xfd\xdf\xff\xff\xfd\xdf\xfd\xc7\xff\xff\xff\xdf\xff\xd7\xc9\x93{\xfd\xc9\x93\xfc\xdfh\t6l\xc9\x92a9c9\xff\xff\xff\xff\xf7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffc\xbf\xf7?\xff\xff'), (0.2578125, [], 208, 'reshape256_hilbert', 0, 0, 1, b'7@\xbd\xce\xbc\xc7\xc9\x93g9\x7f\xee\xfd\x93o\xf9\x84@\x88\x80\x00\x00\x00\x00\x00\x00\x02\x00\x020\x00\x00\x00\x00\x00 6l\x84\x026l\x02 \x07\xe6\xc9\x936e\x9c\xc6\x9c\xc6\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c@\x08\x80\x00\x00'), (0.25390625, [], 160, 'reshape256_hilbert', 0, 0, 0, b'h\x009s8c\x93\xc9\xc6\x98\xfew\xbb\xc9\xf6\x9f\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00l6 \x00l6@\x00@g\x03\xc9L\x061c9c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000\x02\x10\x01\x00\x00'), (0.25390625, [], 176, 'reshape256_hilbert', 0, 0, 0, b'\xe8\x00\xb9s8c\x93\xc9\xc6\x9c\xfew\xbb\xc9\xf6\x9f\x00\x02\x11\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00l6 \x00l6@\x00@g\x03\xc9l&9c9c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000\x02\x10\x01\x00\x00'), (0.251953125, [], 192, 'reshape256_hilbert', 0, 0, 0, b'\xec\x00\xb9s<\xe3\x93\xc9\xc6\x9c\xfew\xbb\xc9\xf6\x9f\x01\x02\x11\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00l6 @l6@\x04\xe0g\x03\xc9l&9c9c\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000\x02\x10\x01\x00\x00'), (0.23828125, [], 192, 'reshape256_hilbert', 0, 0, 1, b'7\x00\x9d\xce<\xc7\xc9\x93c9\x7f\xee\xdd\x93o\xf9\x80@\x88\x80\x00\x00\x00\x00\x00\x00\x00\x00\x000\x00\x00\x00\x00\x00\x006l\x04\x026l\x02 \x07\xe6\xc0\x936d\x9c\xc6\x9c\xc6\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c@\x08\x80\x00\x00'), (0.23046875, [], 144, 'reshape256_hilbert', 0, 0, 0, b'h\x009q\x18#\x93\xc9\xc6\x98\xfew\xbb\x89\xf6\x9f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00l6 \x00l6@\x00@g\x03\xc9L\x021c9c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000\x02\x10\x00\x00\x00'), (0.228515625, [], 224, 'reshape256_hilbert', 0, 1, 0, b'\xf7\xff;\xe3\x1b\xe1\xffa\tb\x93\x01\x93\xc9\xc6\x00\x00\x00\x10\x00\x00\x00\x00\x00@\x00\xc6\x9c\xc6\x9c\x93\xc9\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x9c\x86\x98\x00\x00@\x06\x00\x00\x00\x00\x93\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x91\xb8\x01`\x19al&'), (0.2265625, [], 128, 'reshape256_hilbert', 0, 0, 0, b'h\x009`\x18#\x93\xc9\xc6\x98\xfev\xbb\x89V\x9f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00l6 \x00l6@\x00@g\x03\xc9L\x021c9c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000\x02\x10\x00\x00\x00'), (0.2265625, [], 208, 'reshape256_hilbert', 1, 0, 1, b'\xc8\xbfB1C86l\x98\xc6\x80\x11\x02l\x90\x06{\xbfw\x7f\xff\xff\xff\xff\xff\xff\xfd\xff\xfd\xcf\xff\xff\xff\xff\xff\xdf\xc9\x93{\xfd\xc9\x93\xfd\xdf\xf8\x196l\xc9\x9ac9c9\xff\xff\xff\xff\xf7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf3\xbf\xf7\x7f\xff\xff'), (0.22265625, [], 176, 'reshape256_hilbert', 0, 0, 1, b'\x17\x00\x9d\xce\x1c\xc6\xc9\x93c9\x7f\xee\xdd\x93o\xf9\x00@\x88\x80\x00\x00\x00\x00\x00\x00\x00\x00\x000\x00\x00\x00\x00\x00\x006l\x04\x006l\x02\x00\x02\xe6\xc0\x936d\x9c\xc6\x9c\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c@\x08\x80\x00\x00'), (0.220703125, [], 224, 'reshape256_hilbert', 1, 0, 0, b'\x13\xfdB\x8c\xc0\x0cl6\x19b\x00\x88@6\x01@\xde\xbd\xee\xbe\xff\xff\xbf\xfb\xff\xff\xbf\xfb\xbf\xe3\xff\xff\xff\xfb\xff\xeb\x93\xc9\xde\xbf\x93\xc9?\xfb\x16\x90l6\x93I\x86\x9c\xc6\x9c\xff\xff\xff\xff\xef\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc6\xfd\xef\xfc\xff\xff'), (0.21875, [], 192, 'reshape256_hilbert', 0, 1, 0, b'\xf7\xff1c\x19A\xffa\t`\x93\x01\x93\xc9\x84\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x00\xc6\x9c\xc6\x9c\x93\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x1c\x86\x90\x00\x00\x00\x00\x00\x00\x00\x00\x93\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x88\x00@\t`l&'), (0.21875, [], 208, 'reshape256_hilbert', 0, 1, 0, b'\xf7\xff;\xe3\x1b\xc1\xffa\t`\x93\x01\x93\xc9\xc4\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x00\xc6\x9c\xc6\x9c\x93I\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x9c\x86\x90\x00\x00@\x04\x00\x00\x00\x00\x93\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x81\xb8\x01@\t`l&'), (0.21484375, [], 160, 'reshape256_hilbert', 0, 0, 1, b'\x16\x00\x9c\xce\x1c\xc6\xc9\x93c\x19\x7f\xee\xdd\x93o\xf9\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x000\x00\x00\x00\x00\x00\x006l\x04\x006l\x02\x00\x02\xe6\xc0\x932`\x8c\xc6\x9c\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c@\x08\x80\x00\x00'), (0.208984375, [], 144, 'reshape256_hilbert', 0, 0, 1, b'\x16\x00\x9c\x8e\x18\xc4\xc9\x93c\x19\x7f\xee\xdd\x91o\xf9\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000\x00\x00\x00\x00\x00\x006l\x04\x006l\x02\x00\x02\xe6\xc0\x932@\x8c\xc6\x9c\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c@\x08\x00\x00\x00'), (0.20703125, [], 224, 'reshape256_hilbert', 1, 1, 1, b"\x10\x00#8'x\x00yo\xb96\x7f6l\x9c\xff\xff\xff\xf7\xff\xff\xff\xff\xff\xfd\xff\x9c\xc6\x9c\xc66l\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfd\xc6\x9e\xe6\xff\xff\xfd\x9f\xff\xff\xff\xff6\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfev\xe2\x7f\xf9gy\xc9\x9b")]

Python

python
import numpy as np, math gray=np.array(img.convert('L'),dtype=float) def extract_grid_blocks(W,H,cellx,celly,xoff=0,yoff=0,fill=255, agg='mean'): arr=np.full((H,W),fill,dtype=float) for r in range(H): y0=int(round(yoff+r*celly)) y1=int(round(yoff+(r+1)*celly)) y0c=max(0,y0); y1c=min(gray.shape[0],y1) for c in range(W): x0=int(round(xoff+c*cellx)) x1=int(round(xoff+(c+1)*cellx)) x0c=max(0,x0); x1c=min(gray.shape[1],x1) if y1c>y0c and x1c>x0c: b=gray[y0c:y1c,x0c:x1c] if agg=='mean': arr[r,c]=b.mean() elif agg=='median': arr[r,c]=np.median(b) elif agg=='min': arr[r,c]=b.min() return arr def hilbert_place(seq,N): out=np.zeros((N,N),np.uint8) coords=hilbert_coords(N) for i,(x,y) in enumerate(coords): out[y,x]=seq[i] return out def tv(binimg): return (np.mean(binimg[:,1:]!=binimg[:,:-1])+np.mean(binimg[1:,:]!=binimg[:-1,:]))/2 best=[] for yoff in range(-5,6): arr=extract_grid_blocks(256,64,5,5,0,yoff) for th in range(80,241,16): bits=(arr<th).astype(np.uint8).ravel() out=hilbert_place(bits,128) best.append((tv(out),yoff,th,bits.mean())) sorted(best)[:20] [(np.float64(0.11804872047244094), 2, 80, np.float64(0.07049560546875)), (np.float64(0.1211552657480315), -3, 80, np.float64(0.07269287109375)), (np.float64(0.12235482283464567), 1, 80, np.float64(0.0733642578125)), (np.float64(0.12327755905511811), -4, 80, np.float64(0.07391357421875)), (np.float64(0.13401205708661418), 5, 80, np.float64(0.0819091796875)), (np.float64(0.13404281496062992), -5, 80, np.float64(0.08203125)), (np.float64(0.1361958661417323), 0, 80, np.float64(0.083740234375)), (np.float64(0.13874876968503935), 3, 80, np.float64(0.0845947265625)), (np.float64(0.1417630413385827), -2, 80, np.float64(0.08673095703125)), (np.float64(0.14545398622047245), 4, 80, np.float64(0.08953857421875)), (np.float64(0.14803764763779526), -1, 80, np.float64(0.091552734375)), (np.float64(0.15019069881889763), 2, 96, np.float64(0.09368896484375)), (np.float64(0.1529896653543307), -3, 96, np.float64(0.095947265625)), (np.float64(0.15437376968503935), 1, 96, np.float64(0.09649658203125)), (np.float64(0.15489665354330706), -4, 96, np.float64(0.0968017578125)), (np.float64(0.16516978346456693), 5, 96, np.float64(0.10589599609375)), (np.float64(0.1659694881889764), -5, 96, np.float64(0.10626220703125)), (np.float64(0.16781496062992127), 3, 96, np.float64(0.107421875)), (np.float64(0.16796875), 0, 96, np.float64(0.1082763671875)), (np.float64(0.17129060039370078), -2, 96, np.float64(0.10986328125))]

Python

python
for th in [80,96,112,128,144,160,176,192,208]: arr=extract_grid_blocks(256,64,5,5,0,0) bits=(arr<th).astype(np.uint8).ravel() out=hilbert_place(bits,128) p=bits.mean() print(th,p,tv(out), tv(out)/(2*p*(1-p)+1e-9))

Python

python
def recon_candidate(N,th=128): W=2*N; H=N//2 arr=np.array(gray_img.resize((W,H),Image.Resampling.LANCZOS)) bits=(arr<th).astype(np.uint8).ravel() out=hilbert_place(bits,N) return arr,bits,out for N in [32,64,128,256,512]: arr,bits,out=recon_candidate(N,128) p=bits.mean(); norm=tv(out)/(2*p*(1-p)+1e-9) print(N,arr.shape,p,tv(out),norm) Image.fromarray((255*(1-out)).astype(np.uint8)).save(f'/mnt/data/candN{N}.png')

Python

python
for N in [1024]: arr,bits,out=recon_candidate(N,128) p=bits.mean(); print(N,p,tv(out)/(2*p*(1-p)+1e-9)) Image.fromarray((255*(1-out)).astype(np.uint8)).save(f'/mnt/data/candN{N}.png')

Python

python
1280+317,1280^317,1280*317,1280-317, 1280//317, 1280%317 (1597, 1085, 405760, 963, 4, 12)

Python

python
from PIL import Image import numpy as np, math orig=np.array(img.convert('L'),dtype=np.float32) def reproj_err(w,h,down=Image.Resampling.LANCZOS,up=Image.Resampling.LANCZOS,binary=False): sm=img.convert('L').resize((w,h),down) if binary: ar=np.array(sm) ar=np.where(ar<128,0,249).astype(np.uint8) sm=Image.fromarray(ar) upim=sm.resize(img.size,up) arr=np.array(upim,dtype=np.float32) return np.mean((arr-orig)**2) cands=[] for w in [128,256,320,384,512,640,768,1024]: h=round(w*317/1280) for dh in range(-2,3): hh=h+dh if hh<=0:continue e=reproj_err(w,hh,Image.Resampling.LANCZOS,Image.Resampling.LANCZOS,False) cands.append((e,w,hh)) sorted(cands) [(np.float32(167.8955), 1024, 253), (np.float32(179.88431), 1024, 256), (np.float32(180.71971), 1024, 255), (np.float32(182.67139), 1024, 252), (np.float32(183.29886), 1024, 254), (np.float32(447.48328), 768, 192), (np.float32(448.57153), 768, 189), (np.float32(452.33752), 768, 191), (np.float32(457.55405), 768, 190), (np.float32(458.2322), 768, 188), (np.float32(682.3918), 640, 160), (np.float32(687.91125), 640, 159), (np.float32(693.494), 640, 158), (np.float32(695.9654), 640, 157), (np.float32(701.94305), 640, 156), (np.float32(962.4773), 512, 128), (np.float32(978.0271), 512, 129), (np.float32(1004.1798), 512, 126), (np.float32(1005.9511), 512, 127), (np.float32(1016.3845), 512, 125)]

Python

python
cands=[] for w in [256,512,768,1024]: h0=round(w*317/1280) for hh in range(max(1,h0-5),h0+6): for th in [96,128,160,192,224]: sm=img.convert('L').resize((w,hh),Image.Resampling.LANCZOS) ar=np.array(sm) # binary endpoints choose white ~249 black ~10 maybe br=np.where(ar<th,0,249).astype(np.uint8) up=np.array(Image.fromarray(br).resize(img.size,Image.Resampling.LANCZOS),dtype=np.float32) e=np.mean((up-orig)**2) cands.append((e,w,hh,th)) sorted(cands)[:20] [(np.float32(602.0542), 1024, 259, 128), (np.float32(741.27826), 1024, 253, 128), (np.float32(751.53326), 1024, 258, 128), (np.float32(756.54535), 1024, 257, 128), (np.float32(758.54474), 1024, 259, 96), (np.float32(763.5405), 1024, 254, 128), (np.float32(763.54456), 1024, 255, 128), (np.float32(764.03015), 1024, 252, 128), (np.float32(768.3832), 1024, 250, 128), (np.float32(768.96405), 1024, 256, 128), (np.float32(774.01733), 1024, 249, 128), (np.float32(774.1213), 1024, 251, 128), (np.float32(777.83203), 1024, 259, 160), (np.float32(921.0165), 1024, 253, 96), (np.float32(933.57605), 1024, 258, 96), (np.float32(935.33234), 1024, 257, 96), (np.float32(943.1515), 1024, 255, 96), (np.float32(944.2754), 1024, 254, 96), (np.float32(944.5627), 1024, 253, 160), (np.float32(947.085), 1024, 252, 96)]

Python

python
# reconstruct 1024x254 from preview arr254=np.array(gray_img.resize((1024,254),Image.Resampling.LANCZOS)) for th in [96,112,128,144,160,176,192,208]: bits=(arr254<th).astype(np.uint8).ravel() for mode in ['end0','end1','start0','start1','mid0']: pad=np.zeros(2048,dtype=np.uint8) if mode.endswith('1'): pad[:]=1 if mode.startswith('end'): b=np.concatenate([bits,pad]) elif mode.startswith('start'): b=np.concatenate([pad,bits]) else: k=len(bits)//2 b=np.concatenate([bits[:k],pad,bits[k:]]) out=hilbert_place(b,512) # score normalized tv p=b.mean() norm=tv(out)/(2*p*(1-p)+1e-9) if th==128: print(mode, norm) if th in [128,160] and mode in ['end0','start0']: Image.fromarray((255*(1-out)).astype(np.uint8)).save(f'/mnt/data/pad512_{th}_{mode}.png')

Python

python
import hashlib, itertools, re, string, numpy as np, math keys = [ b'1280x317', b'1280*317', b'1280317', b'1280,317', b'1597', b'405760', b'963', b'1085', b'1024x254', b'1024254', b'260096', b'127', b'512x127', b'512127', b'65024', b'256x64', b'25664', b'16384', b'512', b'256', b'128', b'9', b'8', b'7', b'Hilbert', b'hilbert', b'DavidHilbert', b'David Hilbert', b'password', b'key' ] # add hashes/digests of resolution strings as byte keys for s in [b'1280x317',b'1024x254',b'512x127',b'1597',b'405760']: keys += [hashlib.md5(s).digest(), hashlib.sha1(s).digest(), hashlib.sha256(s).digest(), hashlib.sha512(s).digest()] def xor_repeat(bb,k): return bytes(b ^ k[i%len(k)] for i,b in enumerate(bb)) def textscore(bb): if not bb:return 0 return sum((32<=x<127) or x in (9,10,13) for x in bb)/len(bb) def candidates_seq(): out=[] # N based on raster 2N x N/2 for N in [64,128,256,512]: W,H=2*N,N//2 arr=np.array(gray_img.resize((W,H),Image.Resampling.LANCZOS)) for th in [96,128,160,192,224]: strip=(arr<th).astype(np.uint8).ravel() # A: place strip along hilbert, flatten sq=hilbert_place(strip,N) out.append((f'N{N}_th{th}_place', sq.ravel())) # B: reshape strip into square then traverse hilbert temp=strip.reshape(N,N) coords=hilbert_coords(N) trav=np.array([temp[y,x] for x,y in coords],np.uint8) out.append((f'N{N}_th{th}_trav',trav)) return out seqcand=candidates_seq() hits=[] best=[] for name,s in seqcand: for inv in [0,1]: ss=s^inv for rev in [0,1]: t=ss[::-1] if rev else ss for msb in [True,False]: bb=pack(t,msb) # direct low=bb.lower() for pat in [b'flag{',b'ctf{',b'flag',b'ctf',b'pk\x03\x04',b'\x89png',b'%pdf',b'rar!']: idx=low.find(pat.lower()) if idx>=0: hits.append((name,inv,rev,msb,'direct',pat,idx,bb[idx:idx+100])) # xor keys for k in keys: xx=xor_repeat(bb,k) low=xx.lower() for pat in [b'flag{',b'ctf{',b'flag',b'ctf',b'pk\x03\x04',b'\x89png',b'%pdf',b'rar!']: idx=low.find(pat.lower()) if idx>=0: hits.append((name,inv,rev,msb,k[:20],pat,idx,xx[idx:idx+100])) best.append((textscore(xx[:512]),name,inv,rev,msb,k,xx[:100])) len(hits), hits[:20], sorted(best,reverse=True,key=lambda x:x[0])[:5] (29, [('N64_th224_place', 0, 0, False, b'1597', b'ctf', 402, b'CTF\x05\xff\xf8\xc3rCv\x15\x15:\xfa\xde\xb6\xf4\xc72I\xf5\xd7/<\xf8\x87\xbf2?\xf41|\xc6\r\x02\t%8-:\x82\x1f\xc2\x05\x05\xf8\x9f\xc7\xad\xb7\xb1\xc5\x84<\x0b\xeb\x01\xfb\xe1A\xb4\x08\x91\xc0\xc6\xbb\n2\xb8\xed\x00\x84\xb6\xfa*\xb6y\xc7\xcez\xfa\xf8\xfa\xf0\n5\x00f\xc9\xf6R\xfd\xc6$\x1e(\xda\xe7U\xeb'), ('N64_th224_trav', 0, 0, False, b'5 \xa5y18\xe1\xbc\xd2\xc6\xca\x02\xdc\x94H\xd2\xbd\x119\xa8', b'ctf', 87, b"CtF\xdb\x0b\xf4k\xf7m\xd9\x11\xb0\xd4\xca\xd3\xc9\xc37\xe0\x9c\x02\xc2\xc6\xcaB\xca'@\xdbBn\xc0\xa35 \x17\xe21\xb84\xdb+\xee\xca\x02\xdd\x1e\x8b<\x95\x11)7\xcb\xdf'.\xf08A\x9c\xec=\x8f\xb5\xda\x04\xb79\xd1\xee\x02\xc8U$^\x86\xb09rC_\xce\xea\x02#{\xaf\xcd$Qy\xb8\x1b\xefS\xe5\xe9\xb04"), ('N256_th96_place', 0, 1, True, b'DavidHilbert', b'ctf', 7066, b'ctF\xd5vi\xd4\xc8)l"e"tD\xc9\xb5i\xe4Lj|\xa2Ustdafih\x8bylf\xd7rD\x04\xa16\x19\x84\x08*<n\xa1\xf2t\x84QwY\x84Hhm"ertFauu#Hj\xd4\xa2\xa5r$\x04\xa1Vih\x88\xe9lb\x05rU\xa4evk\xa4Hyl`epX\x03a'), ('N256_th160_place', 0, 0, True, b'\xebW\xf9I\x95l\xc9\xf3\xc3.\xb7\xf2I\xbb\xe5jt\xc2S\x01', b'ctf', 1167, b'ctFS"\xda-\xdc\xd4\xfc\xe8=\xe4\xe1\x97K\xd0\xeb\x97)}\x89\xac\x18\xf3\xcc\x0e\xb7\xf0Y\xab\xe5ctMS\x86\xda\x08\xdd\xd4\xfcX\x1d\xe8\xf1\x17\x0b\xd0\xe3\x97\xba9\x9b\xac\xc9\xf3\xce>\xb7\xf2\t{\xe5jD*R\xc1Z\xfe\xdc\xdb\xfcX\xcd$\xb1W\x1b0\xe3\'\xfai\x99,\xc8\xf3\xce/\xcb\xf2I\xbb\xe5j\x04\nP'), ('N256_th224_place', 0, 0, False, b'\xc3\xef\x8b\x99\xda\xe7\xf0\xf4\xc6\x11W\xfdC\xff$\xbd\x87\x0c\xacv', b'ctf', 4063, b'CTF2m\xef\x0e\xb9\x14\x18\xe3\xc4R~\x1a\x89\xb9\x9eh\x96\xcal"\xd5\x89\x10\x8db5\x84\xff4\xbb0\x93uf\xc5\xe7\xbcw\xd9\x11[=S\xff$\xd1\x89\xd3\xb4\x06F\xb3(\xb4=\xb4Q\xff ug\xb2\xa3\xfd\xbd\xa2\xd3\x80\xf5\xa8\xd1\xe7H\x8dJ\x15i\x8d\xe1d\x97\xfao \xd5+#\x86\x8c\xf6A\xc3\xcb\xea?\xe7\xfb'), ('N256_th224_trav', 0, 0, False, b'DavidHilbert', b'ctf', 2962, b'ctF\xa1\xb0\xf5\x08|k\xecber\xfd]\x03\xe5\xa8d\xc0b\r\x1eS\xb2pD!\xed\x94\x9b\xc3`Mz]\x9c\x06F\xe1VidHiMzertDa\xf0\xf1dL\xaf\xf2\x86{bt$a\x16e\xa2\xf7\xfa\xa5{\x05\xf05Dav\x10f\x9e\xde\xb3\xbd\x9a\xe3t\x00uv}L\xd4J\x93\x94\xba\x8d\x8b\xff '), ('N256_th224_trav', 0, 0, False, b'David Hilbert', b'ctf', 2962, b'ctF\xa1\xb0\xf5\x08\x14J\xe9lbe\xfbm&\xf2\xb7i\xec+)\x15Z\xa2ar4\xdf\x9c\x89\xe2m\x01PQ\x82\x10g\xf2TDaviE8Hilbe\xf4\xecDe\xb0\xf7\x80>Xi\x0cb\x05~\xb2\xfb\xf2\xbfp\x04\xa2\tilb\x1cp\xa2\xf3\xbe\xa9\x96\xf5 \x0c}lvM\xeeW\xbb\x97\xa9\x96\x9b\x9b\t'), ('N512_th96_place', 1, 0, False, b'\xc3\xef\x8b\x99\xda\xe7\xf0\xf4\xc6\x11W\xfdC\xff$\xbd\x87\x0c\xacv', b'ctf', 21889, b'ctf)\xca\x0f\x0b:\xee\xa8\xc1\xb7\x03\xd3Bt\xf3S\x89jL\xc7\x87\xf9\xfb\x92\xc0\nJ\xd9\xb3\xab>\xbe\x92 \x7fE\x95(<\xb8\x82\x81\xea\x85M\x01ia\xaec\xee*\x04\xe3\x89s\xc9s\x0c\x08\xcb0(tf)\x08\x0f\x0b9\xee\xa8\x01\xb2\x0f\xd3Bg\xf3S\x89jL\xc7\x87\xf9\xbb\xd1\xc0\n\x8a[\xb3\xab>\xbe\x92#'), ('N512_th128_place', 0, 0, True, b'Hilbert', b'flag', 18481, b'flag\x02t\x8b\xa9tb)\xf2LHf\xbcbeb\xb4Hiqbuv\x0bGi\xacmeBxKikffrDG\xa5lRi\xb6DH\x12`Be=xMi\x15b\x95rwHi\xa3bfp\x04H\xb8\xec^e2\xf4ticberpHilfentC\xe6lbbr\x84\x14jo'), ('N512_th128_place', 0, 0, True, b'hilbert', b'flag', 18481, b'flag\x02t\xab\xa9tb)\xf2Lhf\xbcbeb\xb4hiqbuv\x0bgi\xacmeBxkikffrDg\xa5lRi\xb6Dh\x12`Be=xmi\x15b\x95rwhi\xa3bfp\x04h\xb8\xec^e2\xf4Ticberphilfentc\xe6lbbr\x844jo'), ('N512_th128_place', 0, 1, False, b'Hilbert', b'ctf', 467, b'CtF\xe9\x1d\xe2jr|\xc8fllU\xb2\xf47\x19\x9c\xe2\x9atEH\xafj\xd3\xe5utHol"e|t\xb8i\x1eb\x95r\x07Hgt`}|lJqn\x9ddmv\xb7hsbe,tNi\x92bkrhHklnerLHilReBtHi\\berDhe|b\x05~d'), ('N512_th128_place', 0, 1, False, b'hilbert', b'ctf', 467, b'Ctf\xe9\x1d\xe2jr|\xe8fllU\xb2\xf4\x17\x19\x9c\xe2\x9atEh\xafj\xd3\xe5uthol"e|t\x98i\x1eb\x95r\x07hgt`}|ljqn\x9ddmv\x97hsbe,tni\x92bkrhhklnerLhilReBthi\\berDHe|b\x05~d'), ('N512_th128_place', 1, 0, False, b'\xc3\xef\x8b\x99\xda\xe7\xf0\xf4\xc6\x11W\xfdC\xff$\xbd\x87\x0c\xacv', b'ctf', 21889, b'ctf)\xcb\x0f\x0b:\xee\xa8\xc1\xf7\x0b\xd3Bt\xf3S\x8dj|\xc7\x07\xf9\xfb\x92\xc0\nJY\xb3\xab>\xbe\x92 \x7fE\x95(,\xb8\x82\x85\xea\x85M\x01ha\x8ec\xee*\x04\xe3\x89s\xc9s\x0c\x08\xc90(tf)\xaa\x0f\x0b9\xee\xa8\x01\xb2\x0f\xd3Bg\xf3S\x89jl\xc7\x87\xf9\xbb\xd1\xc0\n\x8a[\xb3\xab>\xbe\x92#'), ('N512_th128_place', 1, 1, True, b'\xe3\xe2\x8f-\x86\xd4\xf1[\xc4\xdc*.au\xff\xfc\x07\x87D\x9f', b'ctf', 29533, b'ctf\x1c\x1fp\xd2~\x1b\x0e\xa8;#\xd5Q\x9e\x8a\x00\x03\xe8t\xb3-\xc2\xf8\x1f\x07\x844\x8f\xc7\xeacCj\x1c\xd1p\xd2y"\x0e\xe4;#\xd3\xc1\xae\x0b\x00\xd3\xb3x\xb8`\xc5\xf4\xc2\xfb\xe6\xc5\xb3\xb7\xd0\xa2vi\x1c\x1dp\xd4u\xd4\x0e\xa9;#\xd5\xd1\x9e\x8e\x00\x03\xf8x\xb7c\xc2\xf4\x0f\x0b\xc5\xc7\xba\x87*czd\x1d'), ('N512_th160_place', 0, 1, True, b'DavidHilbert', b'ctf', 5998, b'CtF\xaevn\xa4\x88jbbe\x82GDjved\xdfi|bfq\xf4Dav\xaad)i\r\x8dest\xb4avi\xa4HUl\xbce\xb3tr\x11\xc9idHi\xecmu\x81tB\x11\x05idAik\xa2\xa5r{Da\xf6ZdEidbyrDDbqidHi\xecb&r7\x8ba'), ('N512_th160_place', 0, 1, False, b'Hilbert', b'ctf', 467, b'CtF\xe9\x1d\xe2jrx\xc8fllU\xb2\xf4\xb7\x99\x9c\xe2\x9at\r\xc8\x8ej\xd3\xe5utHol"e|t\xb8i\x9eb\x94r\x87Hft`}}lJqo\x9ddmw\xb7hsfe,tOi\x92bkrhHjl~erLHilReBthi\\be\xf2D(g|b\x05|\xe4'), ('N512_th160_place', 0, 1, False, b'hilbert', b'ctf', 467, b'Ctf\xe9\x1d\xe2jrx\xe8fllU\xb2\xf4\x97\x99\x9c\xe2\x9at\r\xe8\x8ej\xd3\xe5uthol"e|t\x98i\x9eb\x94r\x87hft`}}ljqo\x9ddmw\x97hsfe,toi\x92bkrhhjl~erLhilReBtHi\\be\xf2D\x08g|b\x05|\xe4'), ('N512_th160_place', 1, 0, True, b'\xc3\xef\x8b\x99\xda\xe7\xf0\xf4\xc6\x11W\xfdC\xff$\xbd\x87\x0c\xacv', b'ctf', 24961, b'ctf%\x14\x0f+:\x9a\xa5\rL\x00\xdbBx\xf3\xe0\x89RO\xc8\x8b\xf9\xbb\xae\xc6\nJ\xd9\xb3\xa8\r\xbe\x92`\x7fEz1\x13\xbb\xb2\x81\x18\x86}\xc1\x98iu\x9b\xde,8\xe0\x89C4[\x03\x08\x0b<\xf1tf\xa5\x07\x0f;:\xd2\xa7\rL\x00\xdbBx\xf3\xa0\x89\xa2L\xc8\x89\xf9\xbb\xb6\xcf\nJ\xb9\xb3\xa8\x0c\xbe\x90@'), ('N512_th160_place', 1, 0, False, b'\xc3\xef\x8b\x99\xda\xe7\xf0\xf4\xc6\x11W\xfdC\xff$\xbd\x87\x0c\xacv', b'ctf', 21889, b'ctf)\xeb\x0f\x0b:\xee\xa8\xc1\xe7\x0b\xd3Bt\xf3S\xadj|\xc7\x07\xf9\xfb\x92\xc0\nJ[\xb3\xab>\xbe\x92 \x7fE\x95j,\xb8\x82\x87\xea\x85M\x01la\x8ec\xee*\x04\xe1\x89s\xcbs\x0c\x08\xc90(\xf4f)\xa3\x8f\x0b9\xee\xa8\x01\xf2\x0f\xd7Bg\xf3S\x89jl\xc7\x87\xf9\xbbQ\xc0\n\x8a[\xb3\xab>\xbe\x92#'), ('N512_th160_trav', 0, 1, True, b'\xebW\xf9I\x95l\xc9\xf3\xc3.\xb7\xf2I\xbb\xe5jt\xc2S\x01', b'ctf', 20943, b'ctF\x15cZ\xf4\xdd\xdb\x0c\x98\xcd\xe4\xb2n\xcb\xd0\xebW\xf9I\xd4l\xc95\xe3.\xb7\xf2I\xbb\xe5jt\xc2S\x01Z\xf4\xdd\xdb\x0e\xb8\xcd\xec\xa7;W\x96"\xc4yI\x95l\xff\x9fS(\xb7\xf2I\xaa\xa5j\xec\x04\x9a\x92Z\xe5\x9d\xdb\x0c\x98\xcd\xe4\x91W\xcb\xc0w\x91+8^\xec\xaa\xca\n\xac\xb7\xf2I\xbb\xe5jt\xc2S')], [(0.9609375, 'N64_th96_place', 0, 0, False, b'hilbert', b'~ylbart\xe0idb%rthi|be2t\xf8{lrmstxilsertxilb%rth}dne2vhilberti\xe9nbuRthil\xe2trt\xe8idgerthilBarthilberthil`dvthk'), (0.9609375, 'N64_th96_place', 0, 1, True, b'hilbert', b'hilberthklberthalberthilbertiilburtiilberth{lburthilbertii,be\xf2tj\xa9lrurviidberthil`erthilberpjilberthi'), (0.958984375, 'N64_th96_place', 0, 0, False, b'key', b'}uykayk\xedyce9keykuyk%y\xfbwy{mxkuyktykeikey+eykqqge9ieykeykex\xebgy{Eykey\xebtyk\xe5yc`ykeykeYoeykeykeykeykgxoeyi'), (0.958984375, 'N64_th96_place', 0, 1, True, b'key', b'keykeyke{keykeyceykeykeykeykdykeikexkeykeykwykuykeykeykexk%yk\xe5yi\xa5y{uyidyceykeyke{keykeykeyogykeykeyk'), (0.958984375, 'N64_th96_trav', 0, 0, False, b'hilbert', b'\xcai\xec`ertxilrertH\xe9mbert\xe8ilBert(il"drdh)<bErt\xd8ilbez4hilberthilber|hilbe2thi\\rerthylberthil`erthi|z}rthA')])

Python

python
# Retrieve specific candidate cand = [x for x in seqcand if x[0]=='N512_th128_place'][0][1] bb=pack(cand,True) xx=xor_repeat(bb,b'Hilbert') # find longest printable runs runs=[] start=None for i,b in enumerate(xx): if 32<=b<127: if start is None:start=i else: if start is not None and i-start>=8:runs.append((i-start,start,xx[start:i])) start=None runs=sorted(runs,reverse=True)[:30] runs[:10] [(57, 10466, b'YlaxspzIlbSBtHilkep{HilbdrwHilbesthimbmrthelUdr|OjljjqwHi'), (51, 32016, b'BtHi[rerqH`lce{tHildertNj`Rgu|hjlbCrtHOlRhtyxejmm{|'), (51, 8096, b'erDHZ`birwKdlb%~~Hgble|z@idmor~Ael^e~t|icber{Hilber'), (49, 9127, b"tHilber{HYlbeB|HilbUrtHYlBesthiLber2HIl'eqt@i`aer"), (47, 8161, b'thim~yztKosberx@ilbkrxDalbjrtHfljfqt@joneq{Diom'), (45, 9180, b'be~tPh~bertHilbertGi\\berDHilbertHilbertHjlber'), (42, 31871, b'HilaortKa`Perx{ilbkrtHglbe~tHibrerEH[lRe!t'), (38, 32512, b'ertCilbzrtHwlaenpHflceutJibbfrsHileert'), (37, 30948, b'ilm%rtZflbu}uHybcerrYilbebtHYljEBt@il'), (36, 11206, b'THilReqdHi`beszHilRa}rHidb}~dHiNbg2t')]

Python

python
def filtered_hilbert_seq(grid): H,W=grid.shape n=1 while n<max(W,H): n*=2 coords=hilbert_coords(n) seq=np.array([grid[y,x] for x,y in coords if x<W and y<H],dtype=np.uint8) return seq for shape in [(512,127),(512,128),(1024,254),(1024,256)]: W,H=shape ar=np.array(gray_img.resize((W,H),Image.Resampling.LANCZOS)) for th in [96,128,160,192]: grid=(ar<th).astype(np.uint8) seq=filtered_hilbert_seq(grid) print(shape, th, len(seq), seq.mean()) for inv in [0,1]: for msb in [True,False]: bb=pack(seq^inv,msb) hits=magic_hits(bb) sc=

Python

python
W,H=512,127 ar=np.array(gray_img.resize((W,H),Image.Resampling.LANCZOS)) grid=(ar<128).astype(np.uint8) seq=filtered_hilbert_seq(grid) bb=pack(seq,False) i=bb.find(b'\x1f\x8b') i, bb[i:i+20].hex() (933, '1f8bd420c0380000000000000000000000000000')

Python

python
seq=filtered_hilbert_seq((np.array(gray_img.resize((512,127),Image.Resampling.LANCZOS))<128).astype(np.uint8)) # run lengths runs=[] prev=seq[0]; l=1 for b in seq[1:]: if b==prev:l+=1 else:runs.append((int(prev),l));prev=b;l=1 runs.append((int(prev),l)) from collections import Counter Counter(l for b,l in runs).most_common(30), len(runs), np.mean([l for b,l in runs]) ([(1, 2213), (2, 1496), (3, 724), (4, 570), (5, 349), (6, 284), (8, 192), (7, 159), (10, 136), (9, 126), (12, 116), (11, 80), (13, 54), (15, 38), (14, 36), (16, 33), (18, 29), (17, 28), (19, 22), (20, 22), (34, 18), (24, 17), (21, 16), (23, 14), (32, 13), (25, 12), (22, 11), (37, 11), (35, 9), (27, 8)], 7207, np.float64(9.022339392257527))

Python

python
import numpy as np, math def coarse_var(imgbin, block=8): H,W=imgbin.shape h=H//block; w=W//block x=imgbin[:h*block,:w*block].reshape(h,block,w,block).mean((1,3)) return x.var(), x.max()-x.min(), x.max(), x.min() offsets=[0,1280,317,1597,405760,963,1085,512,127,65024,1024,254,260096,256,128,16384,23,1862,1943,81] for N in [256,512]: W,H=2*N,N//2 arr=np.array(gray_img.resize((W,H),Image.Resampling.LANCZOS)) strip=(arr<128).astype(np.uint8).ravel() print("N",N) vals=[] for off in offsets: o=off%len(strip) for sign in [1,-1]: s=np.roll(strip,sign*o) out

Python

python
import numpy as np, math def coarse_var(imgbin, block=8): H,W=imgbin.shape h=H//block; w=W//block x=imgbin[:h*block,:w*block].reshape(h,block,w,block).mean((1,3)) return x.var(), x.max()-x.min(), x.max(), x.min() offsets=[0,1280,317,1597,405760,963,1085,512,127,65024,1024,254,260096,256,128,16384,23,1862,1943,81] for N in [256,512]: W,H=2*N,N//2 arr=np.array(gray_img.resize((W,H),Image.Resampling.LANCZOS)) strip=(arr<128).astype(np.uint8).ravel() print("N",N) vals=[] for off in offsets: o=off%len(strip) for sign in [1,-1]: s=np.roll(strip,sign*o) out

Python

python
import time, numpy as np H,W=317,1280 grid_actual=(np.array(img.convert('L'))<128).astype(np.uint8) t0=time.time() seq_list=[] n=2048 for d in range(n*n): x,y=hilbert_d2xy(n,d) if x<W and y<H: seq_list.append(grid_actual[y,x]) len(seq_list), time.time()-t0 (405760, 12.702788591384888)

Python

python
seq_actual=np.array(seq_list,dtype=np.uint8) for inv in [0,1]: for rev in [0,1]: s=(seq_actual^inv)[::-1] if rev else (seq_actual^inv) for msb in [True,False]: bb=pack(s,msb) print(inv,rev,msb,score_bytes(bb[:2000]),magic_hits(bb)[:10],bb[:20].hex())

Python

python
def analyze_bitseq(name,s): res=[] for inv in [0,1]: si=s^inv for rev in [0,1]: sr=si[::-1] if rev else si for bitoff in range(8): for msb in [True,False]: bb=pack(sr[bitoff:],msb) hits=magic_hits(bb) # printable score over first 2k and max sliding maybe sc=score_bytes(bb[:2000]) if hits or sc>0.35: res.append((hits,sc,inv,rev,bitoff,msb,bb[:80])) print(name, sorted(res,key=lambda x:x[1],reverse=True)[:20]) analyze_bitseq('actual_filter2048',seq_actual)

Python

python
from collections import Counter gray8=np.array(img.convert('L')) cntg=Counter(gray8.ravel().tolist()) cntg.most_common(30), len(cntg), np.percentile(gray8,[0,1,5,10,15,20,25,50,75,90,95,99,100]) ([(249, 117353), (250, 43023), (248, 29231), (251, 16773), (247, 14801), (252, 11635), (246, 10972), (254, 10455), (253, 10185), (245, 8430), (1, 7703), (244, 6436), (2, 6380), (243, 4810), (3, 4656), (4, 4381), (242, 3429), (255, 3375), (5, 3065), (6, 2441), (241, 2432), (0, 2418), (7, 1979), (240, 1792), (8, 1436), (239, 1345), (9, 1127), (238, 1071), (10, 910), (237, 855)], 256, array([ 0., 1., 3., 19., 90., 166., 225., 249., 249., 251., 253., 254., 255.]))

Python

python
import sympy as sp, math sp.factorint(65024), [(d,65024//d) for d in sp.divisors(65024) if d<=math.sqrt(65024)][-20:] ({2: 9, 127: 1}, [(1, 65024), (2, 32512), (4, 16256), (8, 8128), (16, 4064), (32, 2032), (64, 1016), (127, 512), (128, 508), (254, 256)])

Python

python
coords256full=coords256 seq=grid.ravel() for orient in ['y254','x254']: if orient=='y254': coordsf=[(x,y) for x,y in coords256full if y<254] out=np.ones((254,256),np.uint8)*255 for i,(x,y) in enumerate(coordsf): out[y,x]=0 if seq[i] else 255 else: coordsf=[(x,y) for x,y in coords256full if x<254] out=np.ones((256,254),np.uint8)*255 for i,(x,y) in enumerate(coordsf): out[y,x]=0 if seq[i] else 255 print(orient,len(coordsf),tv(out<128)) Image.fromarray(out).save(f'/mnt/data/place_filtered_{orient}.png')

Python

python
# detailed reprojection MSE for width around 900-1100 and proportional h vals=[] for w in range(900,1101,8): hr=317*w/1280 for h in range(max(1,int(hr)-4),int(hr)+5): e=reproj_err(w,h,Image.Resampling.LANCZOS,Image.Resampling.LANCZOS,False) vals.append((e,w,h,w/h)) sorted(vals)[:30] [(np.float32(135.9198), 1060, 259, 4.0926640926640925), (np.float32(140.58423), 1100, 274, 4.014598540145985), (np.float32(141.24484), 1100, 276, 3.9855072463768115), (np.float32(141.44276), 1052, 259, 4.061776061776062), (np.float32(142.00204), 1044, 259, 4.030888030888031), (np.float32(142.70592), 1100, 275, 4.0), (np.float32(143.67984), 1092, 274, 3.9854014598540144), (np.float32(144.01714), 1100, 271, 4.059040590405904), (np.float32(144.989), 1100, 273, 4.029304029304029), (np.float32(146.21255), 1036, 259, 4.0), (np.float32(146.33098), 1100, 269, 4.089219330855019), (np.float32(146.33281), 1100, 272, 4.044117647058823), (np.float32(147.09805), 1092, 271, 4.029520295202952), (np.float32(147.94153), 1092, 273, 4.0), (np.float32(148.46143), 1084, 271, 4.0), (np.float32(149.38226), 1092, 272, 4.014705882352941), (np.float32(149.42993), 1092, 269, 4.059479553903346), (np.float32(150.07469), 1100, 268, 4.104477611940299), (np.float32(150.35588), 1100, 270, 4.074074074074074), (np.float32(150.74815), 1084, 269, 4.029739776951673), (np.float32(150.74985), 1084, 272, 3.985294117647059), (np.float32(153.0524), 1092, 268, 4.074626865671642), (np.float32(153.34973), 1092, 270, 4.044444444444444), (np.float32(153.99179), 1084, 265, 4.090566037735849), (np.float32(154.41649), 1084, 268, 4.044776119402985), (np.float32(154.61273), 1076, 269, 4.0), (np.float32(154.73941), 1084, 270, 4.014814814814815), (np.float32(155.07018), 1092, 267, 4.089887640449438), (np.float32(156.34995), 1092, 266, 4.105263157894737), (np.float32(156.49307), 1084, 267, 4.059925093632959)]

Python

python
from PIL import Image methods=[Image.Resampling.NEAREST,Image.Resampling.BOX,Image.Resampling.BILINEAR,Image.Resampling.BICUBIC,Image.Resampling.LANCZOS] grids=[] for m in methods: ar=np.array(gray_img.resize((1024,254),m)) grids.append((ar<128).astype(np.uint8)) # pairwise disagreement for i,m1 in enumerate(methods): print(i,[np.mean(grids[i]!=grids[j]) for j in range(len(methods))]) cons=(sum(grids)>=3).astype(np.uint8) cons.mean() np.float64(0.1731437623031496)

Python

python
results=[] for name,s in seq_models.items(): for inv in [0,1]: si=s^inv for rev in [0,1]: sr=si[::-1] if rev else si for off in range(7): for msb in [True,False]: vals=pack_n(sr[off:],7,msb) sc=score_printable_vals(vals[:5000]) # string direct b=bytes(v for v in vals if v<256) hit=[] low=b.lower() for pat in [b'flag',b'ctf',b'key',b'pass']: idx=low.find(pat) if idx>=0:hit.append((pat,idx,b[idx:idx+80])) results.append((sc,hit,name,inv,rev,off,msb,b[:80 [(np.float64(0.4648), [], 'place508_flat', 1, 1, 0, True, b'?\x00\x1f\x7f\x0f\x7fc\x7f\x7f?~?\x7f}\x7f?y\x7f\x7f\x7fx?\x7f\x7f\x7fg\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7fq\x7f\x7f\x7frO\x7fO\x7fp\\\x1b\x7fG\x7f\x7fa\x7f\x7f\r_p`?~\x1f\x7f~\x1f\x7f\x07|q\x7f\x7fC\x7f\x7f\x7f\x7f\x00/\x7f_\x7fs'), (np.float64(0.4604), [], 'place508_flat', 1, 1, 6, False, b'\x01x\x7fq\x7fG\x7f\x7f}\x7f|\x7f?\x7f}\x1f\x7f\x7f\x7f\x1f|\x7f\x7f\x7fg\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x0f\x7f\x7f\x7fOr\x7fs\x7f\x0f:X\x7fc\x7f\x7f\x07\x7f\x7f1{\x0f\x06|\x7fx\x7f\x7fx\x7fa?\x0e\x7f\x7fC\x7f\x7f\x7f\x7f\x01t\x7f{\x7fO\x7f'), (np.float64(0.4602), [], 'place508_flat', 1, 1, 0, False, b"~\x00|\x7fx\x7fc\x7f\x7f~?~\x7f_\x7f~O\x7f\x7f\x7f\x0f~\x7f\x7f\x7fs\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7fG\x7f\x7f\x7f'y\x7fy\x7f\x07\x1dl\x7fq\x7f\x7fC\x7f\x7fX}\x07\x03~?|\x7f?|\x7fp\x1fG\x7f\x7fa\x7f\x7f\x7f\x7f\x00z\x7f}\x7fg"), (np.float64(0.4568), [], 'place508_flat', 1, 1, 1, True, b'~\x00?~\x1f\x7fG\x7f~\x7f|\x7f\x7f{~\x7fs\x7f\x7f\x7fp\x7f\x7f\x7f\x7fO\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7fc\x7f\x7f\x7fe\x1f\x7f\x1f\x7fa87\x7f\x0f\x7f\x7fC\x7f~\x1b?a@\x7f|?\x7f|?~\x0fyc\x7f\x7f\x07\x7f\x7f\x7f~\x00_\x7f?\x7fg'), (np.float64(0.4566), [], 'place508_flat', 1, 1, 6, True, b"@\x0f\x7fG\x7fq\x7f\x7f_\x7f\x1f\x7f~\x7f_|\x7f\x7f\x7f|\x1f\x7f\x7f\x7fs\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7fx\x7f\x7f\x7fy'\x7fg\x7fx.\r\x7fc\x7f\x7fp\x7f\x7fFox0\x1f\x7f\x0f\x7f\x7f\x0f\x7fC~8\x7f\x7fa\x7f\x7f\x7f\x7f@\x17\x7fo\x7fy\x7f"), (np.float64(0.4564), [], 'place508_flat', 1, 1, 3, True, b'x\x01\x7fx\x7f~\x1f\x7f{\x7fs\x7f\x7fo{\x7fO\x7f\x7f\x7fC\x7f\x7f\x7f~?\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x0f\x7f\x7f\x7f\x14\x7f|\x7f\x7f\x05a_|?\x7f~\x0f\x7fxm\x7f\x06\x03\x7fq\x7f\x7fq\x7fx?g\x0f\x7f|\x1f\x7f\x7f\x7fx\x02\x7f}\x7f\x7f\x1f'), (np.float64(0.4564), [], 'place508_flat', 1, 1, 5, False, b'\x03p\x7fc\x7f\x0f\x7f\x7f{\x7fy\x7f\x7f~{?~\x7f\x7f?x\x7f\x7f\x7fO\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x1f~\x7f\x7f\x1fe\x7fg\x7f\x1ft0\x7fG\x7f\x7f\x0f~\x7fcv\x1f\x0cx\x7fq\x7f\x7fq\x7fC\x7f\x1c~\x7f\x07\x7f\x7f\x7f\x7f\x03h\x7fw\x7f\x1f\x7f'), (np.float64(0.4556), [], 'place508_flat', 1, 0, 5, False, b'\x7f\x7fCcq<`s?r\x1f}\x7f(x\x7f\x7f\x7f\x7f\x7f\x7f\x7fc@\x07\x7f\x7fo\x7f.\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7fg\x7fq\x7f\x7fw\x7f\x7f\x7f\x7fo\x7f?\x1fx\x7f/q?`\x7f\x7f\x03qp\x1fLw\x7f\x01?x\x7f\x7fCGC\x19C'), (np.float64(0.4552), [], 'place508_flat', 1, 1, 1, False, b'?\x00~?|\x7fq\x7f?\x7f\x1f\x7f\x7fo?\x7fg\x7f\x7f\x7f\x07\x7f\x7f\x7f\x7fy\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7fc\x7f\x7f\x7fS|\x7f|\x7fC\x0ev\x7fx\x7f\x7fa\x7f?l~C\x01\x7f\x1f~\x7f\x1f~?xOc\x7f\x7fp\x7f\x7f\x7f?\x00}\x7f~\x7fs'), (np.float64(0.455), [], 'place508_flat', 1, 1, 2, False, b'\x1f\x00\x7f\x1f~\x7fx\x7f_\x7fO\x7f\x7fw_\x7fs\x7f\x7f\x7fC\x7f\x7f\x7f\x7f|\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7fq\x7f\x7f\x7f)~?~\x7f!\x07{?|\x7f\x7fp\x7f\x1f6\x7fa@\x7f\x0f\x7f\x7f\x0f\x7f\x1f|gq\x7f?x\x7f\x7f\x7f\x1f@~?\x7f\x7fy'), (np.float64(0.454), [], 'place508_flat', 1, 1, 4, True, b'p\x03\x7fq\x7f|?\x7fw\x7fg\x7f\x7f_w\x7f\x1f\x7f\x7f\x7f\x07\x7f\x7f\x7f|\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f~\x1f\x7f\x7f~)\x7fy\x7f~\x0bC?x\x7f\x7f|\x1f\x7fq[~\x0c\x07\x7fc\x7f\x7fc\x7fp\x7fN\x1f\x7fx?\x7f\x7f\x7fp\x05\x7f{\x7f~?'), (np.float64(0.453), [], 'place508_flat', 1, 1, 3, False, b'\x0f@\x7f\x0f\x7f?|\x7fo\x7fg\x7f\x7f{o\x7fy\x7f\x7f\x7fa\x7f\x7f\x7f?~\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7fx\x7f\x7f\x7f\x14\x7f\x1f\x7f\x7fPC}\x1f~\x7f?x\x7f\x0f[\x7f0`\x7fG\x7f\x7fG\x7f\x0f~sx\x7f\x1f|\x7f\x7f\x7f\x0f \x7f_\x7f\x7f|'), (np.float64(0.453), [], 'place508_flat', 1, 1, 5, True, b'`\x07\x7fc\x7fx\x7f\x7fo\x7fO\x7f\x7f?o~?\x7f\x7f~\x0f\x7f\x7f\x7fy\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f|?\x7f\x7f|S\x7fs\x7f|\x17\x06\x7fq\x7f\x7fx?\x7fc7|\x18\x0f\x7fG\x7f\x7fG\x7fa\x7f\x1c?\x7fp\x7f\x7f\x7f\x7f`\x0b\x7fw\x7f|\x7f'), (np.float64(0.4518), [], 'place508_flat', 1, 0, 6, True, b'\x7f\x7fCG\x0e<\x07O|Oy?~\x14\x1f\x7f\x7f\x7f\x7f\x7f\x7f\x7fF\x03a\x7f\x7fw~u\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7fg\x7f\x0f\x7f\x7fo\x7f\x7f\x7f\x7fw\x7f}x\x1f\x7fu\x0f|\x07\x7f\x7fA\x0e\x0fx3o\x7f\x01|\x1f\x7f\x7fCcC\x19C'), (np.float64(0.4502), [], 'place508_flat', 1, 0, 3, True, b'\x7f\x7fx8qg@y\x7fI\x7f\x17\x7fbC\x7f\x7f\x7f\x7f\x7f\x7f\x7fx`<\x1f\x7f~\x7fn_\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f|\x7fq\x7f\x7f}\x7f\x7f\x7f\x7f~\x7f\x7f_\x03\x7f~Q\x7f@\x7f\x7fx\x11a\x7f\x06=\x7fp\x1fC\x7f\x7fx<83\x18'), (np.float64(0.45), [], 'place508_flat', 1, 0, 5, True, b"\x7f\x7facG\x1e\x03g~'|_\x7f\n\x0f\x7f\x7f\x7f\x7f\x7f\x7f\x7fc\x01p\x7f\x7f{\x7f:\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7fs\x7fG\x7f\x7fw\x7f\x7f\x7f\x7f{\x7f~|\x0f\x7fzG~\x03\x7f\x7f`G\x07|\x19w\x7f@~\x0f\x7f\x7faqaLa"), (np.float64(0.4498), [], 'place508_flat', 1, 1, 2, True, b'|\x00\x7f|?\x7f\x0f\x7f}\x7fy\x7f\x7fw}\x7fg\x7f\x7f\x7fa\x7f\x7f\x7f\x7f\x1f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7fG\x7f\x7f\x7fJ?~?\x7fBpo~\x1f\x7f\x7f\x07\x7f|6\x7fC\x01\x7fx\x7f\x7fx\x7f|\x1fsG\x7f~\x0f\x7f\x7f\x7f|\x01?~\x7f\x7fO'), (np.float64(0.4498), [], 'place508_flat', 1, 1, 4, False, b'\x07`\x7fG\x7f\x1f~\x7fw\x7fs\x7f\x7f}w\x7f|\x7f\x7f\x7fp\x7f\x7f\x7f\x1f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f?|\x7f\x7f?J\x7fO\x7f?ha~\x0f\x7f\x7f\x1f|\x7fGm?\x18p\x7fc\x7f\x7fc\x7f\x07\x7f9|\x7f\x0f~\x7f\x7f\x7f\x07P\x7fo\x7f?~'), (np.float64(0.4484), [], 'place508_flat', 1, 0, 6, False, b'\x7f\x7faq8\x1epy\x1fyO~?\x14|\x7f\x7f\x7f\x7f\x7f\x7f\x7f1`C\x7f\x7fw?W\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7fs\x7fx\x7f\x7f{\x7f\x7f\x7f\x7fw\x7f_\x0f|\x7fWx\x1fp\x7f\x7fA8x\x0ff{\x7f@\x1f|\x7f\x7facaLa'), (np.float64(0.447), [], 'place508_flat', 1, 0, 1, True, b'\x7f\x7f~\x0e\x1c9p\x1e?r?e\x7fxP\x7f\x7f\x7f\x7f\x7f\x7f\x7f~\x18\x0f\x07\x7f\x7f_{W\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x1f|?\x7f\x7f?\x7f\x7f\x7f\x7f_\x7fw`\x7f\x7fT?p\x1f\x7f~\x048?aO?|\x07p\x7f\x7f~\x0f\x0e\x0cf')]

思考

Searched 5 websites

Worked for 25m 43s

回答

我已经把线索基本定位到了,但目前还不能可靠地给出 flag,原因在于你上传的这份图很可能经过了缩放/重压缩,恰好破坏了这种题最关键的像素排列信息。

目前能确定的解题链是:

  1. David Hilbert 指向 Hilbert Curve(希尔伯特空间填充曲线)。这类图片混淆确实会沿 Hilbert/Gilbert 曲线逐像素遍历、重新排列。现成的“小番茄图片混淆”使用的就是广义 Hilbert(Gilbert)曲线,并沿曲线进行像素偏移。(小番茄图片混淆)
  2. 我分析了图像的像素周期。当前文件虽然是 1280×317,但边缘频谱存在非常明显的 5 px 周期:横向对应 256 个逻辑单元,纵向对应约 64 个逻辑单元。也就是说,它非常像一张原本约 256×64 的像素图,被放大到当前尺寸。
  3. 这一步和文件名“我不喜欢十六进制”非常吻合:
    256 × 64 = 16384 = 0x4000
    因此 16384 / 4000 很可能正是“分辨率与密码”的下一层提示。
  4. 我已经按 256×64 重建,并尝试了 Hilbert/Gilbert 的正反遍历、直接置换以及沿曲线的循环偏移,包括完整扫描偏移量。能明显恢复出空间结构,但还没有出现可以可信读取的 flag{...}。这通常意味着我们拿到的不是加密时的原始像素矩阵。
  5. 关键问题是当前文件叫 ..._720.jpg,而且是 JPEG。Hilbert 像素置换要求像素位置精确;图片一旦 resize 或 JPEG 重压缩,就会把相邻像素混合。相关 Hilbert/Gilbert 混淆本来就是依赖逐像素可逆排列的。(GitHub)

所以我目前最需要的是:请把题目下载得到的原始图片文件直接上传,不要截图、不要通过聊天软件转存,也不要另存为 JPG。 如果原题给的是 PNG,就一定上传那个 PNG。

拿到原图后,我会优先按:

分辨率 → 256×64 / 0x4000 → 密码 16384(及其相关表示) → Hilbert/Gilbert 遍历 → 逆像素置换

这条链继续解,目标是直接给你最终 flag{...},而不是猜 flag。

分享这个问答