First, let us try to get the value of s from noisy_s
noisy_s=1479x255+1479x254+2958x251+2958x250...
The only coefficients, in noisy_s are 1479 and 2958. This is because s is generated from gen_small_vect() which only has coefficients {0,2} so we can conclude noise=1479modp .
We can find the value of s by multiplying noise_s by noise−1=664modp
Now that we have the value of s,we can now try to find an equation that gives us the value of f (possibly with some error terms).
Although the degrees of the two terms are different, we can map values close to 1665 as 1 and values far from it as 0 to get the same set of values as the flag in the same interval.
p = 3329
degree = 256
Q.<y> = GF(p)[]
R.<x> = Q.quotient(y^degree + 1)
noisy_s= ...
ctxt= ...
Q(1479)^-1
#664
s = vector(R,noisy_s)*664
c0 = vector(R(i) for i in ctxt[0])
k1= ctxt[1]-c0*s
b1 = []
for i in k1.list():
if (p//2+200)>= i >= (p//2 -200):
b1.append(i)
else:
b1.append(0)
long_to_bytes(int(''.join(['1' if i else '0' for i in b1 ]),2))
#b'Breach{kyb3r_1n_cry5t4l5}\x00\x00\x00\x00\x00\x00\x00'
We are given a file, in which we find the ciphertexts and noisy_s . The error terms and noisy data makes it look like a problem.