3 ms·
Yes you can programatically generate a key.
Yes you can programatically generate a key.
And we call that a stream cipher, not "XOR encryption", even though it uses a XOR operation. You're programmatically generating a keystream, which is not the same thing as a key.