← Questions
XOR random number generator to encrypt and decrypt a tree
0
I was asked this
No reports yet. Sign in to say where you were asked it.
- Implement a pseudo-random number generator whose state update uses bitwise XOR (shifts and XORs on an integer state), seeded so the same seed always gives the same sequence.
- Use it to encrypt a tree-structured document, walking the tree in a fixed order and mixing each value with the next generated number, and write the decryption that turns the result back into the original document. Explain why the same seed and the same traversal order make decryption work.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
