srdnlen2026 quals started
This commit is contained in:
18
2026/srdnlen_quals/forensic/chapter1/solve.py
Normal file
18
2026/srdnlen_quals/forensic/chapter1/solve.py
Normal file
@@ -0,0 +1,18 @@
|
||||
docbody = [206,56,8,128,209,47,2,149,202,34,95,128,226,41,92,156,
|
||||
142,38,51,153,137,57,51,218,211,21,88,130,201,121,30,128,
|
||||
137,62,93,152,142,55]
|
||||
|
||||
# Known prefix "srdnlen{"
|
||||
prefix = "srdnlen{"
|
||||
|
||||
# Derive key bytes from known prefix
|
||||
key = []
|
||||
for i, c in enumerate(prefix):
|
||||
key.append(docbody[i] ^ ord(c))
|
||||
|
||||
print(f"Derived key bytes: {key}")
|
||||
print(f"Derived key chars: {''.join(chr(k) for k in key)}")
|
||||
|
||||
# Decode full docbody with cycling key
|
||||
result = ''.join(chr(docbody[i] ^ key[i % len(key)]) for i in range(len(docbody)))
|
||||
print(f"\nDecoded flag: {result}")
|
||||
Reference in New Issue
Block a user