A GENERAL IDEA ABOUT HOW DO THE REMOTES OF A CAR WORK?
There is a transmitter in the car remote which sends the 40 bit code with the function code (which tells the car to open the doors, lock the doors or any other function) and there is a receiver in the car which receives this code & matches it. If matched then the corresponding function is performed.
HOW IS THE SECURITY ENSURED AS ANYONE CAN CAPTURE THE CODE AND CAN RE TRANSMIT IT TO OPEN THE CAR?
To ensure this, there is pseudo number generator with the transmitter which generates a new code every time and sends this new code. At the same time receiver has the same pseudo number generator which generates the next code on the receiver side too which is stored in the memory of receiver. When the transmitter sends the code, receiver matches it with the received code. Hence every time button on the remote is pressed, a new code is generated. As code width is of 40 bits, so there would be 240 (1 trillion) numbers of code combinations possible.
WHAT IF USER PRESSES THE BUTTON ON THE REMOTE WHEN HE IS AWAY FROM THE CAR SUCH THAT CAR DOESN’T RECEIVE THE CODE?
Well if this happens, then the code stored in the receiver and the code transmitted by the remote would not match. Hence to overcome this problem, the receiver accepts any of the next 256 combinations of pseudo code sequence and hence if a user presses the button when away, less than or equal to 256 times, then the remote would work but if button is pressed 257 times or more remote would not work. How ever this can be solved as there can be a button to reset everything.