868 B
868 B
XMASSpirit
Now that elves have taken over Santa has lost so many letters from kids all over the world. However, there is one kid who managed to locate Santa and sent him a letter. It seems like the XMAS spirit is so strong within this kid. He was so smart that thought of encrypting the letter in case elves captured it. Unfortunately, Santa has no idea about cryptography. Can you help him read the letter?
Flag
HTB{4ff1n3_c1ph3r_15_51mpl3_m47h5}
- See letter.pdf
How to solve
See decrypt.py
Progress
Code analysis:
- Choose a
randintafrom1tomod, that is not divisible by mod. - Choose a
randintbfrom1tomod. - for each byte in
dt- calculate
(a * byte + b) % mod - append to output bytes
- calculate
- return bytes when done
Notes
s_next = (a * s_prev + b) mod pis a linear congruential generator