Crypto-Naptime

I'm pretty tired. Don't leak my flag while I'm asleep. - Anakin

Challenge

def enc(flag, a, n):
    bitstrings = []
    for c in flag:
        # c -> int -> 8-bit binary string
        bitstrings.append(bin(ord(c))[2:].zfill(8))
    ct = []
    for bits in bitstrings:
        curr = 0
        for i, b in enumerate(bits):
            if b == "1":
                curr += a[i]
        ct.append(curr)
    return ct

Despite there being an alternative method of decryption in the challenge by bruteforce, we can see that this is a knapsack question.

We use the CJLOSS algorithm given below and the code from herearrow-up-right

file-pdf
752KB
Pg 18, A Gentle Tutorial for Lattice-Based Cryptanalysis

Last updated