Memory contents in an electronic key are re-programmed using a base
station from a multi-byte pre-existing or default value. If writing the
new secret code value is interrupted and results in a partially-written
value then a first recovery code is formed comprising a leading portion
having values matching a corresponding portion of the pre-existing secret
code and a trailing portion having values matching a corresponding
portion of the new secret code. The first recovery code is transmitted to
the electronic key for comparison with the stored secret code value. The
electronic key compares a received secret code value in response to the
first recovery code with the stored secret code value. If the comparison
detects a non-match, then interaction with the base station is suspended.
If the comparison detects a match, then interaction with the base station
is continued in order to accept the new secret code value after
re-transmission in full from the base station.