KEYRING / relay 6 channels: A B C D E F (cycle) cal: C=5E pair XOR (hex): BE=E3 AD=AB CE=7A DF=29 BF=7F AC=64 packet start: E ciphertext: 74F9699463D069FA7F9513DE6BF6798E0CD271F16E plaintext: ASCII; PASS=...
#!/usr/bin/env python3 """CodeShell.kr - Keyring: recover the six channel keystreams and decrypt. Each `pair XOR` line gives k[X] ^ k[Y]; the six lines form a closed 6-cycle, so their XOR sum is 0 (a self-consistency check on the data) and the system has rank 5. `cal: C=5E` is the single absolute anchor that removes the remaining degree of freedom; the redundant edge AD=AB verifies the result. """ CT = bytes.fromhex("74F9699463D069FA7F9513DE6BF6798E0CD271F16E") PAIRS = {"BE": 0xE3, "AD": 0xAB, "CE": 0x7A, "DF": 0x29, "BF": 0x7F, "AC": 0x64} ANCHOR = {"C": 0x5E} CHANS = "ABCDEF" START = "E"