A non-transitory computer-readable recording medium storing a computer program that causes a computer of a key generation device, which includes a vehicle interface that transmits and receives data to and from a second vehicle on which an in-vehicle computer detached from a first vehicle is installed, to realize processing of:
- generating a first key that is the same as a key stored in the in-vehicle computer from a time when the in-vehicle computer was installed in the first vehicle by using an in-vehicle computer identifier of the in-vehicle computer, and a master key that is common to the first vehicle and the second vehicle;
- and
- transmitting the first key to the second vehicle through the vehicle interface.