Here is my algorithm :
- XOR the ASCII of ‘@’ with the first number to get R(offset+1)
- Use the formula to get the others R(N) needed
- XOR the R(N) with their corresponding input number to get the final message

It doesn’t seem to work however, since I’m unable to find the right message at the end.

Here is my code (python) :

import sys

offset = int(raw_input())
length = int(raw_input())
c = []
for i in xrange(length):
c.append(int(raw_input()))

b_at = ord(’@’)
R = []
R.append(b_at ^ c[0])

for k in range(1,length):
nombre = (7562100 * R[-1] + 907598307) % 7140
nombre = nombre & 0b11111111
R.append(nombre)

message = “”

for k in range(1, length):
message += chr(c[k] ^ R[k])

Each undiscarded random number from the RNG is then XOR’ed with the ASCII code of each character, truncated to the lowest 8 bits.

Hence “@” XOR the first number is not R(offset+1) but R(offset+1) & 0b11111111.
Moreover (this is related to the same misunderstanding), your nombre = nombre & 0b11111111 completely disturbs the RNG (to compute R(i+1), you are supposed to keep the whole R(i), not only its last 8 bits).