Device and system used for device-to-device secure communication

The invention provides a device and system used for device-to-device secure communication. According to the device and system used for device-to-device secure communication, a first user device determines a second user device to directly communicate with the first user device, a first network device generates secure configuration information of device-to-device communication for the first user device and the second user device which plan to carry out direct communication, and sends the secure configuration information to the first user device and the second user device, and the first user device and the second user device establish direct communication according to the secure configuration information. Compared with the prior art, the device and system used for device-to-device secure communication put emphasis on the secure feature of D2D communication. Besides, due to the fact that device used for the D2D communication can simultaneously support communication via an access link and a D2D link, the secure design of the D2D link does not affect the security of the access link. By means of the secure scheme, the device and system used for device-to-device secure communication can protect data flows from being received by a third party, and enables a receiving party to detect inserting and replacement of data groups.