A method (200, 300, 500) for execution by a processor of a hardware system for performing secure communication via a secure communication channel with an external device, the method comprising: determining a master key value (210, 310, 510) for use in secure communications (260, 360, 560) with the external device; both in the hardware system and in the external device, periodically deriving a first session key (240, 340, 540) using the master key value (210, 310, 510), and periodically generating a new master key value (212, 312, 512) based on the master key value (210, 310, 510); and deleting the master key value (210, 310, 510), wherein the periodically deriving the first session key (240, 340, 540) using the master key value (210, 310, 510) and the periodically generating the new master key value (212, 312, 512) based on the master key value (210, 310, 510) comprises one of the following procedures a), b), and c): a) deriving a second session key using the master key value, and combining the derived first session key and the derived second session key to thereby generate the new master key value; b) deriving a second session key using the master key value, combining the master key value and the derived first session key to yield a combined result, and combining the combined result and the derived second session key to thereby generate the new master key value; and c) generating the new master key value using the master key value, and deriving the first or a second session key by combining the master key value and the new master key value, and wherein the method further comprises both parties to the secure communication, that is the processor and the external device, altering the master key in the same way. determining a master key value (210, 310, 510) for use in secure communications (260, 360, 560) with the external device; both in the hardware system and in the external device, periodically deriving a first session key (240, 340, 540) using the master key value (210, 310, 510), and periodically generating a new master key value (212, 312, 512) based on the master key value (210, 310, 510); and deleting the master key value (210, 310, 510), wherein the periodically deriving the first session key (240, 340, 540) using the master key value (210, 310, 510) and the periodically generating the new master key value (212, 312, 512) based on the master key value (210, 310, 510) comprises one of the following procedures a), b), and c): a) deriving a second session key using the master key value, and combining the derived first session key and the derived second session key to thereby generate the new master key value; b) deriving a second session key using the master key value, combining the master key value and the derived first session key to yield a combined result, and combining the combined result and the derived second session key to thereby generate the new master key value; and c) generating the new master key value using the master key value, and deriving the first or a second session key by combining the master key value and the new master key value, a) deriving a second session key using the master key value, and combining the derived first session key and the derived second session key to thereby generate the new master key value; b) deriving a second session key using the master key value, combining the master key value and the derived first session key to yield a combined result, and combining the combined result and the derived second session key to thereby generate the new master key value; and c) generating the new master key value using the master key value, and deriving the first or a second session key by combining the master key value and the new master key value, and wherein the method further comprises both parties to the secure communication, that is the processor and the external device, altering the master key in the same way.