CRACK Solution

DRIP FEED

CRACK LCG keystream XOR

In-game screenshot of DRIP FEED
In-game view
FamilyCRACK Graph0.599 DifficultyMedium Ring04 IDg22_med2

Prerequisites

PAIR SWAP

Unlocks

XOR TEETH

Accepted input PAYLOAD
TechniqueLCG keystream XOR Rulenonzero SamplePAYLOAD

Walkthrough

No key table here. A tiny generator drips a fresh XOR key for every byte, then walks itself forward. Trace the generator, lift the stream, decode the drop.

It is an LCG keystream XOR: the key starts at 0x9D and steps k = (k*3 + 0x47) each byte. Regenerate the stream and XOR it back into the targets.

Hints

  • HINT 1: Length is fixed at 7. Each byte is XOR'd with a key, but the key changes every position.
  • HINT 2: The key is a state machine. After each byte it updates as k = (k*3 + 0x47) and 0xFF, seeded at 0x9D.
  • HINT 3: Keystream is 9D 1E A1 2A C5 96 09. XOR it onto the targets and you get PAYLOAD.

Reject Samples

  • PAYLOAE
  • payload
  • PAYLOA
  • PAYLOADS
  • CRACKED
Verifier Listing
; g22_med2: "Drip Feed". Each byte is XOR'd with a different key from a small
; LCG: k0 = 0x9D, then k = (k*3 + 0x47) & 0xFF after each byte. The masked byte
; is compared to a stored target. No key table is stored; the stream is rebuilt
; on the fly. Recover the keystream and peel it off to read PAYLOAD.
; Technique: LCG keystream XOR. r0 = 1 on accept; rule: nonzero.
;
; keystream = 9D 1E A1 2A C5 96 09 ; targets = CD 5F F8 66 8A D7 4D ; answer PAYLOAD.
; k*3 is built as (k<<1)+k each step.

        len   r2
        cmp   r2, 7
        jnz   bad           ; exactly 7 bytes

        mov   r4, 0x9D      ; r4 = current key (LCG state = seed)

        ; position 0
        mov   r7, 0
        ldb   r0, [r7]
        xor   r0, r4
        cmp   r0, 0xCD
        jnz   bad
        mov   r5, r4
        shl   r5, 1
        add   r5, r4
        add   r5, 0x47
        mov   r4, r5        ; k = k*3 + 0x47 -> 0x1E

        ; position 1
        inc   r7
        ldb   r0, [r7]
        xor   r0, r4
        cmp   r0, 0x5F
        jnz   bad
        mov   r5, r4
        shl   r5, 1
        add   r5, r4
        add   r5, 0x47
        mov   r4, r5        ; -> 0xA1

        ; position 2
        inc   r7
        ldb   r0, [r7]
        xor   r0, r4
        cmp   r0, 0xF8
        jnz   bad
        mov   r5, r4
        shl   r5, 1
        add   r5, r4
        add   r5, 0x47
        mov   r4, r5        ; -> 0x2A

        ; position 3
        inc   r7
        ldb   r0, [r7]
        xor   r0, r4
        cmp   r0, 0x66
        jnz   bad
        mov   r5, r4
        shl   r5, 1
        add   r5, r4
        add   r5, 0x47
        mov   r4, r5        ; -> 0xC5

        ; position 4
        inc   r7
        ldb   r0, [r7]
        xor   r0, r4
        cmp   r0, 0x8A
        jnz   bad
        mov   r5, r4
        shl   r5, 1
        add   r5, r4
        add   r5, 0x47
        mov   r4, r5        ; -> 0x96

        ; position 5
        inc   r7
        ldb   r0, [r7]
        xor   r0, r4
        cmp   r0, 0xD7
        jnz   bad
        mov   r5, r4
        shl   r5, 1
        add   r5, r4
        add   r5, 0x47
        mov   r4, r5        ; -> 0x09

        ; position 6 (last; no further LCG step needed)
        inc   r7
        ldb   r0, [r7]
        xor   r0, r4
        cmp   r0, 0x4D
        jnz   bad

        mov   r0, 1
        ret
bad:    mov   r0, 0
        ret