RSA signature forgery
RSA signature is the reverse of encryption. The signer calculates s = md mod n with the private key, while the verifier sees that se mod n == m with the public key.
An unpadded (textbook) signature is homomorphic with respect to multiplication: (m1·m2)d = m1d · m2d (mod n). That is, if we multiply the signatures of two documents, a valid signature for their product is produced — without knowing the private key.
The notary has signed 24 document numbers; the list and signatures are in the notarius.txt file (hujjat01…hujjat24 and the corresponding imzo01…imzo24). target in the file is a document number for which a signature was not provided to you. It is impossible to contact the notary again.
Among the documents in the list, there are two whose product is exactly equal to target. Find them (simple check: target % hujjat == 0), multiply their signatures modulo the modulus, and generate a forged signature.
The flag is the last 16 decimal digits of the forged signature: BAYROQ{RS4_soxta_imzo_<16_raqam>}. Verification: pow(soxta, e, n) == target.