With the rapid growth of smartphone and tablet users, Device-to-Device (D2D) communications have become an attractive solution for enhancing... Show moreWith the rapid growth of smartphone and tablet users, Device-to-Device (D2D) communications have become an attractive solution for enhancing the performance of traditional cellular networks. However, relevant security issues involved in D2D communications have not been addressed yet. In this thesis, I investigate the security requirements and challenges for D2D communications, and present a secure and efficient key agreement protocol, which enables two mobile devices to establish a share secret key for D2D without prior knowledge. The mobile devices are playing an important role in our social life. People trend to share their files and chat with each other without Wi-Fi. Wi-Fi Direct technology provides a very good way to satisfy people’s need. After established a security D2D communication, I used the socket communication method to implement the chat function between devices and some protocols to enable the files transmitted. In the file transfer function, my demo support any types of the files. In the chat function, my demo also uses the shared secret to encrypt the message and then the receiver can decrypt it with the shared secret. M.S. in Electrical Engineering, December 2014 Show less