A non-transitory computer-readable medium configured to store instructions for, upon execution of the instructions on a mobile device, causing the mobile device to establish a device-to-device (D2D) communication session with a further mobile device, the mobile device and the further mobile device being mutually connectable via a D2D communication channel and individually connectable to a mobile network, by:
- storing an initiation key which is provided during a preloading procedure, the initiation key being associated with a validity period;
- verifying a validity of the initiation key based on a current time;
- requesting a further initiation key via the mobile network if no initiation key is deemed valid;
- if the initiation key is deemed valid, generating a session key using the initiation key by using the initiation key in performing a key agreement procedure with the further mobile device over the D2D communication channel, the key agreement procedure resulting in the session key if the initiation key used by the mobile device matches an initiation key used by the further mobile device;
- and
- establishing the D2D communication session over the D2D communication channel based on the session key.