Question: how a key fob works?
Answer: When you push a button on your key fob, it sends that 40-bit code along with a function code that tells the car what you want to do (lock the doors, unlock the doors, open the trunk, etc.). ... On the other end, when the receiver receives a valid code, it uses the same pseudo-random number generator to pick a new one.