Let’s discuss The Most Secured Crypto-Channel
. Please do not share any flags or writeups.
Very similar challenge
def get_agreed_bytes(data_sent, bases_measured, bases_correct, v1, v2):
agreed_bits = []
for i in range(len(bases_correct)):
if bases_correct[i] == 'v':
if bases_measured[i] == '+':
if data_sent[i] == '-':
agreed_bits.append(v1)
else:
agreed_bits.append(abs(v1 - 1))
else:
if data_sent[i] == '/':
agreed_bits.append(v2)
else:
agreed_bits.append((abs(v2 - 1)))
return hex(int("".join([str(c) for c in agreed_bits]), 2))[2:-1]
Iterate through the files and, based on Bob’s modulation and the qbit positions, extract the bits where Bob was correct. After gathering the bits, we decode the binary string, we get a b64 string and decoding it gives the flag.