I'm trying to implement a (sort of) simple PRNG in hardware for fun. My idea would be to allow a user to enter a key using a keypad (or some dip switch settings that can be set and hidden) and to obtain a seed using photo, gyro and audio sensors feedback.
I understand I'll probably have to implement some form of modulo arithmetic in hardware. However, I thought up of a hardware-simple algorithm that would only need to use XOR gates. What are your opinions on it?
key = k bits taken from keypad entry
seed = k bits taken from environment sensors
while (true):
seed << seed[3] // rotate the seed if seed[3] is 1
newSeed <- key XOR seed // the new seed is XORed with the key
output <- lsb(newSeed) // output the lsb of the seed
seed <- newSeed
It outputs the lsb of the newly calculated seed. I have no experience in algorithm design so I'm sure this is riddled with attacks. If the above is not sufficient for a PRNG, which should I use? Is there one which is known to be simpler for low-bit hardware?