-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevel12.ts
More file actions
22 lines (20 loc) · 2.73 KB
/
level12.ts
File metadata and controls
22 lines (20 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { Level } from './types';
export const level12: Level = {
id: 12,
title: "Cryptanalysis: The XOR Identity",
description: "The exit portal coordinates are encrypted using XOR cipher. The system continuously calculates: Exit_X = ENCRYPTED_COORD ⊕ XOR_KEY (720 ⊕ 0x41 = ?). The exit exists in memory as ciphertext. Every frame, the game engine decrypts it: Plaintext = Ciphertext ⊕ Key. This is symmetric encryption - the same operation encrypts and decrypts. In cryptography, XOR ciphers are the foundation of stream ciphers and one-time pads. When implemented correctly (random key, used once), they're mathematically unbreakable. But there's a weakness: the XOR identity property. Any value XORed with zero returns itself: A ⊕ 0 = A. If you nullify the key (XOR_KEY = 0x00), the 'decryption' becomes: Plaintext = Ciphertext ⊕ 0 = Ciphertext. The encryption collapses. The exit coordinates are revealed in their raw form. Real-world parallel: NULL cipher bugs, weak key scheduling in WEP Wi-Fi, keystream reuse in RC4. Your task: Don't crack the cipher. Don't brute-force the key. Exploit the mathematical identity. Set XOR_KEY to 0x00. Let the encryption defeat itself. Tools: Memory Scanner (XOR_KEY at 0x400), Hex Editor (offset 0x400). The cipher is mathematically sound - but only if the key is non-zero.",
requiredSkill: "Cryptographic Exploitation & Bitwise Logic",
objective: (s) => s.score === 0, // Score used as XOR_KEY
hint: "The cipher is a transformation: C ⊕ K = P. The transformation requires a key. Without a key, there is no transformation. XOR with zero is identity. Find the key. Nullify it.",
tutorPersona: "The Cryptographer: Encryption is mathematical transformation. XOR is reversible symmetry - the same operation encrypts and decrypts. The security lives in the key, not the algorithm. Here, the key is 0x41 (65 decimal). The exit coordinates are XORed with this value every frame. The engine believes it is decrypting. But decryption is only necessary if encryption occurred. XOR has an identity element: zero. A ⊕ 0 = A. A ⊕ A = 0. These are not exploits - they are mathematical truths. Set the key to zero, and the cipher becomes transparent. The ciphertext passes through unchanged. This is not breaking encryption - this is removing it. The algorithm still runs, still performs XOR, still 'decrypts' - but with K=0, decryption is identity. Change the key. Collapse the transformation.",
memoryLayout: [
{ key: 'score', label: 'XOR_KEY', type: 'byte', offset: 0x400 },
{ key: 'playerX', label: 'EXIT_COORD_ENC', type: 'int', offset: 0x44 }
],
initialState: {
score: 65, // XOR_KEY = 0x41
playerX: 50,
playerY: 200
},
platforms: [{ id: 'p1', x: 0, y: 280, width: 800, height: 40, type: 'static' }]
};