CRACK Solution

Mirror Cipher

CRACK reversed index + XOR

In-game screenshot of Mirror Cipher
In-game view
FamilyCRACK Graph0.251 DifficultyEasy Ring02 IDz1_rev_xor

Prerequisites

LIMITER

Unlocks

Even/Odd Keys

Accepted input REWIND
Techniquereversed index + XOR Rulenonzero SampleREWIND

Walkthrough

Recover the accepted input below, then submit it to the CRACK verifier.

Reject Samples

  • REWIN
  • REWINDX
  • rewind
  • DNIWER
  • SEWIND
Verifier Listing
; z1_rev_xor: Mirror Cipher. Two transforms stacked: the stored byte at
; position i is compared against the input read BACKWARDS (position n-1-i) and
; XOR'd with 0x5a. Undo both the reversal and the XOR. r0 = 1 on accept.
;
;   enc[i] = input[5: i] ^ 0x5a, enc = { 0x1e, 0x14, 0x13, 0x0d, 0x1f, 0x08 }.
; XOR each enc with 0x5a -> { 'R','E','W','I','N','D' } read forward; reading the
; input backward to match means input spells "REWIND". Length must be 6.
; Answer: REWIND
;
; Here r7 walks the input backward (5,4,3,2,1,0) while comparing against enc[i].

        len   r1
        cmp   r1, 6
        jnz   bad           ; length must be exactly 6

        mov   r7, 5         ; input[5] ^ 0x5a must equal enc[0]
        ldb   r0, [r7]
        xor   r0, 0x5a
        cmp   r0, 0x1e
        jnz   bad
        dec   r7
        ldb   r0, [r7]      ; input[4]
        xor   r0, 0x5a
        cmp   r0, 0x14
        jnz   bad
        dec   r7
        ldb   r0, [r7]      ; input[3]
        xor   r0, 0x5a
        cmp   r0, 0x13
        jnz   bad
        dec   r7
        ldb   r0, [r7]      ; input[2]
        xor   r0, 0x5a
        cmp   r0, 0x0d
        jnz   bad
        dec   r7
        ldb   r0, [r7]      ; input[1]
        xor   r0, 0x5a
        cmp   r0, 0x1f
        jnz   bad
        dec   r7
        ldb   r0, [r7]      ; input[0]
        xor   r0, 0x5a
        cmp   r0, 0x08
        jnz   bad

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