"Can you see the light?" — 2-level encoding challenge。页面显示 3
段大二进制数据,分别用 RGB 三种颜色渲染。
Solution
颜色提示了处理方法:三种颜色通道是三个独立的二进制序列,需要做位运算组合。
Level 1 — OR
将三个颜色通道的二进制逐 bit 做 OR(或)运算:只要任意一个颜色在该
bit 为 1,结果就为 1。
1 2 3 4 5 6 7 8 9 10 11 12 13
$ python3 # 三个颜色块的二进制数据(全部拼接) >>> red = '000000000110000001100000000000000000000001000000...' >>> green = '010000010110100000100000000000000000000000000001...' >>> blue = '010000010100000001100001001000010010000000001000...' # 逐 bit OR >>> result = '' >>> for i inrange(len(red)): ... result += '1'ifint(red[i]) | int(green[i]) | int(blue[i]) else'0' ... # 按 8-bit 转 ASCII >>> ''.join(chr(int(result[i:i+8], 2)) for i inrange(0, len(result), 8)) 'Aha! It seems you got something interesting!\nWell to go to the next stage, go there:\n01001100011...'
$ python3 # 逐 bit XOR >>> result = '' >>> for i inrange(len(cyan)): ... result += '1'ifint(cyan[i]) ^ int(magenta[i]) ^ int(yellow[i]) else'0' ... >>> ''.join(chr(int(result[i:i+8], 2)) for i inrange(0, len(result), 8)) 'Triple-X-OR, right?\nGreat! Here is what you should be looking for..."Gimme_Da_Light"'
最终答案在消息末尾。
Gimme_Da_Light
+++
SYSTEM STATUS: ACTIVEENCRYPTED SECTOR 7PRTS_TERMINAL_V2.0PROTOCOL: 0x2AENCRYPTED DATA STREAMSYSTEM: ONLINE